diff options
| -rw-r--r-- | etc/NEWS | 9 | ||||
| -rw-r--r-- | lisp/recentf.el | 40 | ||||
| -rw-r--r-- | lisp/wid-edit.el | 16 |
3 files changed, 56 insertions, 9 deletions
| @@ -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. |
| 1056 | The new option, if set to nil, suppresses this message. | 1056 | The new option, if set to nil, suppresses this message. |
| 1057 | 1057 | ||
| 1058 | --- | ||
| 1059 | *** New user option 'recentf-suppress-open-file-help'. | ||
| 1060 | By default, invoking 'recentf-open-files' displays a message saying what | ||
| 1061 | action clicking or typing RET on the item at point executes, and tabbing | ||
| 1062 | between items in the *Open Recent* buffer likewise displays such | ||
| 1063 | messages. To suppress these messages, customize the user option | ||
| 1064 | 'recentf-suppress-open-file-help' to non-nil. The default value of this | ||
| 1065 | option 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. | ||
| 336 | By default, opening the dialog interactively and tabbing between items | ||
| 337 | shows help messages. (In any case, a tooltip displays the help text | ||
| 338 | when 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." | |||
| 1101 | Go to the beginning of buffer if not found." | 1110 | Go 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. | ||
| 1131 | With prefix argument ARG, move to the ARGth next widget. If | ||
| 1132 | `recentf-suppress-open-file-help' is non-nil, suppress help messages in | ||
| 1133 | the 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. | ||
| 1139 | With prefix argument ARG, move to the ARGth previous widget. If | ||
| 1140 | `recentf-suppress-open-file-help' is non-nil, suppress help messages in | ||
| 1141 | the 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. |
| 1388 | With optional ARG, move across that many fields." | 1388 | With optional ARG, move across that many fields. |
| 1389 | When the second optional argument is non-nil, | ||
| 1390 | nothing 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. |
| 1395 | With optional ARG, move across that many fields." | 1397 | With optional ARG, move across that many fields. |
| 1398 | When the second optional argument is non-nil, | ||
| 1399 | nothing 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. |