GNU bug report logs - #47981
[PATCH] Add newline and tab matching information to query-replace-regexp docstring.

Previous Next

Package: emacs;

Reported by: Eric Skoglund <eric <at> pagefault.se>

Date: Fri, 23 Apr 2021 20:36:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47981 in the body.
You can then email your comments to 47981 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Fri, 23 Apr 2021 20:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Skoglund <eric <at> pagefault.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 23 Apr 2021 20:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eric Skoglund <eric <at> pagefault.se>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Fri, 23 Apr 2021 20:35:00 +0000
[Message part 1 (text/plain, inline)]
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
[0001-Add-newline-and-tab-matching-documentation-to-query-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sat, 24 Apr 2021 00:11:01 GMT) Full text and rfc822 format available.

Message #8 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Eric Skoglund <eric <at> pagefault.se>
Cc: 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sat, 24 Apr 2021 03:10:13 +0300
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sat, 24 Apr 2021 05:26:01 GMT) Full text and rfc822 format available.

Message #11 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Eric Skoglund <eric <at> pagefault.se>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sat, 24 Apr 2021 05:25:39 +0000
"Filipp Gunbin" <fgunbin <at> 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sat, 24 Apr 2021 06:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eric Skoglund <eric <at> pagefault.se>
Cc: 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sat, 24 Apr 2021 09:04:50 +0300
> Date: Fri, 23 Apr 2021 20:35:00 +0000
> From: Eric Skoglund <eric <at> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sat, 24 Apr 2021 18:01:02 GMT) Full text and rfc822 format available.

Message #17 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Eric Skoglund <eric <at> pagefault.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sat, 24 Apr 2021 18:00:22 +0000
[Message part 1 (text/plain, inline)]
"Eli Zaretskii" <eliz <at> 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

[0001-Add-newline-and-tab-matching-documentation-to-query-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sun, 25 Apr 2021 10:47:02 GMT) Full text and rfc822 format available.

Message #20 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eric Skoglund <eric <at> pagefault.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sun, 25 Apr 2021 05:46:18 -0500
Eric Skoglund <eric <at> pagefault.se> writes:

> From de9dccf31500ed896296ea11c7b4740c1c7a17ea Mon Sep 17 00:00:00 2001
> From: Eric Skoglund <eric <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sun, 25 Apr 2021 11:29:01 GMT) Full text and rfc822 format available.

Message #23 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Eric Skoglund <eric <at> pagefault.se>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sun, 25 Apr 2021 11:28:04 +0000
[Message part 1 (text/plain, inline)]
"Stefan Kangas" <stefan <at> 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

[0001-Add-newline-and-tab-matching-documentation-to-query-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Mon, 26 Apr 2021 14:13:01 GMT) Full text and rfc822 format available.

Message #26 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Eric Skoglund <eric <at> pagefault.se>
Cc: 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Mon, 26 Apr 2021 17:12:34 +0300
On 24/04/2021 05:25 +0000, Eric Skoglund wrote:

> "Filipp Gunbin" <fgunbin <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47981; Package emacs. (Sun, 02 May 2021 09:15:01 GMT) Full text and rfc822 format available.

Message #29 received at 47981 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Skoglund <eric <at> pagefault.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>,
 47981 <at> debbugs.gnu.org
Subject: Re: bug#47981: [PATCH] Add newline and tab matching information to
 query-replace-regexp docstring.
Date: Sun, 02 May 2021 11:13:57 +0200
Eric Skoglund <eric <at> 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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 02 May 2021 09:15:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 47981 <at> debbugs.gnu.org and Eric Skoglund <eric <at> pagefault.se> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 02 May 2021 09:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 May 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.