From cbfa41154467c6a6e3016a5689bc3f165f4e0032 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 14 Sep 2020 13:49:04 +0200 Subject: [PATCH] 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. --- lisp/info.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index dc1102aab30..e4f75b481fe 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -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 -- 2.39.5