unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: 57936@debbugs.gnu.org
Subject: bug#57936: 29.0.50; Make info treat "\n" in node names as "\s"
Date: Mon, 19 Sep 2022 12:12:38 -0400	[thread overview]
Message-ID: <CADwFkmkMc1z8DGwQuv7Jdu3UOy6zD-HXC8eB=bxZcELs76ii=Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

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?

[-- Attachment #2: 0001-Make-info-treat-n-in-node-names-as-s.patch --]
[-- Type: text/x-diff, Size: 896 bytes --]

From e48e2dafe66900c5ad4fcd8e45bfce8a5b55fe3c Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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


             reply	other threads:[~2022-09-19 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 16:12 Stefan Kangas [this message]
2022-09-19 16:41 ` bug#57936: 29.0.50; Make info treat "\n" in node names as "\s" Lars Ingebrigtsen
2022-10-13 14:03   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmkMc1z8DGwQuv7Jdu3UOy6zD-HXC8eB=bxZcELs76ii=Q@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=57936@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).