summaryrefslogtreecommitdiff
path: root/lisp/man.el
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2011-07-03 03:35:35 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2011-07-03 03:35:35 +0200
commit0dd8b6da56db8f711b2707f9fd5340fbe4615355 (patch)
treeeb0f306a0d263711ce0e26e3de43ec8639439c3a /lisp/man.el
parentce1438d696bd670b5aba5690ce4f73b836b20194 (diff)
downloademacs-0dd8b6da56db8f711b2707f9fd5340fbe4615355.tar.gz
* man.el (Man-reference-regexp): Allow matching possible
word-wrapped references (bug#6289).
Diffstat (limited to 'lisp/man.el')
-rw-r--r--lisp/man.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 7a9e6e3cca5..b5a70395e59 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -276,7 +276,9 @@ This regexp should not start with a `^' character.")
This regular expression should start with a `^' character.")
(defvar Man-reference-regexp
- (concat "\\(" Man-name-regexp "\\)[ \t]*(\\(" Man-section-regexp "\\))")
+ (concat "\\(" Man-name-regexp
+ "\\(\n[ \t]+" Man-name-regexp "\\)*\\)[ \t]*(\\("
+ Man-section-regexp "\\))")
"Regular expression describing a reference to another manpage.")
(defvar Man-apropos-regexp
@@ -597,8 +599,8 @@ and the `Man-section-translations-alist' variables)."
(cond
;; "chmod(2V)" case ?
((string-match (concat "^" Man-reference-regexp "$") ref)
- (setq name (match-string 1 ref)
- section (match-string 2 ref)))
+ (setq name (replace-regexp-in-string "[\n\t ]" "" (match-string 1 ref))
+ section (match-string 3 ref)))
;; "2v chmod" case ?
((string-match (concat "^\\(" Man-section-regexp
"\\) +\\(" Man-name-regexp "\\)$") ref)