@@ -155,11 +155,28 @@ Main data structure of the dispatcher with the form:
155
155
" List of aliases for commands.
156
156
Rather than have to use n, etc, you can alias keys for others." )
157
157
158
+ (defvar resize-window--notify-timers nil
159
+ " Notify callback timers." )
160
+
161
+ (defun resize-window--cancel-notify ()
162
+ " Cancel all the notify callback timers."
163
+ (mapc 'cancel-timer resize-window--notify-timers)
164
+ (setq resize-window--notify-timers nil ))
165
+
158
166
(defun resize-window--notify (&rest info )
159
167
" Notify with INFO, a string or list (format-string object...).
160
- This is just a pass through to message usually. However, it can be
161
- overridden in tests to test the output of message."
162
- (when resize-window-notify-with-messages (apply #'message info)))
168
+ Display the status message again after a timeout.
169
+ Can be overridden in tests to test the output."
170
+ (resize-window--cancel-notify)
171
+ (when resize-window-notify-with-messages
172
+ (message " Resize mode: %s " (apply #'format info))
173
+ (push (run-with-timer 1.5 nil #'resize-window--notify-status )
174
+ resize-window--notify-timers)))
175
+
176
+ (defun resize-window--notify-status ()
177
+ " Display status message."
178
+ (when resize-window-notify-with-messages
179
+ (message " Resize mode: insert KEY, ? for help, q or SPACE to quit " )))
163
180
164
181
(defun resize-window--key-str (key )
165
182
" Return the string representation of KEY.
@@ -297,9 +314,7 @@ CHOICE is a \(key function documentation allows-capitals\).
297
314
If SCALED, then call action with the `resize-window-uppercase-argument' ."
298
315
(let ((action (resize-window--choice-lambda choice))
299
316
(description (resize-window--choice-documentation choice)))
300
- (unless (resize-window--keys-equal
301
- (resize-window--choice-keybinding choice) [?? ])
302
- (resize-window--notify " %s" description))
317
+ (resize-window--notify " %s" description)
303
318
(condition-case nil
304
319
(if scaled
305
320
(funcall action (resize-window-uppercase-argument))
@@ -320,7 +335,7 @@ to resize right."
320
335
; ; NOTE: Do not trim the stack here. Let stack requests to handle
321
336
; ; window configurations in excess.
322
337
(resize-window--add-backgrounds)
323
- (resize-window--notify " Resize mode: insert KEY, ? for help " )
338
+ (resize-window--notify-status )
324
339
(condition-case nil
325
340
(let ((reading-keys t )
326
341
; ; allow mini-buffer to collapse after displaying menu
@@ -343,6 +358,7 @@ to resize right."
343
358
(resize-window--keys-equal key [? ])
344
359
(resize-window--keys-equal key " C-g" ))
345
360
(setq reading-keys nil )
361
+ (resize-window--cancel-notify)
346
362
(resize-window--display-menu 'kill )
347
363
(resize-window--remove-backgrounds))
348
364
(t
0 commit comments