summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Berman <stephen.berman@gmx.net>2025-06-23 11:51:31 +0200
committerStephen Berman <stephen.berman@gmx.net>2025-06-23 11:51:31 +0200
commit2b34f38b383533ca659202492870c319fbc7ef41 (patch)
tree973e81005041b43c7f2a51256a939ba492152272
parentedd18978aaae3ea50478843d0c9ad3441125f82f (diff)
Optionally suppress recentf open file messages (bug#78666)
* etc/NEWS: Announce new user option. * lisp/recentf.el (recentf-suppress-open-file-help): New defcustom. (recentf-dialog-goto-first): Use it; otherwise, make calling 'widget-move' suppress message only for interactive recentf use. (recentf-forward, recentf-backward): New commands, wrappers around 'widget-{forward, backward}' using 'recentf-suppress-open-file-help'. (recentf-dialog): Use them in locally remapped key bindings. * lisp/wid-edit.el (widget-forward, widget-backward): Add optional argument to suppress :help-echo message and pass it to 'widget-move'.
-rw-r--r--etc/NEWS9
-rw-r--r--lisp/recentf.el40
-rw-r--r--lisp/wid-edit.el16
3 files changed, 56 insertions, 9 deletions
diff --git a/etc/NEWS b/etc/NEWS
index ca97f26a196..f7aebdf538f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1055,6 +1055,15 @@ compatible.
'recentf-save-list' can print a message when saving the recentf list.
The new option, if set to nil, suppresses this message.
+---
+*** New user option 'recentf-suppress-open-file-help'.
+By default, invoking 'recentf-open-files' displays a message saying what
+action clicking or typing RET on the item at point executes, and tabbing
+between items in the *Open Recent* buffer likewise displays such
+messages. To suppress these messages, customize the user option
+'recentf-suppress-open-file-help' to non-nil. The default value of this
+option is nil.
+
** Saveplace
---
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 006b3159bb9..d641250f017 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -330,6 +330,15 @@ t means show messages that were printed by default on Emacs <= 31.1."
:group 'recentf
:type 'boolean
:version "31.1")
+
+(defcustom recentf-suppress-open-file-help nil
+ "If non-nil, suppress help messages in recentf open file dialogs.
+By default, opening the dialog interactively and tabbing between items
+shows help messages. (In any case, a tooltip displays the help text
+when the mouse pointer hovers over an item)."
+ :group 'recentf
+ :type 'boolean
+ :version "31.1")
;;; Utilities
;;
@@ -1101,15 +1110,38 @@ IGNORE arguments."
Go to the beginning of buffer if not found."
(goto-char (point-min))
(condition-case nil
- (let (done)
- (widget-move 1)
+ (let ((no-echo (or recentf-suppress-open-file-help
+ ;; Show help messages by default only when
+ ;; invoking these interactively (bug#78666).
+ (not (memq this-command '(recentf-open-files
+ recentf-open-more-files
+ recentf-forward
+ recentf-backward)))))
+ done)
+ (widget-move 1 no-echo)
(while (not done)
(if (eq widget-type (widget-type (widget-at (point))))
(setq done t)
- (widget-move 1))))
+ (widget-move 1 no-echo))))
(error
(goto-char (point-min)))))
+(defun recentf-forward (arg)
+ "Move the cursor to the next widget in the current dialog.
+With prefix argument ARG, move to the ARGth next widget. If
+`recentf-suppress-open-file-help' is non-nil, suppress help messages in
+the echo area in the open recentf dialog."
+ (interactive "p")
+ (widget-forward arg recentf-suppress-open-file-help))
+
+(defun recentf-backward (arg)
+ "Move the cursor to the previous widget in the current dialog.
+With prefix argument ARG, move to the ARGth previous widget. If
+`recentf-suppress-open-file-help' is non-nil, suppress help messages in
+the echo area in the open recentf dialog."
+ (interactive "p")
+ (widget-backward arg recentf-suppress-open-file-help))
+
(defvar-keymap recentf-dialog-mode-map
:doc "Keymap used in recentf dialogs."
:parent (make-composed-keymap recentf--shortcuts-keymap widget-keymap)
@@ -1141,6 +1173,8 @@ Go to the beginning of buffer if not found."
(recentf-dialog-mode)
,@forms
(widget-setup)
+ (keymap-local-set "<remap> <widget-forward>" #'recentf-forward)
+ (keymap-local-set "<remap> <widget-backward>" #'recentf-backward)
(switch-to-buffer (current-buffer))))
;;; Edit list dialog
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index db241ca914a..311e39f4c0f 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1383,19 +1383,23 @@ nothing is shown in the echo area."
(widget-echo-help (point)))
(run-hooks 'widget-move-hook))
-(defun widget-forward (arg)
+(defun widget-forward (arg &optional suppress-echo)
"Move point to the next field or button.
-With optional ARG, move across that many fields."
+With optional ARG, move across that many fields.
+When the second optional argument is non-nil,
+nothing is shown in the echo area."
(interactive "p")
(run-hooks 'widget-forward-hook)
- (widget-move arg))
+ (widget-move arg suppress-echo))
-(defun widget-backward (arg)
+(defun widget-backward (arg &optional suppress-echo)
"Move point to the previous field or button.
-With optional ARG, move across that many fields."
+With optional ARG, move across that many fields.
+When the second optional argument is non-nil,
+nothing is shown in the echo area."
(interactive "p")
(run-hooks 'widget-backward-hook)
- (widget-move (- arg)))
+ (widget-move (- arg) suppress-echo))
;; Since the widget code uses a `field' property to identify fields,
;; ordinary beginning-of-line does the right thing.