branch: elpa/with-editor
commit a16f5e88cd682faaae42f1240a6e035f9a219460
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
with-editor-usage-message: New variable
Modes can set that to display their own usage message instead
of the default one.
---
with-editor.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index a071c55..f8f4da8 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -440,15 +440,18 @@ And some tools that do not handle $EDITOR properly also
break."
(user-error (substitute-command-keys "\
Don't kill this buffer. Instead cancel using \\[with-editor-cancel]"))))
+(defvar-local with-editor-usage-message "\
+Type \\[with-editor-finish] to finish, \
+or \\[with-editor-cancel] to cancel")
+
(defun with-editor-usage-message ()
;; Run after `server-execute', which is run using
;; a timer which starts immediately.
(run-with-timer
- 0.05 nil `(lambda ()
- (with-current-buffer ,(current-buffer)
- (message (substitute-command-keys "\
-Type \\[with-editor-finish] to finish, \
-or \\[with-editor-cancel] to cancel"))))))
+ 0.05 nil
+ `(lambda ()
+ (with-current-buffer ,(current-buffer)
+ (message (substitute-command-keys with-editor-usage-message))))))
;;; Wrappers