bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#72282: History entries shouldn't have the exact region hardwired in


From: Juri Linkov
Subject: bug#72282: History entries shouldn't have the exact region hardwired in
Date: Thu, 25 Jul 2024 21:12:44 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]