aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/man.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/lisp/man.el b/lisp/man.el
index d52ca2156d2..8858451b384 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1288,8 +1288,23 @@ default type, `Man-xref-man-page' is used for the buttons."
1288 1288
1289(defun Man-highlight-references0 (start-section regexp button-pos target type) 1289(defun Man-highlight-references0 (start-section regexp button-pos target type)
1290 ;; Based on `Man-build-references-alist' 1290 ;; Based on `Man-build-references-alist'
1291 (when (or (null start-section) 1291 (when (or (null start-section) ;; Search regardless of sections.
1292 (Man-find-section start-section)) 1292 ;; Section header is in this chunk.
1293 (Man-find-section start-section)
1294 ;; Section header was in one of the previous chunks.
1295 (save-excursion
1296 (save-restriction
1297 (let ((orig-pos (point)))
1298 (widen)
1299 (if (Man-find-section start-section)
1300 ;; We are in the right section of the next
1301 ;; section is either not yet in the buffer, or
1302 ;; it starts after the position where we should
1303 ;; start highlighting.
1304 (progn
1305 (forward-line 1)
1306 (or (null (re-search-forward Man-heading-regexp nil t))
1307 (> (point) orig-pos))))))))
1293 (let ((end (if start-section 1308 (let ((end (if start-section
1294 (progn 1309 (progn
1295 (forward-line 1) 1310 (forward-line 1)