@@ -161,11 +161,31 @@ Main data structure of the dispatcher with the form:
161161 " List of aliases for commands.
162162Rather than have to use n, etc, you can alias keys for others." )
163163
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+
164172(defun resize-window--notify (&rest info )
165173 " 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 " ))))
169189
170190(defun resize-window--key-str (key )
171191 " Return the string representation of KEY.
@@ -304,9 +324,7 @@ CHOICE is a \(key function documentation allows-capitals\).
304324If SCALED, then call action with the `resize-window-uppercase-argument' ."
305325 (let ((action (resize-window--choice-lambda choice))
306326 (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)
310328 (condition-case nil
311329 (if scaled
312330 (funcall action (resize-window-uppercase-argument))
@@ -327,7 +345,7 @@ to resize right."
327345 ; ; NOTE: Do not trim the stack here. Let stack requests to handle
328346 ; ; window configurations in excess.
329347 (resize-window--add-backgrounds)
330- (resize-window--notify " Resize mode: insert KEY, ? for help " )
348+ (resize-window--notify-status )
331349 (condition-case nil
332350 (let ((reading-keys t )
333351 ; ; allow mini-buffer to collapse after displaying menu
@@ -351,6 +369,7 @@ to resize right."
351369 (resize-window--keys-equal key [? ])
352370 (resize-window--keys-equal key " C-g" ))
353371 (setq reading-keys nil )
372+ (resize-window--cancel-notify)
354373 (resize-window--display-menu 'kill )
355374 (resize-window--remove-backgrounds))
356375 (t
@@ -359,6 +378,7 @@ to resize right."
359378 " Unregistered key: %s -> %s"
360379 key (resize-window--key-str key))))))))
361380 (quit
381+ (resize-window--cancel-notify)
362382 (resize-window--display-menu 'kill )
363383 (resize-window--remove-backgrounds))))
364384
0 commit comments