]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow hitting RET on info node names with multiple whitespace chars
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 14 Sep 2020 11:49:04 +0000 (13:49 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 14 Sep 2020 11:49:04 +0000 (13:49 +0200)
* 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

index dc1102aab3018eeffc2bd364164fb9b100a761cc..e4f75b481fe83fd6d8a8fd7740924e74f9988331 100644 (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