From 4fe05d50593803b2d7d189c16d74b082c50845a6 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Wed, 6 Nov 2024 18:03:24 +0100 Subject: [PATCH] transient--goto-button: Cosmetics --- lisp/transient.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 34cf0d6..ce18bf1 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -4459,11 +4459,12 @@ See `forward-button' for information about N." (when (re-search-forward (concat "^" (regexp-quote command)) nil t) (goto-char (match-beginning 0)))) (command - (while (and (ignore-errors (forward-button 1)) - (not (eq (button-get (button-at (point)) 'command) command)))) - (unless (eq (button-get (button-at (point)) 'command) command) - (goto-char (point-min)) - (ignore-errors (forward-button 1)))))) + (cl-flet ((found () (eq (button-get (button-at (point)) 'command) command))) + (while (and (ignore-errors (forward-button 1)) + (not (found)))) + (unless (found) + (goto-char (point-min)) + (ignore-errors (forward-button 1))))))) (defun transient--heading-at-point () (and (eq (get-text-property (point) 'face) 'transient-heading)