aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/info.el53
1 files changed, 43 insertions, 10 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 331a2a28ce7..0dd5793828b 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1316,6 +1316,7 @@ FOOTNOTENAME may be an abbreviation of the reference name."
1316 (interactive 1316 (interactive
1317 (let ((completion-ignore-case t) 1317 (let ((completion-ignore-case t)
1318 (case-fold-search t) 1318 (case-fold-search t)
1319 (inhibit-point-motion-hooks t)
1319 completions default alt-default (start-point (point)) str i bol eol) 1320 completions default alt-default (start-point (point)) str i bol eol)
1320 (save-excursion 1321 (save-excursion
1321 ;; Store end and beginning of line. 1322 ;; Store end and beginning of line.
@@ -1380,6 +1381,7 @@ FOOTNOTENAME may be an abbreviation of the reference name."
1380 (error "No reference was specified")) 1381 (error "No reference was specified"))
1381 1382
1382 (let (target beg i (str (concat "\\*note " (regexp-quote footnotename))) 1383 (let (target beg i (str (concat "\\*note " (regexp-quote footnotename)))
1384 (inhibit-point-motion-hooks t)
1383 (case-fold-search t)) 1385 (case-fold-search t))
1384 (while (setq i (string-match " " str i)) 1386 (while (setq i (string-match " " str i))
1385 (setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i)))) 1387 (setq str (concat (substring str 0 i) "[ \t\n]+" (substring str (1+ i))))
@@ -1807,6 +1809,7 @@ parent node."
1807 "Move cursor to the next cross-reference or menu item in the node." 1809 "Move cursor to the next cross-reference or menu item in the node."
1808 (interactive) 1810 (interactive)
1809 (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:") 1811 (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:")
1812 (inhibit-point-motion-hooks t)
1810 (old-pt (point)) 1813 (old-pt (point))
1811 (case-fold-search t)) 1814 (case-fold-search t))
1812 (or (eobp) (forward-char 1)) 1815 (or (eobp) (forward-char 1))
@@ -1827,6 +1830,7 @@ parent node."
1827 "Move cursor to the previous cross-reference or menu item in the node." 1830 "Move cursor to the previous cross-reference or menu item in the node."
1828 (interactive) 1831 (interactive)
1829 (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:") 1832 (let ((pat "\\*note[ \n\t]*\\([^:]*\\):\\|^\\* .*:")
1833 (inhibit-point-motion-hooks t)
1830 (old-pt (point)) 1834 (old-pt (point))
1831 (case-fold-search t)) 1835 (case-fold-search t))
1832 (or (re-search-backward pat nil t) 1836 (or (re-search-backward pat nil t)
@@ -2055,7 +2059,8 @@ If no reference to follow, moves to the next node, or up if none."
2055;; Common subroutine. 2059;; Common subroutine.
2056(defun Info-try-follow-nearest-node () 2060(defun Info-try-follow-nearest-node ()
2057 "Follow a node reference near point. Return non-nil if successful." 2061 "Follow a node reference near point. Return non-nil if successful."
2058 (let (node) 2062 (let (node
2063 (inhibit-point-motion-hooks t))
2059 (cond 2064 (cond
2060 ((setq node (Info-get-token (point) "\\*note[ \n]" 2065 ((setq node (Info-get-token (point) "\\*note[ \n]"
2061 "\\*note[ \n]\\([^:]*\\):")) 2066 "\\*note[ \n]\\([^:]*\\):"))
@@ -2712,20 +2717,43 @@ the variable `Info-file-list-for-emacs'."
2712 (add-text-properties (match-beginning 2) (1+ (match-end 2)) 2717 (add-text-properties (match-beginning 2) (1+ (match-end 2))
2713 '(invisible t intangible t)))) 2718 '(invisible t intangible t))))
2714 (goto-char (point-min)) 2719 (goto-char (point-min))
2715 (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t) 2720 (while (re-search-forward "\\(\\*Note[ \n\t]+\\)\\([^:]*\\)\\(:[^.,:]*[,:]?\\)" nil t)
2716 (if (= (char-after (1- (match-beginning 0))) ?\") ; hack 2721 (unless (= (char-after (1- (match-beginning 0))) ?\") ; hack
2717 nil 2722 (let ((next (point))
2718 (add-text-properties (match-beginning 1) (match-end 1) 2723 (hide-tag font-lock-mode)
2719 '(font-lock-face info-xref 2724 other-tag)
2720 mouse-face highlight 2725 (when hide-tag
2721 help-echo "mouse-2: go to this node")))) 2726 ;; *Note is often used where *note should have been
2727 (goto-char (match-beginning 0))
2728 (skip-syntax-backward " ")
2729 (setq other-tag
2730 (cond
2731 ((or (<= (point) (point-min))
2732 (memq (char-after (1- (point))) '( ?\. ?! )))
2733 "See ")
2734 ((memq (char-after (1- (point))) '( ?\( ?\[ ?\{ ?\, ?\; ?\: ))
2735 "see ")
2736 (t nil)))
2737 (goto-char next))
2738 (if hide-tag
2739 (add-text-properties (match-beginning 1) (match-end 1)
2740 (if other-tag
2741 (list 'display other-tag 'intangible t)
2742 '(invisible t intangible t))))
2743 (add-text-properties (match-beginning 2) (match-end 2)
2744 '(font-lock-face info-xref
2745 mouse-face highlight
2746 help-echo "mouse-2: go to this node"))
2747 (add-text-properties (match-beginning 3) (match-end 3)
2748 '(invisible t intangible t)))))
2749
2722 (goto-char (point-min)) 2750 (goto-char (point-min))
2723 (if (and (search-forward "\n* Menu:" nil t) 2751 (if (and (search-forward "\n* Menu:" nil t)
2724 (not (string-match "\\<Index\\>" Info-current-node)) 2752 (not (string-match "\\<Index\\>" Info-current-node))
2725 ;; Don't take time to annotate huge menus 2753 ;; Don't take time to annotate huge menus
2726 (< (- (point-max) (point)) Info-fontify-maximum-menu-size)) 2754 (< (- (point-max) (point)) Info-fontify-maximum-menu-size))
2727 (let ((n 0)) 2755 (let ((n 0))
2728 (while (re-search-forward "^\\* +\\([^:\t\n]*\\):" nil t) 2756 (while (re-search-forward "^\\* +\\([^:\t\n]*\\)\\(:[^.,:]*[,:.][ \t]*\\)" nil t)
2729 (setq n (1+ n)) 2757 (setq n (1+ n))
2730 (if (zerop (% n 3)) ; visual aids to help with 1-9 keys 2758 (if (zerop (% n 3)) ; visual aids to help with 1-9 keys
2731 (put-text-property (match-beginning 0) 2759 (put-text-property (match-beginning 0)
@@ -2734,7 +2762,12 @@ the variable `Info-file-list-for-emacs'."
2734 (add-text-properties (match-beginning 1) (match-end 1) 2762 (add-text-properties (match-beginning 1) (match-end 1)
2735 '(font-lock-face info-xref 2763 '(font-lock-face info-xref
2736 mouse-face highlight 2764 mouse-face highlight
2737 help-echo "mouse-2: go to this node"))))) 2765 help-echo "mouse-2: go to this node"))
2766 (add-text-properties (match-beginning 2) (match-end 2)
2767 (list 'display
2768 (make-string (max 2 (- 22 (- (match-end 1) (match-beginning 1)))) ? )
2769 'intangible t)))))
2770
2738 (Info-fontify-menu-headers) 2771 (Info-fontify-menu-headers)
2739 (set-buffer-modified-p nil))))) 2772 (set-buffer-modified-p nil)))))
2740 2773