branch: externals/do-at-point
commit 534178171e0680ef47835158922fcb1c1922cbf6
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Add command 'do-at-point-dwim'
This is obviously inspired by 'embark-dwim' and can be conveniently
bound to "M-.", since on symbols it will default to
`xref-find-definitions'.
---
do-at-point.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/do-at-point.el b/do-at-point.el
index 6e69b2a24d..3b5cde24dd 100644
--- a/do-at-point.el
+++ b/do-at-point.el
@@ -438,5 +438,16 @@ selected."
;;;###autoload (put 'do-at-point 'setup-func 'do-at-point)
+;;;###autoload
+(defun do-at-point-dwim ()
+ "Immediately execute first action for the first thing at point."
+ (interactive)
+ (unwind-protect
+ (progn
+ (do-at-point--mode 1)
+ (do-at-point-confirm t))
+ (when do-at-point--mode
+ (do-at-point--mode -1))))
+
(provide 'do-at-point)
;;; do-at-point.el ends here