branch: externals/do-at-point
commit 8f79a21ed7d4d069d9ae19082924b094222e513f
Author: Philip Kaludercic <philip.kaluder...@fau.de>
Commit: Philip Kaludercic <philip.kaluder...@fau.de>

    Indicate default action when prompting thing
---
 do-at-point.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/do-at-point.el b/do-at-point.el
index 5ffdd32b46..892b77e9d1 100644
--- a/do-at-point.el
+++ b/do-at-point.el
@@ -5,7 +5,7 @@
 ;; Author: Philip Kaludercic <phil...@posteo.net>
 ;; Maintainer: Philip Kaludercic <phil...@posteo.net>
 ;; URL: https://wwwcip.cs.fau.de/~oj14ozun/src+etc/do-at-point.el
-;; Version: $Id$
+;; Version: $Id: do-at-point.el,v 1.1 2023/07/16 09:56:22 oj14ozun Exp 
oj14ozun $
 ;; Package-Version: 1
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: convenience
@@ -138,9 +138,14 @@ user for possible things at point."
          (user-error "Nothing actionable at point"))
        (while (eq key last)
          (setq thing (nth (mod i (length cand)) cand))
-         (let ((bound (bounds-of-thing-at-point thing)))
+         (let ((bound (bounds-of-thing-at-point thing))
+               (default (cadar (or (alist-get thing do-at-point-actions)
+                                   (alist-get 'region do-at-point-actions)))))
            (move-overlay do-at-point--overlay (car bound) (cdr bound))
-           (setq key (read-key (format "Act on %s?" thing)) i (1+ i))
+           (setq key (read-key (if (and do-at-point-quick-select default)
+                                   (format "Act on `%s' (%s by default)?" 
thing default)
+                                 (format "Act on `%s'?" thing)))
+                 i (1+ i))
            (when (eq key ?\C-g) (keyboard-quit))))
        (let* ((options (append
                         (and (not (eq thing 'region))

Reply via email to