diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-14 13:49:04 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-09-14 13:49:04 +0200 |
commit | cbfa41154467c6a6e3016a5689bc3f165f4e0032 (patch) | |
tree | 5262655973a01ce05cd698fd5b5432dbbd8c2102 | |
parent | 7629aa74091d43370da751d86b0584ba3516ea75 (diff) | |
download | emacs-cbfa41154467c6a6e3016a5689bc3f165f4e0032.tar.gz |
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.
-rw-r--r-- | lisp/info.el | 7 |
1 files 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 |