@@ -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.
@@ -303,9 +323,7 @@ CHOICE is a \(key function documentation allows-capitals\).
303323If SCALED, then call action with the `resize-window-uppercase-argument' ."
304324 (let ((action (resize-window--choice-lambda choice))
305325 (description (resize-window--choice-documentation choice)))
306- (unless (resize-window--keys-equal
307- (resize-window--choice-keybinding choice) [?? ])
308- (resize-window--notify " %s" description))
326+ (resize-window--notify " %s" description)
309327 (condition-case nil
310328 (if scaled
311329 (funcall action (resize-window-uppercase-argument))
@@ -326,7 +344,7 @@ to resize right."
326344 ; ; NOTE: Do not trim the stack here. Let stack requests to handle
327345 ; ; window configurations in excess.
328346 (resize-window--add-backgrounds)
329- (resize-window--notify " Resize mode: insert KEY, ? for help " )
347+ (resize-window--notify-status )
330348 (condition-case nil
331349 (let ((reading-keys t )
332350 ; ; allow mini-buffer to collapse after displaying menu
@@ -350,6 +368,7 @@ to resize right."
350368 (resize-window--keys-equal key [? ])
351369 (resize-window--keys-equal key " C-g" ))
352370 (setq reading-keys nil )
371+ (resize-window--cancel-notify)
353372 (resize-window--display-menu 'kill )
354373 (resize-window--remove-backgrounds))
355374 (t
@@ -358,6 +377,7 @@ to resize right."
358377 " Unregistered key: %s -> %s"
359378 key (resize-window--key-str key))))))))
360379 (quit
380+ (resize-window--cancel-notify)
361381 (resize-window--display-menu 'kill )
362382 (resize-window--remove-backgrounds))))
363383
0 commit comments