aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Berman2025-06-23 11:51:31 +0200
committerStephen Berman2025-06-23 11:51:31 +0200
commit2b34f38b383533ca659202492870c319fbc7ef41 (patch)
tree973e81005041b43c7f2a51256a939ba492152272
parentedd18978aaae3ea50478843d0c9ad3441125f82f (diff)
downloademacs-2b34f38b383533ca659202492870c319fbc7ef41.tar.gz
emacs-2b34f38b383533ca659202492870c319fbc7ef41.zip
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.
1055'recentf-save-list' can print a message when saving the recentf list. 1055'recentf-save-list' can print a message when saving the recentf list.
1056The new option, if set to nil, suppresses this message. 1056The new option, if set to nil, suppresses this message.
1057 1057
1058---
1059*** New user option 'recentf-suppress-open-file-help'.
1060By default, invoking 'recentf-open-files' displays a message saying what
1061action clicking or typing RET on the item at point executes, and tabbing
1062between items in the *Open Recent* buffer likewise displays such
1063messages. To suppress these messages, customize the user option
1064'recentf-suppress-open-file-help' to non-nil. The default value of this
1065option is nil.
1066
1058** Saveplace 1067** Saveplace
1059 1068
1060--- 1069---
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."
330 :group 'recentf 330 :group 'recentf
331 :type 'boolean 331 :type 'boolean
332 :version "31.1") 332 :version "31.1")
333
334(defcustom recentf-suppress-open-file-help nil
335 "If non-nil, suppress help messages in recentf open file dialogs.
336By default, opening the dialog interactively and tabbing between items
337shows help messages. (In any case, a tooltip displays the help text
338when the mouse pointer hovers over an item)."
339 :group 'recentf
340 :type 'boolean
341 :version "31.1")
333 342
334;;; Utilities 343;;; Utilities
335;; 344;;
@@ -1101,15 +1110,38 @@ IGNORE arguments."
1101Go to the beginning of buffer if not found." 1110Go to the beginning of buffer if not found."
1102 (goto-char (point-min)) 1111 (goto-char (point-min))
1103 (condition-case nil 1112 (condition-case nil
1104 (let (done) 1113 (let ((no-echo (or recentf-suppress-open-file-help
1105 (widget-move 1) 1114 ;; Show help messages by default only when
1115 ;; invoking these interactively (bug#78666).
1116 (not (memq this-command '(recentf-open-files
1117 recentf-open-more-files
1118 recentf-forward
1119 recentf-backward)))))
1120 done)
1121 (widget-move 1 no-echo)
1106 (while (not done) 1122 (while (not done)
1107 (if (eq widget-type (widget-type (widget-at (point)))) 1123 (if (eq widget-type (widget-type (widget-at (point))))
1108 (setq done t) 1124 (setq done t)
1109 (widget-move 1)))) 1125 (widget-move 1 no-echo))))
1110 (error 1126 (error
1111 (goto-char (point-min))))) 1127 (goto-char (point-min)))))
1112 1128
1129(defun recentf-forward (arg)
1130 "Move the cursor to the next widget in the current dialog.
1131With prefix argument ARG, move to the ARGth next widget. If
1132`recentf-suppress-open-file-help' is non-nil, suppress help messages in
1133the echo area in the open recentf dialog."
1134 (interactive "p")
1135 (widget-forward arg recentf-suppress-open-file-help))
1136
1137(defun recentf-backward (arg)
1138 "Move the cursor to the previous widget in the current dialog.
1139With prefix argument ARG, move to the ARGth previous widget. If
1140`recentf-suppress-open-file-help' is non-nil, suppress help messages in
1141the echo area in the open recentf dialog."
1142 (interactive "p")
1143 (widget-backward arg recentf-suppress-open-file-help))
1144
1113(defvar-keymap recentf-dialog-mode-map 1145(defvar-keymap recentf-dialog-mode-map
1114 :doc "Keymap used in recentf dialogs." 1146 :doc "Keymap used in recentf dialogs."
1115 :parent (make-composed-keymap recentf--shortcuts-keymap widget-keymap) 1147 :parent (make-composed-keymap recentf--shortcuts-keymap widget-keymap)
@@ -1141,6 +1173,8 @@ Go to the beginning of buffer if not found."
1141 (recentf-dialog-mode) 1173 (recentf-dialog-mode)
1142 ,@forms 1174 ,@forms
1143 (widget-setup) 1175 (widget-setup)
1176 (keymap-local-set "<remap> <widget-forward>" #'recentf-forward)
1177 (keymap-local-set "<remap> <widget-backward>" #'recentf-backward)
1144 (switch-to-buffer (current-buffer)))) 1178 (switch-to-buffer (current-buffer))))
1145 1179
1146;;; Edit list dialog 1180;;; 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."
1383 (widget-echo-help (point))) 1383 (widget-echo-help (point)))
1384 (run-hooks 'widget-move-hook)) 1384 (run-hooks 'widget-move-hook))
1385 1385
1386(defun widget-forward (arg) 1386(defun widget-forward (arg &optional suppress-echo)
1387 "Move point to the next field or button. 1387 "Move point to the next field or button.
1388With optional ARG, move across that many fields." 1388With optional ARG, move across that many fields.
1389When the second optional argument is non-nil,
1390nothing is shown in the echo area."
1389 (interactive "p") 1391 (interactive "p")
1390 (run-hooks 'widget-forward-hook) 1392 (run-hooks 'widget-forward-hook)
1391 (widget-move arg)) 1393 (widget-move arg suppress-echo))
1392 1394
1393(defun widget-backward (arg) 1395(defun widget-backward (arg &optional suppress-echo)
1394 "Move point to the previous field or button. 1396 "Move point to the previous field or button.
1395With optional ARG, move across that many fields." 1397With optional ARG, move across that many fields.
1398When the second optional argument is non-nil,
1399nothing is shown in the echo area."
1396 (interactive "p") 1400 (interactive "p")
1397 (run-hooks 'widget-backward-hook) 1401 (run-hooks 'widget-backward-hook)
1398 (widget-move (- arg))) 1402 (widget-move (- arg) suppress-echo))
1399 1403
1400;; Since the widget code uses a `field' property to identify fields, 1404;; Since the widget code uses a `field' property to identify fields,
1401;; ordinary beginning-of-line does the right thing. 1405;; ordinary beginning-of-line does the right thing.