Re: [PATCH] Fix `grep' command to handle filenames starting with '-'.

2024-11-07 Thread lux
On Fri, 2024-11-08 at 10:46 +0700, Max Nikulin wrote: > > Xi Lu, is it a kind of friendly trolling that you submitted a patch with > a workaround for leading dash file name pitfall, but you decided to keep > ability to pass arbitrary shell code as selection? Just quotes is a poor > way to prote

Re: [PATCH] Fix `grep' command to handle filenames starting with '-'.

2024-11-07 Thread Max Nikulin
On 07/11/2024 16:24, Xi Lu wrote: +++ b/lisp/org-mouse.el @@ -627,7 +627,7 @@ This means, between the beginning of line and the point." ["Sparse Tree" (org-occur ',region-string)] ["Find in Buffer" (occur ',region-string)] ["Grep in Current Dir" - (grep

Re: [PATCH] Fix `grep' command to handle filenames starting with '-'.

2024-11-07 Thread lux
On Thu, 2024-11-07 at 11:40 +0100, Rens Oliemans wrote: > Xi Lu writes: > > > -     (grep (format "grep -rnH -e '%s' *" ',region-string))] > > +     (grep (format "grep -rnH -e '%s' ./*" ',region-string))] > > This works so my comment might be a bit too bikesheddy, but another method > would

Re: [PATCH] Fix `grep' command to handle filenames starting with '-'.

2024-11-07 Thread Rens Oliemans
Xi Lu writes: > - (grep (format "grep -rnH -e '%s' *" ',region-string))] > + (grep (format "grep -rnH -e '%s' ./*" ',region-string))] This works so my comment might be a bit too bikesheddy, but another method would be to append the argument `--` after the list of options to ensu

[PATCH] Fix `grep' command to handle filenames starting with '-'.

2024-11-07 Thread Xi Lu
* lisp/org-mouse.el (org-mouse-context-menu): Fix `grep' command to handle filenames starting with '-' by adjusting wildcard usage to prevent misinterpretation as options. --- lisp/org-mouse.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-mouse.el b/lisp/org-mouse.e