mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-21 12:27:33 +00:00
(Info-extract-menu-node-name): When looking for end of
menu item, don't stop at first ":"; instead, continue until trailing context is either a space or newline. (Info-complete-menu-item): Change var `pattern' to allow ":" in menu item. (Info-menu): Likewise, for regexp used in backwards search. (Info-try-follow-nearest-node): Remove case added in previous edit. Instead, change the regexp in the following case to allow ":" in menu item. (Info-fontify-node): Fix bug: Handle `next-property-change' returning point-max as "hasn't already been done".
This commit is contained in:
parent
921e5fe690
commit
505b68d57d
2 changed files with 26 additions and 16 deletions
|
|
@ -1,3 +1,17 @@
|
|||
2003-01-24 Thien-Thi Nguyen <ttn@gnu.org>
|
||||
|
||||
* info.el (Info-extract-menu-node-name): When looking for end of menu
|
||||
item, don't stop at first ":"; instead, continue until trailing
|
||||
context is either a space or newline.
|
||||
(Info-complete-menu-item): Change var `pattern' to allow ":" in menu
|
||||
item.
|
||||
(Info-menu): Likewise, for regexp used in backwards search.
|
||||
(Info-try-follow-nearest-node): Remove case added in previous edit.
|
||||
Instead, change the regexp in the following case to allow ":" in menu
|
||||
item.
|
||||
(Info-fontify-node): Fix bug: Handle `next-property-change' returning
|
||||
point-max as "hasn't already been done".
|
||||
|
||||
2003-01-24 Thien-Thi Nguyen <ttn@gnu.org>
|
||||
|
||||
* info.el (Info-try-follow-nearest-node): Add case: Handle menu item
|
||||
|
|
|
|||
28
lisp/info.el
28
lisp/info.el
|
|
@ -31,6 +31,8 @@
|
|||
;; - a menu item MAY contain colons but not colon-space ": "
|
||||
;; - a menu item ending with ": " (but not ":: ") is an index entry
|
||||
;; - a node name MAY NOT contain a colon
|
||||
;; This distinction is to support indexing of computer programming
|
||||
;; language terms that may contain ":" but not ": ".
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
|
@ -1482,8 +1484,9 @@ FOOTNOTENAME may be an abbreviation of the reference name."
|
|||
(skip-chars-forward " \t\n")
|
||||
(let ((beg (point))
|
||||
str i)
|
||||
(skip-chars-forward "^:")
|
||||
(forward-char 1)
|
||||
(while (not (looking-at ":*[ \n]"))
|
||||
(skip-chars-forward "^:")
|
||||
(forward-char 1))
|
||||
(setq str
|
||||
(if (looking-at ":")
|
||||
(buffer-substring-no-properties beg (1- (point)))
|
||||
|
|
@ -1522,7 +1525,7 @@ FOOTNOTENAME may be an abbreviation of the reference name."
|
|||
(concat "\n\\* +" (regexp-quote string) ":") nil t)
|
||||
(let ((pattern (concat "\n\\* +\\("
|
||||
(regexp-quote string)
|
||||
"[^:\t\n]*\\):"))
|
||||
"[^\t\n]*\\):"))
|
||||
completions)
|
||||
;; Check the cache.
|
||||
(if (and (equal (nth 0 Info-complete-cache) Info-current-file)
|
||||
|
|
@ -1580,7 +1583,7 @@ new buffer."
|
|||
(save-excursion
|
||||
(goto-char p)
|
||||
(end-of-line)
|
||||
(if (re-search-backward "\n\\* +\\([^:\t\n]*\\):" beg t)
|
||||
(if (re-search-backward "\n\\* +\\([^\t\n]*\\):" beg t)
|
||||
(setq default (match-string-no-properties 1))))))
|
||||
(let ((item nil))
|
||||
(while (null item)
|
||||
|
|
@ -2123,19 +2126,11 @@ If no reference to follow, moves to the next node, or up if none."
|
|||
((setq node (Info-get-token (point) "\\*note[ \n]"
|
||||
"\\*note[ \n]\\([^:]*\\):"))
|
||||
(Info-follow-reference node))
|
||||
;; explicit node name
|
||||
;; menu item: node name
|
||||
((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::"))
|
||||
(Info-goto-node node))
|
||||
;; index entry (Another approach is to combine this w/ the following cond
|
||||
;; branch "other menu item", but that also requires fixing
|
||||
;; Info-extract-menu-node-name -- stay tuned. --ttn)
|
||||
((Info-get-token (point) "\\* +" "\\* +\\(.*\\):[ \t]")
|
||||
(save-excursion
|
||||
(re-search-forward ":[ \t]")
|
||||
(setq node (Info-following-node-name "^.")))
|
||||
(Info-goto-node node))
|
||||
;; other menu item
|
||||
((Info-get-token (point) "\\* +" "\\* +\\([^:]*\\):")
|
||||
;; menu item: index entry
|
||||
((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ")
|
||||
(beginning-of-line)
|
||||
(forward-char 2)
|
||||
(setq node (Info-extract-menu-node-name))
|
||||
|
|
@ -2705,7 +2700,8 @@ the variable `Info-file-list-for-emacs'."
|
|||
|
||||
(defun Info-fontify-node ()
|
||||
;; Only fontify the node if it hasn't already been done.
|
||||
(unless (next-property-change (point-min))
|
||||
(unless (let ((where (next-property-change (point-min))))
|
||||
(and where (not (= where (point-max)))))
|
||||
(save-excursion
|
||||
(let ((inhibit-read-only t)
|
||||
(case-fold-search t)
|
||||
|
|
|
|||
Loading…
Reference in a new issue