emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cbfa411: Allow hitting RET on info node names with multiple white


From: Lars Ingebrigtsen
Subject: master cbfa411: Allow hitting RET on info node names with multiple whitespace chars
Date: Mon, 14 Sep 2020 07:49:13 -0400 (EDT)

branch: master
commit cbfa41154467c6a6e3016a5689bc3f165f4e0032
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 dc1102a..e4f75b4 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]