]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `info' treat "\n" in node names as "\s"
authorStefan Kangas <stefankangas@gmail.com>
Thu, 13 Oct 2022 13:46:56 +0000 (15:46 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Thu, 13 Oct 2022 13:51:58 +0000 (15:51 +0200)
* lisp/info.el (info): Treat "\n" in node name as "\s".  (Bug#57936)

lisp/info.el

index 292bf93a6f40bd1413865e31f2ac79fc42d61c25..fabba2734a3ee49285a1f7b636a8f8607b3c3428 100644 (file)
@@ -763,6 +763,11 @@ See a list of available Info commands in `Info-mode'."
                     (read-file-name "Info file name: " nil nil t))
                 (if (numberp current-prefix-arg)
                     (format "*info*<%s>" current-prefix-arg))))
+  (when file-or-node
+    ;; Info node names don't contain newlines, so allow for easier use
+    ;; of names that might have been wrapped (in emails, etc.).
+    (setq file-or-node
+          (string-replace "\n" " " file-or-node)))
   (info-setup file-or-node
              (pop-to-buffer-same-window (or buffer "*info*"))))