]> code.delx.au - gnu-emacs/blobdiff - lisp/man.el
Derive secrets-mode from special-mode
[gnu-emacs] / lisp / man.el
index 2b2ee99a9be406d08934e53ff0be7bbdc3ea0dd6..d127decfebd8497411944ae66f67972d577ee225 100644 (file)
@@ -308,7 +308,7 @@ This regular expression should start with a `^' character.")
 
 (defvar Man-reference-regexp
   (concat "\\(" Man-name-regexp
-         "\\(\n[ \t]+" Man-name-regexp "\\)*\\)[ \t]*(\\("
+         "\\(‐?\n[ \t]+" Man-name-regexp "\\)*\\)[ \t]*(\\("
          Man-section-regexp "\\))")
   "Regular expression describing a reference to another manpage.")
 
@@ -779,7 +779,7 @@ POS defaults to `point'."
       ;;     see this-
       ;;     command-here(1)
       ;; Note: This code gets executed iff our entry is after POS.
-      (when (looking-at "[ \t\r\n]+\\([-a-zA-Z0-9._+:]+\\)([0-9])")
+      (when (looking-at "‐?[ \t\r\n]+\\([-a-zA-Z0-9._+:]+\\)([0-9])")
        (setq word (concat word (match-string-no-properties 1)))
        ;; Make sure the section number gets included by the code below.
        (goto-char (match-end 1)))
@@ -964,7 +964,7 @@ otherwise look like a page name.
 
 An \"apropos\" query with -k gives a buffer of matching page
 names or descriptions.  The pattern argument is usually an
-\"egrep\" style regexp.
+\"grep -E\" style regexp.
 
     -k pattern"
 
@@ -1430,8 +1430,17 @@ manpage command."
                        (quit-restore-window
                         (get-buffer-window (current-buffer) t) 'kill)
                      (kill-buffer (current-buffer)))
-                   (message "Can't find the %s manpage"
-                            (Man-page-from-arguments args)))
+                    ;; Entries hyphenated due to the window's width
+                    ;; won't be found in the man database, so remove
+                    ;; the hyphenation -- assuming Groff hyphenates
+                    ;; either with hyphen-minus (ASCII 45, #x2d),
+                    ;; hyphen (#x2010) or soft hyphen (#xad) -- and
+                    ;; look again.
+                   (if (string-match "[-‐­]" args)
+                       (let ((str (replace-match "" nil nil args)))
+                         (Man-getpage-in-background str))
+                      (message "Can't find the %s manpage"
+                               (Man-page-from-arguments args))))
 
                (if Man-fontify-manpage-flag
                    (message "%s man page formatted"