From 40cf334f731dfdc2f96f240d644b30cfc9a9d787 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Tue, 28 Aug 2018 19:18:49 +0900 Subject: [PATCH] Add current-prefix-arg --- emacs.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs.el b/emacs.el index 9bc3461..d078ea8 100644 --- a/emacs.el +++ b/emacs.el @@ -1457,15 +1457,16 @@ Commands are searched from ALIST." (my-rgrep-grep-command name my-rgrep-alist))) (defun my-rgrep (command-args) - "My recursive grep. Run COMMAND-ARGS." + "My recursive grep. Run COMMAND-ARGS. +If prefix argument is given use current symbol as default search target." (interactive (let ((cmd (my-rgrep-grep-command my-rgrep-default nil))) (if cmd (list (read-shell-command "grep command: " (concat cmd - "\"" - (thing-at-point 'symbol t) - "\"") + (if current-prefix-arg + (thing-at-point 'symbol t) + "")) 'grep-find-history)) (error "My-Rgrep: Command for rgrep not found") )))