aboutsummaryrefslogtreecommitdiffstats
path: root/oni-php
diff options
context:
space:
mode:
Diffstat (limited to 'oni-php')
-rw-r--r--oni-php/oni-php.el9
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))))