diff options
| author | 2026-05-05 11:42:54 -0700 | |
|---|---|---|
| committer | 2026-05-05 11:42:54 -0700 | |
| commit | 44db437bae9e1f4f6a221755305aca85c1a5316c (patch) | |
| tree | 39c070fce59212312764809e97c0d49a7fee5692 | |
| parent | 2d8e3c917d24894071f81913052d49eba858107a (diff) | |
| download | emacs-config-44db437bae9e1f4f6a221755305aca85c1a5316c.tar.gz emacs-config-44db437bae9e1f4f6a221755305aca85c1a5316c.zip | |
oni-php: oni-php-grep-symbol: If region is active, grep that instead
| -rw-r--r-- | oni-php/oni-php.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 1415d2b..e895c3b 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -313,7 +313,14 @@ Otherwise call FUNC with ARGS. This is meant as advice around (looking-back "::\\w+" (- (point) (line-beginning-position)))) (defun oni-php-grep-symbol (symbol) - (interactive (list (thing-at-point 'symbol))) + "Use ‘rgrep’ to find SYMBOL. +If there is an active region when this command is called interactively +SYMBOL will be the text in the region. Otherwise it's the symbol at +point." + (interactive (list + (if (region-active-p) + (buffer-substring-no-properties (region-beginning) (region-end)) + (thing-at-point 'symbol)))) (rgrep (rx (literal symbol)) (map-elt grep-files-aliases "php") (project-root (project-current)))) |
