diff options
author | Yuchen Pei <id@ypei.org> | 2023-08-01 09:37:33 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-08-01 09:37:33 +1000 |
commit | 66aac92722ec86788367749aa25214a0baaa89a6 (patch) | |
tree | bb8b926e7a25a5566cc87fa6084399d1f4fd61e9 /emacs/.emacs.d/lisp/my | |
parent | bd7c33b39527f3cea1c7f5270fc60a979357a318 (diff) |
minor consult grep changes
Diffstat (limited to 'emacs/.emacs.d/lisp/my')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-consult.el | 18 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-wikipedia.el | 1 |
2 files changed, 13 insertions, 6 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-consult.el b/emacs/.emacs.d/lisp/my/my-consult.el index 706dae5..aa71ac6 100644 --- a/emacs/.emacs.d/lisp/my/my-consult.el +++ b/emacs/.emacs.d/lisp/my/my-consult.el @@ -27,14 +27,22 @@ ;;; Code: (defun my-consult-grep-default () - "Like `consult-grep', but grepping the default directory." + "Call `consult-git-grep' or `consult-grep' on default directory. + +...depending whether we are in the git repo." (interactive) - (consult-grep default-directory nil)) + (if (vc-git-root (buffer-file-name)) + (consult-git-grep default-directory nil) + (consult-grep default-directory nil))) + +(defun my-consult-grep () + "Call `consult-git-grep' or `consult-grep'. -(defun my-consult-git-grep-default () - "Like `consult-grep', but grepping the default directory." +...depending whether we are in the git repo." (interactive) - (consult-git-grep default-directory nil)) + (if (vc-git-root (buffer-file-name)) + (consult-git-grep) + (consult-grep))) (provide 'my-consult) ;;; my-consult.el ends here diff --git a/emacs/.emacs.d/lisp/my/my-wikipedia.el b/emacs/.emacs.d/lisp/my/my-wikipedia.el index af954bf..45d00e2 100644 --- a/emacs/.emacs.d/lisp/my/my-wikipedia.el +++ b/emacs/.emacs.d/lisp/my/my-wikipedia.el @@ -30,7 +30,6 @@ (require 'my-utils) (require 'my-markup) (require 'my-net) -(require 'my-mediawiki) (require 'wiki) ;; TODO: much of these can be generalised to any mediawiki site |