GNU bug report logs - #72282
History entries shouldn't have the exact region hardwired in

Previous Next

Package: emacs;

Reported by: Dan Jacobson <jidanni <at> jidanni.org>

Date: Wed, 24 Jul 2024 23:23:02 UTC

Severity: normal

To reply to this bug, email your comments to 72282 AT debbugs.gnu.org.

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#72282; Package emacs. (Wed, 24 Jul 2024 23:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 Jul 2024 23:23:02 GMT) Full text and rfc822 format available.

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

From: Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: History entries shouldn't have the exact region hardwired in
Date: Thu, 25 Jul 2024 07:22:08 +0800
(repeat-complex-command)
is great, except when used after
(shell-command-on-region)
in which case we will be repeating
(shell-command-on-region 2234 2892 ...)
instead of just
(shell-command-on-region REGION-START REGION-END ...)
in other words the previous exact region is hardwired into
the history.

Yes, you might say well then just do `M-| <up> RET`.
Well that's harder to type than `<again>`, `<redo>`, `C-x M-:` or `C-x M-ESC`,
which are the bindings of repeat-complex-command.

So maybe for all history items, they shouldn't have the exact region hardwired in.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72282; Package emacs. (Thu, 25 Jul 2024 02:07:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Dan Jacobson <jidanni <at> jidanni.org>, "72282 <at> debbugs.gnu.org"
 <72282 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#72282: History entries shouldn't have the exact
 region hardwired in
Date: Thu, 25 Jul 2024 02:06:08 +0000
> (repeat-complex-command)
> is great, except when used after
> (shell-command-on-region)
> in which case we will be repeating
> (shell-command-on-region 2234 2892 ...)
> instead of just
> (shell-command-on-region REGION-START REGION-END ...)
> in other words the previous exact region is hardwired into
> the history.
> 
> Yes, you might say well then just do `M-| <up> RET`.
> Well that's harder to type than `<again>`, `<redo>`, `C-x M-:` or `C-x
> M-ESC`,
> which are the bindings of repeat-complex-command.
> 
> So maybe for all history items, they shouldn't have the exact region
> hardwired in.

I brought this up when the change was made to do
what's done now.  Originally Emacs put nil nil
in place of the specific region limits.

I don't recall whether a bug was filed for that
change or it was discussed in emacs-devel before
the change was made.  In any case, the decision
was to go with the "enhancement" that we have
now: the specific region limits.

IOW, FWIW, I agree with you.  I find myself
hand-replacing the numeric limits with nil's
fairly often.

I don't recall the reasons given for the change
to use the explicit numbers - if any reasons
were given.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72282; Package emacs. (Thu, 25 Jul 2024 18:23:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Dan Jacobson <jidanni <at> jidanni.org>
Cc: 72282 <at> debbugs.gnu.org
Subject: Re: bug#72282: History entries shouldn't have the exact region
 hardwired in
Date: Thu, 25 Jul 2024 21:12:44 +0300
> (repeat-complex-command)
> is great, except when used after
> (shell-command-on-region)
> in which case we will be repeating
> (shell-command-on-region 2234 2892 ...)
> instead of just
> (shell-command-on-region REGION-START REGION-END ...)
> in other words the previous exact region is hardwired into
> the history.
>
> Yes, you might say well then just do `M-| <up> RET`.
> Well that's harder to type than `<again>`, `<redo>`, `C-x M-:` or `C-x M-ESC`,
> which are the bindings of repeat-complex-command.
>
> So maybe for all history items, they shouldn't have the exact region hardwired in.

Currently this can be achieved with a 'declare' form,
but I don't know why this is not enabled consistently
for region arguments of more commands:

diff --git a/lisp/simple.el b/lisp/simple.el
index a9f8b5845d8..b3a72c2635a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4944,6 +4944,9 @@ shell-command-on-region
 The differences are especially prominent when the region includes
 more than one line, i.e. when piping to a shell commands with embedded
 newlines."
+  (declare (interactive-args
+	    (start (use-region-beginning))
+	    (end (use-region-end))))
   (interactive (let (string)
 		 (unless (mark)
 		   (user-error "The mark is not set now, so there is no region"))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72282; Package emacs. (Mon, 19 Aug 2024 06:59:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Dan Jacobson <jidanni <at> jidanni.org>
Cc: 72282 <at> debbugs.gnu.org
Subject: Re: bug#72282: History entries shouldn't have the exact region
 hardwired in
Date: Mon, 19 Aug 2024 09:49:13 +0300
>> So maybe for all history items, they shouldn't have the exact region hardwired in.
>
> Currently this can be achieved with a 'declare' form,
> but I don't know why this is not enabled consistently
> for region arguments of more commands:
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> @@ -4944,6 +4944,9 @@ shell-command-on-region
>  The differences are especially prominent when the region includes
>  more than one line, i.e. when piping to a shell commands with embedded
>  newlines."
> +  (declare (interactive-args
> +	    (start (use-region-beginning))
> +	    (end (use-region-end))))
>    (interactive (let (string)
>  		 (unless (mark)
>  		   (user-error "The mark is not set now, so there is no region"))

Unfortunately, with this patch the bootstrap fails with:

  Loading lisp/simple.el (source)...
  Error: error ("Eager macro-expansion failure: (void-function seq-position)")
  Eager macro-expansion failure: (void-function seq-position)

because seq.el is loaded after simple.el.




This bug report was last modified 300 days ago.

Previous Next


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