Subject: 29.0.50; Make info treat "\n" in node names as "\s"

From: Stefan Kangas <[email-masked]>
Date: Mon, 19 Sep 2022 12:12:38 -0400

Severity: wishlist
Tags: patch

I often find myself writing an email, and I paste something like:

(info "(elisp) Interactive Examples")

But it sometimes ends up wrapped over two lines and I need to manually
adjust it back from something like:

(info "(elisp) Interactive
Examples")

And then I have to fiddle around with the formatting, which is just a
bit boring.

So I think it would be nice if `info' would just treat the node name
"(elisp) Interactive\nExamples" as "(elisp) Interactive Examples".  See
the attached patch.

Thoughts?
From e48e2dafe66900c5ad4fcd8e45bfce8a5b55fe3c Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Mon, 19 Sep 2022 18:08:47 +0200
Subject: [PATCH] Make info treat "\n" in node names as "\s"

---
 lisp/info.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/info.el b/lisp/info.el
index 292bf93a6f..864f812fd6 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -763,6 +763,10 @@ info
                     (read-file-name "Info file name: " nil nil t))
                 (if (numberp current-prefix-arg)
                     (format "*info*<%s>" current-prefix-arg))))
+  ;; Info nodes don't contain newlines, so allow for easier use of
+  ;; wrapped info node names in emails, etc.
+  (setq file-or-node
+        (replace-regexp-in-string "\n" " " file-or-node))
   (info-setup file-or-node
 	      (pop-to-buffer-same-window (or buffer "*info*"))))
 
-- 
2.30.2