From d9c0fc076518417a83c067ec91063455e6ccaa94 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Sat, 15 Feb 2025 09:43:58 -0300 Subject: [PATCH] Action button when point is just after it * lisp/cus-edit.el (Custom-newline): If no button at point, check for a button before point. (Bug#72341) (cherry picked from commit 8bea0aae3bb59bd0452c61f856d74650838f6a45) --- lisp/cus-edit.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3b9b32f3360..2f14d6590c9 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5396,10 +5396,13 @@ The format is suitable for use with `easy-menu-define'." To see what function the widget will call, use the `widget-describe' command." (interactive "@d" Custom-mode) - (let ((button (get-char-property pos 'button))) - ;; If there is no button at point, then use the one at the start - ;; of the line, if it is a custom-group-link (bug#2298). + (let ((button (or (get-char-property pos 'button) + ;; Maybe we are just past a button, and it's quite handy + ;; to action it as well. (Bug#72341) + (get-char-property (1- pos) 'button)))) (or button + ;; If there is no button at point, then use the one at the start + ;; of the line, if it is a custom-group-link (bug#2298). (if (setq button (get-char-property (line-beginning-position) 'button)) (or (eq (widget-type button) 'custom-group-link) (setq button nil)))) -- 2.39.5