mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
updated rgrep patch
This commit is contained in:
parent
94c9dcecb2
commit
60c76df428
1 changed files with 4 additions and 16 deletions
|
|
@ -154,11 +154,7 @@ When called programmatically and FILES is nil, REGEXP is expected
|
||||||
to specify a command to run.
|
to specify a command to run.
|
||||||
|
|
||||||
If CONFIRM is non-nil, the user will be given an opportunity to edit the
|
If CONFIRM is non-nil, the user will be given an opportunity to edit the
|
||||||
command before it's run.
|
command before it's run."
|
||||||
|
|
||||||
Interactively, the user can use the \\`M-c' command while entering
|
|
||||||
the regexp to indicate whether the grep should be case sensitive
|
|
||||||
or not."
|
|
||||||
(interactive
|
(interactive
|
||||||
(progn
|
(progn
|
||||||
(grep-compute-defaults)
|
(grep-compute-defaults)
|
||||||
|
|
@ -174,24 +170,16 @@ or not."
|
||||||
nil default-directory t))
|
nil default-directory t))
|
||||||
(confirm (equal current-prefix-arg '(4))))
|
(confirm (equal current-prefix-arg '(4))))
|
||||||
(list regexp files dir confirm))))))
|
(list regexp files dir confirm))))))
|
||||||
;; If called non-interactively, also compute the defaults if we
|
|
||||||
;; haven't already.
|
|
||||||
(unless grep-find-template
|
|
||||||
(grep-compute-defaults))
|
|
||||||
(when (and (stringp regexp) (> (length regexp) 0))
|
(when (and (stringp regexp) (> (length regexp) 0))
|
||||||
(unless (and dir (file-accessible-directory-p dir))
|
(unless (and dir (file-accessible-directory-p dir))
|
||||||
(setq dir default-directory))
|
(setq dir default-directory))
|
||||||
(unless (string-equal (file-remote-p dir) (file-remote-p default-directory))
|
|
||||||
(let ((default-directory dir))
|
|
||||||
(grep-compute-defaults)))
|
|
||||||
(if (null files)
|
(if (null files)
|
||||||
(if (not (string= regexp (if (consp grep-find-command)
|
(if (not (string= regexp (if (consp grep-find-command)
|
||||||
(car grep-find-command)
|
(car grep-find-command)
|
||||||
grep-find-command)))
|
grep-find-command)))
|
||||||
(compilation-start regexp #'grep-mode))
|
(compilation-start regexp 'grep-mode))
|
||||||
(setq dir (file-name-as-directory (expand-file-name dir)))
|
(setq dir (file-name-as-directory (expand-file-name dir)))
|
||||||
(let* ((case-fold-search (read-regexp-case-fold-search regexp))
|
(let ((command (rgrep-default-command regexp files nil)))
|
||||||
(command (rgrep-default-command regexp files nil)))
|
|
||||||
(when command
|
(when command
|
||||||
(if confirm
|
(if confirm
|
||||||
(setq command
|
(setq command
|
||||||
|
|
@ -201,7 +189,7 @@ or not."
|
||||||
(grep--save-buffers)
|
(grep--save-buffers)
|
||||||
(prog1
|
(prog1
|
||||||
(let ((default-directory dir))
|
(let ((default-directory dir))
|
||||||
(compilation-start command #'grep-mode))
|
(compilation-start command 'grep-mode))
|
||||||
;; Set default-directory if we started rgrep in the *grep* buffer.
|
;; Set default-directory if we started rgrep in the *grep* buffer.
|
||||||
(if (eq next-error-last-buffer (current-buffer))
|
(if (eq next-error-last-buffer (current-buffer))
|
||||||
(setq default-directory dir))))))))
|
(setq default-directory dir))))))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue