emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xi Lu <lx@shellcodes.org>
To: emacs-orgmode@gnu.org
Cc: Xi Lu <lx@shellcodes.org>
Subject: [PATCH] Fix `grep' command to handle filenames starting with '-'.
Date: Thu,  7 Nov 2024 17:24:33 +0800	[thread overview]
Message-ID: <tencent_6F6A1EEF62E567C2C782CD384966126A0009@qq.com> (raw)

* 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.el
index 322d98682..7f85653f2 100644
--- a/lisp/org-mouse.el
+++ 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 (format "grep -rnH -e '%s' *" ',region-string))]
+	    (grep (format "grep -rnH -e '%s' ./*" ',region-string))]
 	   ["Grep in Parent Dir"
 	    (grep (format "grep -rnH -e '%s' ../*" ',region-string))]
 	   "--"
-- 
2.45.2




             reply	other threads:[~2024-11-07  9:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07  9:24 Xi Lu [this message]
2024-11-07 10:40 ` [PATCH] Fix `grep' command to handle filenames starting with '-' Rens Oliemans
2024-11-07 10:44   ` lux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_6F6A1EEF62E567C2C782CD384966126A0009@qq.com \
    --to=lx@shellcodes.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).