* bug#36113: 27.0.50; grep-find cursor position
@ 2019-06-06 10:26 Andreas Röhler
2019-06-06 20:32 ` Juri Linkov
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Röhler @ 2019-06-06 10:26 UTC (permalink / raw)
To: 36113
[-- Attachment #1: Type: text/plain, Size: 355 bytes --]
Hi,
when running M-x grep-find the cursor is in minibuffer at EOL. In
order to insert the expression, cursor is needed before braces - see png.
The patch attached shows an example how to provide this. There might
be more cases to consider.
Thanks,
Andreas
GNU Emacs 27.0.50 (build 1, i686-pc-linux-gnu, X toolkit, Xaw3d scroll
bars) of 2019-06-04
[-- Attachment #2: grep-find-cursor.png --]
[-- Type: image/png, Size: 58564 bytes --]
[-- Attachment #3: grep-find.patch --]
[-- Type: text/x-patch, Size: 536 bytes --]
diff --git a/lisp/simple.el b/lisp/simple.el
index 6bc3bc5304..4bd29faabe 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3330,7 +3330,8 @@ read-shell-command
(lambda ()
(shell-completion-vars)
(set (make-local-variable 'minibuffer-default-add-function)
- 'minibuffer-default-add-shell-commands))
+ 'minibuffer-default-add-shell-commands)
+ (when (eq (char-before) ?+) (backward-char 5)))
(apply 'read-from-minibuffer prompt initial-contents
minibuffer-local-shell-command-map
nil
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#36113: 27.0.50; grep-find cursor position
2019-06-06 10:26 bug#36113: 27.0.50; grep-find cursor position Andreas Röhler
@ 2019-06-06 20:32 ` Juri Linkov
2019-06-07 5:37 ` Andreas Röhler
0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2019-06-06 20:32 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 36113
> when running M-x grep-find the cursor is in minibuffer at EOL. In
> order to insert the expression, cursor is needed before braces - see png.
Very strange but when I run M-x grep-find the cursor is before braces already.
Maybe some your customization prevents the cursor to be placed before braces?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#36113: 27.0.50; grep-find cursor position
2019-06-06 20:32 ` Juri Linkov
@ 2019-06-07 5:37 ` Andreas Röhler
2019-06-21 10:18 ` Noam Postavsky
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Röhler @ 2019-06-07 5:37 UTC (permalink / raw)
To: Juri Linkov; +Cc: 36113
On 06.06.19 22:32, Juri Linkov wrote:
>> when running M-x grep-find the cursor is in minibuffer at EOL. In
>> order to insert the expression, cursor is needed before braces - see png.
> Very strange but when I run M-x grep-find the cursor is before braces already.
> Maybe some your customization prevents the cursor to be placed before braces?
Indeed it doesn't happen from Emacs -Q, but with that customization:
'(grep-find-command
"find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH
-e {} +")
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#36113: 27.0.50; grep-find cursor position
2019-06-07 5:37 ` Andreas Röhler
@ 2019-06-21 10:18 ` Noam Postavsky
2019-06-21 10:33 ` Andreas Schwab
2020-08-22 14:27 ` Lars Ingebrigtsen
0 siblings, 2 replies; 7+ messages in thread
From: Noam Postavsky @ 2019-06-21 10:18 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 36113, Juri Linkov
severity 36113 minor
quit
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> Indeed it doesn't happen from Emacs -Q, but with that customization:
>
> '(grep-find-command
> "find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH
> -e {} +")
So I guess we just need to document that you should instead use
'(grep-find-command
("find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH -e {} +" . 67))
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#36113: 27.0.50; grep-find cursor position
2019-06-21 10:18 ` Noam Postavsky
@ 2019-06-21 10:33 ` Andreas Schwab
2019-06-21 11:20 ` Noam Postavsky
2020-08-22 14:27 ` Lars Ingebrigtsen
1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2019-06-21 10:33 UTC (permalink / raw)
To: Noam Postavsky; +Cc: 36113, Juri Linkov
On Jun 21 2019, Noam Postavsky <npostavs@gmail.com> wrote:
> So I guess we just need to document that you should instead use
>
> '(grep-find-command
> ("find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH -e {} +" . 67))
That value doesn't match the customize type.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#36113: 27.0.50; grep-find cursor position
2019-06-21 10:33 ` Andreas Schwab
@ 2019-06-21 11:20 ` Noam Postavsky
0 siblings, 0 replies; 7+ messages in thread
From: Noam Postavsky @ 2019-06-21 11:20 UTC (permalink / raw)
To: Andreas Schwab; +Cc: 36113, Juri Linkov
>> '(grep-find-command
>> ("find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH -e {} +" . 67))
>
> That value doesn't match the customize type.
Right, fix the customize type and docstring then. Meanwhile,
(with-eval-after-load 'grep
(grep-apply-setting
'grep-find-command
'("find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH -e {} +" . 67)))
works anyway.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#36113: 27.0.50; grep-find cursor position
2019-06-21 10:18 ` Noam Postavsky
2019-06-21 10:33 ` Andreas Schwab
@ 2020-08-22 14:27 ` Lars Ingebrigtsen
1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-22 14:27 UTC (permalink / raw)
To: Noam Postavsky; +Cc: 36113, Juri Linkov
Noam Postavsky <npostavs@gmail.com> writes:
> So I guess we just need to document that you should instead use
>
> '(grep-find-command
> ("find . -maxdepth 1 -type f -name \"*.[a-z][a-z]\" -exec grep -nH
> -e {} +" . 67))
I've now done this in Emacs 28 (and amended the defcustom type).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-08-22 14:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-06 10:26 bug#36113: 27.0.50; grep-find cursor position Andreas Röhler
2019-06-06 20:32 ` Juri Linkov
2019-06-07 5:37 ` Andreas Röhler
2019-06-21 10:18 ` Noam Postavsky
2019-06-21 10:33 ` Andreas Schwab
2019-06-21 11:20 ` Noam Postavsky
2020-08-22 14:27 ` Lars Ingebrigtsen
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.