unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
@ 2021-04-23 20:35 Eric Skoglund
  2021-04-24  0:10 ` Filipp Gunbin
  2021-04-24  6:04 ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Skoglund @ 2021-04-23 20:35 UTC (permalink / raw)
  To: 47981

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

When using query-replace-regexp to match a newline I missed the
minibuffer information to use C-q C-j instead if '\n'. I could also not
find the information in the documentation for the function.

This patch adds that information.

// Eric Skoglund

[-- Attachment #2: 0001-Add-newline-and-tab-matching-documentation-to-query-.patch --]
[-- Type: text/plain, Size: 990 bytes --]

From 542166d749ac151d401ea8eec56dbb5bafbddf45 Mon Sep 17 00:00:00 2001
From: Eric Skoglund <eric@pagefault.se>
Date: Fri, 23 Apr 2021 22:10:07 +0200
Subject: [PATCH] Add newline and tab matching documentation to
 query-replace-regexp

* lisp/replace.el: Add \n and \t matching information to
query-replace-regexp docstring.
---
 lisp/replace.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/replace.el b/lisp/replace.el
index b5dea61924..970473f509 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -432,6 +432,9 @@ query-replace-regexp
 of the region.  Otherwise, operate from point to the end of the buffer's
 accessible portion.
 
+Matching a newline with `\n' will not work, use `C-q C-j' instead.
+Similarly to match a tab character (`\t') just press `TAB'.
+
 Use \\<minibuffer-local-map>\\[next-history-element] \
 to pull the last incremental search regexp to the minibuffer
 that reads REGEXP, or invoke replacements from
-- 
2.30.2


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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-23 20:35 bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring Eric Skoglund
@ 2021-04-24  0:10 ` Filipp Gunbin
  2021-04-24  5:25   ` Eric Skoglund
  2021-04-24  6:04 ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Filipp Gunbin @ 2021-04-24  0:10 UTC (permalink / raw)
  To: Eric Skoglund; +Cc: 47981

On 23/04/2021 20:35 +0000, Eric Skoglund wrote:

> When using query-replace-regexp to match a newline I missed the
> minibuffer information to use C-q C-j instead if '\n'. I could also not
> find the information in the documentation for the function.
>
> This patch adds that information.

You may want to instead direct the reader to (info "(emacs) Inserting
Text"), and in particular, section about "quoted-insert".

Filipp





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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-24  0:10 ` Filipp Gunbin
@ 2021-04-24  5:25   ` Eric Skoglund
  2021-04-26 14:12     ` Filipp Gunbin
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Skoglund @ 2021-04-24  5:25 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: 47981

"Filipp Gunbin" <fgunbin@fastmail.fm> writes:

> You may want to instead direct the reader to (info "(emacs) Inserting
> Text"), and in particular, section about "quoted-insert".

It feels a bit like leading users away from the specific information
they would want and towards some more general informaton. AFAIK
query-replace-regexp will only warn users in the minibuffer that "\n"
and "\t" will not work as usual (and for matching a tab character you do
not use quated-insert).

// Eric Skoglund






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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-23 20:35 bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring Eric Skoglund
  2021-04-24  0:10 ` Filipp Gunbin
@ 2021-04-24  6:04 ` Eli Zaretskii
  2021-04-24 18:00   ` Eric Skoglund
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2021-04-24  6:04 UTC (permalink / raw)
  To: Eric Skoglund; +Cc: 47981

> Date: Fri, 23 Apr 2021 20:35:00 +0000
> From: Eric Skoglund <eric@pagefault.se>
> 
> --- a/lisp/replace.el
> +++ b/lisp/replace.el
> @@ -432,6 +432,9 @@ query-replace-regexp
>  of the region.  Otherwise, operate from point to the end of the buffer's
>  accessible portion.
>  
> +Matching a newline with `\n' will not work, use `C-q C-j' instead.
> +Similarly to match a tab character (`\t') just press `TAB'.

That's only true in interactive invocations, isn't it?





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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-24  6:04 ` Eli Zaretskii
@ 2021-04-24 18:00   ` Eric Skoglund
  2021-04-25 10:46     ` Stefan Kangas
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Skoglund @ 2021-04-24 18:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 47981

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

"Eli Zaretskii" <eliz@gnu.org> writes:

>> +Matching a newline with `\n' will not work, use `C-q C-j' instead.
>> +Similarly to match a tab character (`\t') just press `TAB'.
>
> That's only true in interactive invocations, isn't it?

Yes you are right, here's an updated version that clarifies that.

// Eric Skoglund


[-- Attachment #2: 0001-Add-newline-and-tab-matching-documentation-to-query-.patch --]
[-- Type: text/plain, Size: 1022 bytes --]

From de9dccf31500ed896296ea11c7b4740c1c7a17ea Mon Sep 17 00:00:00 2001
From: Eric Skoglund <eric@pagefault.se>
Date: Fri, 23 Apr 2021 22:10:07 +0200
Subject: [PATCH] Add newline and tab matching documentation to
 query-replace-regexp

* lisp/replace.el: Add \n and \t matching information to
query-replace-regexp docstring.
---
 lisp/replace.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/replace.el b/lisp/replace.el
index b5dea61924..81c465eb7f 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -432,6 +432,10 @@ query-replace-regexp
 of the region.  Otherwise, operate from point to the end of the buffer's
 accessible portion.
 
+When invoked interactivly, Matching a newline with `\n' will not work,
+use `C-q C-j' instead.  Similarly to match a tab character (`\t')
+just press `TAB'.
+
 Use \\<minibuffer-local-map>\\[next-history-element] \
 to pull the last incremental search regexp to the minibuffer
 that reads REGEXP, or invoke replacements from
-- 
2.30.2


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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-24 18:00   ` Eric Skoglund
@ 2021-04-25 10:46     ` Stefan Kangas
  2021-04-25 11:28       ` Eric Skoglund
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2021-04-25 10:46 UTC (permalink / raw)
  To: Eric Skoglund; +Cc: 47981

Eric Skoglund <eric@pagefault.se> writes:

> From de9dccf31500ed896296ea11c7b4740c1c7a17ea Mon Sep 17 00:00:00 2001
> From: Eric Skoglund <eric@pagefault.se>
> Date: Fri, 23 Apr 2021 22:10:07 +0200
> Subject: [PATCH] Add newline and tab matching documentation to
>  query-replace-regexp
>
> * lisp/replace.el: Add \n and \t matching information to
> query-replace-regexp docstring.
> ---
>  lisp/replace.el | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lisp/replace.el b/lisp/replace.el
> index b5dea61924..81c465eb7f 100644
> --- a/lisp/replace.el
> +++ b/lisp/replace.el
> @@ -432,6 +432,10 @@ query-replace-regexp
>  of the region.  Otherwise, operate from point to the end of the buffer's
>  accessible portion.
>
> +When invoked interactivly, Matching a newline with `\n' will not work,
                ^ interactively
                              ^ matching
> +use `C-q C-j' instead.  Similarly to match a tab character (`\t')
                           ^ I would delete the word "Similarly"
> +just press `TAB'.
> +

Other than that, LGTM.





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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-25 10:46     ` Stefan Kangas
@ 2021-04-25 11:28       ` Eric Skoglund
  2021-05-02  9:13         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Skoglund @ 2021-04-25 11:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 47981

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

"Stefan Kangas" <stefan@marxist.se> writes:

>>
>> +When invoked interactivly, Matching a newline with `\n' will not work,
>                 ^ interactively
>                               ^ matching
>> +use `C-q C-j' instead.  Similarly to match a tab character (`\t')
>                            ^ I would delete the word "Similarly"

Thanks, forgot to flyspell..

// Eric Skoglund


[-- Attachment #2: 0001-Add-newline-and-tab-matching-documentation-to-query-.patch --]
[-- Type: text/plain, Size: 1009 bytes --]

From a07a1ed6407a9a7523dea26f655292751cc20273 Mon Sep 17 00:00:00 2001
From: Eric Skoglund <eric@pagefault.se>
Date: Fri, 23 Apr 2021 22:10:07 +0200
Subject: [PATCH] Add newline and tab matching documentation to
 query-replace-regexp

* lisp/replace.el: Add \n and \t matching information to
query-replace-regexp docstring.
---
 lisp/replace.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/replace.el b/lisp/replace.el
index b5dea61924..22d029321c 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -432,6 +432,9 @@ query-replace-regexp
 of the region.  Otherwise, operate from point to the end of the buffer's
 accessible portion.
 
+When invoked interactively, matching a newline with `\n' will not work,
+use `C-q C-j' instead.  To match a tab character (`\t') just press `TAB'.
+
 Use \\<minibuffer-local-map>\\[next-history-element] \
 to pull the last incremental search regexp to the minibuffer
 that reads REGEXP, or invoke replacements from
-- 
2.30.2


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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-24  5:25   ` Eric Skoglund
@ 2021-04-26 14:12     ` Filipp Gunbin
  0 siblings, 0 replies; 9+ messages in thread
From: Filipp Gunbin @ 2021-04-26 14:12 UTC (permalink / raw)
  To: Eric Skoglund; +Cc: 47981

On 24/04/2021 05:25 +0000, Eric Skoglund wrote:

> "Filipp Gunbin" <fgunbin@fastmail.fm> writes:
>
>> You may want to instead direct the reader to (info "(emacs) Inserting
>> Text"), and in particular, section about "quoted-insert".
>
> It feels a bit like leading users away from the specific information
> they would want and towards some more general informaton. AFAIK
> query-replace-regexp will only warn users in the minibuffer that "\n"
> and "\t" will not work as usual (and for matching a tab character you do
> not use quated-insert).
>
> // Eric Skoglund

This is just one of several cases where quoted-insert is needed, so I
don't see a reason why explain it here, and not explain in other places.
And if explain - it'd be better to provide more general explanation,
that is, refer to the info…

Filipp





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

* bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring.
  2021-04-25 11:28       ` Eric Skoglund
@ 2021-05-02  9:13         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-02  9:13 UTC (permalink / raw)
  To: Eric Skoglund; +Cc: Stefan Kangas, 47981

Eric Skoglund <eric@pagefault.se> writes:

> Thanks, forgot to flyspell..

Thanks; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-05-02  9:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 20:35 bug#47981: [PATCH] Add newline and tab matching information to query-replace-regexp docstring Eric Skoglund
2021-04-24  0:10 ` Filipp Gunbin
2021-04-24  5:25   ` Eric Skoglund
2021-04-26 14:12     ` Filipp Gunbin
2021-04-24  6:04 ` Eli Zaretskii
2021-04-24 18:00   ` Eric Skoglund
2021-04-25 10:46     ` Stefan Kangas
2021-04-25 11:28       ` Eric Skoglund
2021-05-02  9:13         ` Lars Ingebrigtsen

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