emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/with-editor a16f5e8 101/140: with-editor-usage-message: Ne


From: Jonas Bernoulli
Subject: [nongnu] elpa/with-editor a16f5e8 101/140: with-editor-usage-message: New variable
Date: Fri, 6 Aug 2021 12:51:28 -0400 (EDT)

branch: elpa/with-editor
commit a16f5e88cd682faaae42f1240a6e035f9a219460
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]