emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/do-at-point 917f8de4d1 13/44: Handle things without bou


From: ELPA Syncer
Subject: [elpa] externals/do-at-point 917f8de4d1 13/44: Handle things without bounds gracefully
Date: Fri, 25 Aug 2023 18:57:46 -0400 (EDT)

branch: externals/do-at-point
commit 917f8de4d1a6fe7b12e1f9a6e96d9a504a5be8af
Author: Philip Kaludercic <philip.kaludercic@fau.de>
Commit: Philip Kaludercic <philip.kaludercic@fau.de>

    Handle things without bounds gracefully
---
 do-at-point.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/do-at-point.el b/do-at-point.el
index af6fdbebb3..1ea483313e 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.11 2023/07/18 07:18:43 oj14ozun Exp 
oj14ozun $
+;; Version: $Id: do-at-point.el,v 1.12 2023/07/18 07:23:11 oj14ozun Exp 
oj14ozun $
 ;; Package-Version: 1
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: convenience
@@ -181,8 +181,9 @@ invoke `do-at-point' is bound transiently."
   (let ((thing (or (overlay-get do-at-point--overlay 'do-at-point-thing)
                   (do-at-point--next-thing t))))
     (let ((bound (bounds-of-thing-at-point thing)))
-      (when bound
-       (move-overlay do-at-point--overlay (car bound) (cdr bound))))
+      (if bound
+         (move-overlay do-at-point--overlay (car bound) (cdr bound))
+       (delete-overlay do-at-point--overlay)))
     (set-transient-map
      (let ((map (make-sparse-keymap)))
        (define-key map (vector (overlay-get do-at-point--overlay 
'do-at-point-key))
@@ -194,6 +195,9 @@ invoke `do-at-point' is bound transiently."
 If the optional argument QUICK is non-nil, the first applicable
 action is selected."
   (interactive)
+  (unless (and (overlay-start do-at-point--overlay)
+              (overlay-end do-at-point--overlay))
+    (user-error "No selected thing"))
   (let* ((thing (overlay-get do-at-point--overlay 'do-at-point-thing))
         (options (do-at-point--actions thing))
         (choice (cond



reply via email to

[Prev in Thread] Current Thread [Next in Thread]