@@ -161,11 +161,31 @@ Main data structure of the dispatcher with the form:
161
161
" List of aliases for commands.
162
162
Rather than have to use n, etc, you can alias keys for others." )
163
163
164
+ (defvar resize-window--notify-timers nil
165
+ " Notify callback timers." )
166
+
167
+ (defun resize-window--cancel-notify ()
168
+ " Cancel all the notify callback timers."
169
+ (mapc 'cancel-timer resize-window--notify-timers)
170
+ (setq resize-window--notify-timers nil ))
171
+
164
172
(defun resize-window--notify (&rest info )
165
173
" Notify with INFO, a string or list (format-string object...).
166
- This is just a pass through to message usually. However, it can be
167
- overridden in tests to test the output of message."
168
- (when resize-window-notify-with-messages (apply #'message info)))
174
+ Display the status message again after a timeout.
175
+ Can be overridden in tests to test the output."
176
+ (resize-window--cancel-notify)
177
+ (when resize-window-notify-with-messages
178
+ (message " Resize mode: %s " (apply #'format info))
179
+ (push (run-with-timer 1.5 nil #'resize-window--notify-status )
180
+ resize-window--notify-timers)))
181
+
182
+ (defun resize-window--notify-status ()
183
+ " Display status message."
184
+ (when resize-window-notify-with-messages
185
+ (if (minibuffer-window-active-p (selected-window ))
186
+ (push (run-with-timer 1.5 nil #'resize-window--notify-status )
187
+ resize-window--notify-timers)
188
+ (message " Resize mode: insert KEY, ? for help, q or SPACE to quit " ))))
169
189
170
190
(defun resize-window--key-str (key )
171
191
" Return the string representation of KEY.
@@ -304,9 +324,7 @@ CHOICE is a \(key function documentation allows-capitals\).
304
324
If SCALED, then call action with the `resize-window-uppercase-argument' ."
305
325
(let ((action (resize-window--choice-lambda choice))
306
326
(description (resize-window--choice-documentation choice)))
307
- (unless (resize-window--keys-equal
308
- (resize-window--choice-keybinding choice) [?? ])
309
- (resize-window--notify " %s" description))
327
+ (resize-window--notify " %s" description)
310
328
(condition-case nil
311
329
(if scaled
312
330
(funcall action (resize-window-uppercase-argument))
@@ -327,7 +345,7 @@ to resize right."
327
345
; ; NOTE: Do not trim the stack here. Let stack requests to handle
328
346
; ; window configurations in excess.
329
347
(resize-window--add-backgrounds)
330
- (resize-window--notify " Resize mode: insert KEY, ? for help " )
348
+ (resize-window--notify-status )
331
349
(condition-case nil
332
350
(let ((reading-keys t )
333
351
; ; allow mini-buffer to collapse after displaying menu
@@ -351,6 +369,7 @@ to resize right."
351
369
(resize-window--keys-equal key [? ])
352
370
(resize-window--keys-equal key " C-g" ))
353
371
(setq reading-keys nil )
372
+ (resize-window--cancel-notify)
354
373
(resize-window--display-menu 'kill )
355
374
(resize-window--remove-backgrounds))
356
375
(t
@@ -359,6 +378,7 @@ to resize right."
359
378
" Unregistered key: %s -> %s"
360
379
key (resize-window--key-str key))))))))
361
380
(quit
381
+ (resize-window--cancel-notify)
362
382
(resize-window--display-menu 'kill )
363
383
(resize-window--remove-backgrounds))))
364
384
0 commit comments