1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Allow hitting RET on info node names with multiple whitespace chars

* lisp/info.el (info--node-canonicalize-whitespace): New function
(bug#10784).
(Info-extract-menu-node-name): Use it.
(Info-find-node): Use it.
This commit is contained in:
Lars Ingebrigtsen 2020-09-14 13:49:04 +02:00
parent 7629aa7409
commit cbfa411544

View File

@ -956,6 +956,7 @@ This function first looks for a case-sensitive match for NODENAME;
if none is found it then tries a case-insensitive match (unless
STRICT-CASE is non-nil)."
(info-initialize)
(setq nodename (info--node-canonicalize-whitespace nodename))
(setq filename (Info-find-file filename))
;; Go into Info buffer.
(or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
@ -2684,14 +2685,16 @@ Because of ambiguities, this should be concatenated with something like
;;; (setq Info-point-loc
;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1))))
)
(replace-regexp-in-string
"[ \n]+" " "
(info--node-canonicalize-whitespace
(or (and (not (equal (match-string-no-properties 2) ""))
(match-string-no-properties 2))
;; If the node name is the menu entry name (using `entry::').
(buffer-substring-no-properties
(match-beginning 0) (1- (match-beginning 1)))))))
(defun info--node-canonicalize-whitespace (string)
(replace-regexp-in-string "[ \t\n]+" " " string))
;; No one calls this.
;;(defun Info-menu-item-sequence (list)
;; (while list