branch: externals/transient
commit e508e65866168c178136e260a86790cd12343024
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    transient--goto-button: No longer error if no button is found
    
    This could happen, for example, if a menu only has a single suffix and
    invoking that suffix causes it to be removed from the menu.  That is a
    rather contrived use-case, but see #397.
---
 lisp/transient.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 4117c569a6..3e72990b6c 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -5123,7 +5123,9 @@ See `forward-button' for information about N."
     (when (re-search-forward (concat "^" (regexp-quote command)) nil t)
       (goto-char (match-beginning 0))))
    (command
-    (cl-flet ((found () (eq (button-get (button-at (point)) 'command) 
command)))
+    (cl-flet ((found ()
+                (and-let* ((button (button-at (point))))
+                  (eq (button-get button 'command) command))))
       (while (and (ignore-errors (forward-button 1))
                   (not (found))))
       (unless (found)

Reply via email to