summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/km-webjump.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/km-webjump.el b/lisp/km-webjump.el
index 09fc5d9..f3c2cb7 100644
--- a/lisp/km-webjump.el
+++ b/lisp/km-webjump.el
@@ -28,7 +28,15 @@
(let* ((default (if (use-region-p)
(buffer-substring-no-properties
(region-beginning) (region-end))
- (thing-at-point 'symbol)))
+ (or (save-excursion
+ (skip-syntax-backward "^ ")
+ (and (looking-at
+ (rx "<"
+ (group
+ (one-or-more (not (any space ">"))))
+ ">"))
+ (match-string 1)))
+ (thing-at-point 'symbol))))
(prompt (if default
(format "%s (%s): " prompt default)
(concat prompt ": ")))