unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57936: 29.0.50; Make info treat "\n" in node names as "\s"
@ 2022-09-19 16:12 Stefan Kangas
  2022-09-19 16:41 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2022-09-19 16:12 UTC (permalink / raw)
  To: 57936

[-- 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#57936: 29.0.50; Make info treat "\n" in node names as "\s"
  2022-09-19 16:12 bug#57936: 29.0.50; Make info treat "\n" in node names as "\s" Stefan Kangas
@ 2022-09-19 16:41 ` Lars Ingebrigtsen
  2022-10-13 14:03   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-19 16:41 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 57936

Stefan Kangas <stefankangas@gmail.com> writes:

> 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?

Makes sense to me, but:

> +  (setq file-or-node
> +        (replace-regexp-in-string "\n" " " file-or-node))

`string-replace', I think.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#57936: 29.0.50; Make info treat "\n" in node names as "\s"
  2022-09-19 16:41 ` Lars Ingebrigtsen
@ 2022-10-13 14:03   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2022-10-13 14:03 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 57936-done

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> 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?
>
> Makes sense to me, but:
>
>> +  (setq file-or-node
>> +        (replace-regexp-in-string "\n" " " file-or-node))
>
> `string-replace', I think.

Thanks, pushed with that change.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-13 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 16:12 bug#57936: 29.0.50; Make info treat "\n" in node names as "\s" Stefan Kangas
2022-09-19 16:41 ` Lars Ingebrigtsen
2022-10-13 14:03   ` Stefan Kangas

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).