all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#72282: History entries shouldn't have the exact region hardwired in
@ 2024-07-24 23:22 Dan Jacobson
  2024-07-25  2:06 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-07-25 18:12 ` Juri Linkov
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Jacobson @ 2024-07-24 23:22 UTC (permalink / raw)
  To: 72282

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






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

* bug#72282: History entries shouldn't have the exact region hardwired in
  2024-07-24 23:22 bug#72282: History entries shouldn't have the exact region hardwired in Dan Jacobson
@ 2024-07-25  2:06 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-07-25 18:12 ` Juri Linkov
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-25  2:06 UTC (permalink / raw)
  To: Dan Jacobson, 72282@debbugs.gnu.org

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





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

* bug#72282: History entries shouldn't have the exact region hardwired in
  2024-07-24 23:22 bug#72282: History entries shouldn't have the exact region hardwired in Dan Jacobson
  2024-07-25  2:06 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-07-25 18:12 ` Juri Linkov
  2024-08-19  6:49   ` Juri Linkov
  1 sibling, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2024-07-25 18:12 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 72282

> (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"))





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

* bug#72282: History entries shouldn't have the exact region hardwired in
  2024-07-25 18:12 ` Juri Linkov
@ 2024-08-19  6:49   ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2024-08-19  6:49 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: 72282

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





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

end of thread, other threads:[~2024-08-19  6:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 23:22 bug#72282: History entries shouldn't have the exact region hardwired in Dan Jacobson
2024-07-25  2:06 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-25 18:12 ` Juri Linkov
2024-08-19  6:49   ` Juri Linkov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.