[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/do-at-point 4ca1472e45 05/44: Simplify thing selection
From: |
ELPA Syncer |
Subject: |
[elpa] externals/do-at-point 4ca1472e45 05/44: Simplify thing selection logic |
Date: |
Fri, 25 Aug 2023 18:57:46 -0400 (EDT) |
branch: externals/do-at-point
commit 4ca1472e4595fc939e5fc1141b77a5da6908a1f3
Author: Philip Kaludercic <philip.kaludercic@fau.de>
Commit: Philip Kaludercic <philip.kaludercic@fau.de>
Simplify thing selection logic
---
do-at-point.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/do-at-point.el b/do-at-point.el
index a565d405a4..47117d6ef8 100644
--- a/do-at-point.el
+++ b/do-at-point.el
@@ -5,7 +5,7 @@
;; Author: Philip Kaludercic <philipk@posteo.net>
;; Maintainer: Philip Kaludercic <philipk@posteo.net>
;; URL: https://wwwcip.cs.fau.de/~oj14ozun/src+etc/do-at-point.el
-;; Version: $Id: do-at-point.el,v 1.3 2023/07/16 11:34:38 oj14ozun Exp
oj14ozun $
+;; Version: $Id: do-at-point.el,v 1.4 2023/07/16 11:35:03 oj14ozun Exp
oj14ozun $
;; Package-Version: 1
;; Package-Requires: ((emacs "26.1"))
;; Keywords: convenience
@@ -132,21 +132,20 @@ user for possible things at point."
"Dispatch an action on the thing at point."
(interactive)
(unwind-protect
- (let* ((things (mapcar #'car do-at-point-actions))
- (cand (seq-filter #'thing-at-point things))
- (last last-input-event) (key last) (i 0) thing)
- (when (null cand)
+ (let ((things (seq-filter #'thing-at-point (mapcar #'car
do-at-point-actions)))
+ (last last-input-event) (key last-input-event) thing)
+ (when (null things)
(user-error "Nothing actionable at point"))
+ (setf (cdr (last things)) things)
(while (eq key last)
- (setq thing (nth (mod i (length cand)) cand))
+ (setq thing (pop things))
(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 (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))
+ (format "Act on `%s'?" thing))))
(when (eq key ?\C-g) (keyboard-quit))))
(let* ((options (append
(and (not (eq thing 'region))
- [elpa] branch externals/do-at-point created (now 0fac1ce7fa), ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point 4ca1472e45 05/44: Simplify thing selection logic,
ELPA Syncer <=
- [elpa] externals/do-at-point 1bf742ffaf 11/44: Pass proper input to 'read-multiple-choice', ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point ffd013c6d2 15/44: Add user option to disable quick bindings, ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point 26eba56f63 01/44: Initial revision, ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point 7073fc1917 07/44: Invert event loop to allow movement during selection, ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point a6b52ebf53 08/44: Fix name-typo in "Embark" section, ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point b25f8ff64e 12/44: Rebind browse-url from "f" to "b" for URLs, ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point bfe1d53b31 19/44: Unbind RET from 'do-at-point--mode-map', ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point 9d2ead6890 21/44: Fix 'do-at-point-actions-type' to work with inherited actions, ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point 0117be3619 23/44: Fix (require ...) for 'calc-embedded-word', ELPA Syncer, 2023/08/25
- [elpa] externals/do-at-point b2808685d4 24/44: Simplify 'calc-embedded' invocation, ELPA Syncer, 2023/08/25