diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-07-12 22:27:19 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-07-12 22:30:42 +0200 |
commit | 0367e4f2549abf2778794cb9e78786df22c8dab9 (patch) | |
tree | bcce71d357f11c4138da581badb06122b2734916 /lisp/init-grep.el | |
parent | 8454d26dd393e88ec8110f2bf78b7c3744cb60c8 (diff) |
grep: Remove unnecessary buffer-file-name
Diffstat (limited to 'lisp/init-grep.el')
-rw-r--r-- | lisp/init-grep.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/init-grep.el b/lisp/init-grep.el index 472b042..1f06725 100644 --- a/lisp/init-grep.el +++ b/lisp/init-grep.el @@ -14,9 +14,7 @@ This is only used when running grep in a Git repository.") This tries to use either rg or git grep if available, and otherwise falls back to regular grep." (interactive) - (let* ((git-root-dir (locate-dominating-file (or buffer-file-name - default-directory) - ".git")) + (let* ((git-root-dir (locate-dominating-file default-directory ".git")) (dir (or git-root-dir default-directory)) (use-rg (executable-find "rg")) (use-git (and git-root-dir (executable-find "git"))) @@ -43,7 +41,7 @@ If NOSELECT is non-nil, do not select the window." (use-package grep :commands (grep-read-regexp grep-apply-setting) - :bind (;; C-c g runs git grep in current vc tree + :bind (;; C-c g runs interactive grep ("C-c g" . mpolden/grep) :map grep-mode-map ;; make C-o and o behave as in dired |