[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor 7b8520b 096/140: with-editor-kill-buffer-noop:
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor 7b8520b 096/140: with-editor-kill-buffer-noop: When killing Emacs silently cancel |
Date: |
Fri, 6 Aug 2021 12:51:27 -0400 (EDT) |
branch: elpa/with-editor
commit 7b8520b98f882f635db7eec115d8e61d8cc8cf32
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
with-editor-kill-buffer-noop: When killing Emacs silently cancel
Closes #64.
---
with-editor.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index 80929d5..bbbf3ad 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -1,6 +1,6 @@
;;; with-editor.el --- Use the Emacsclient as $EDITOR -*- lexical-binding: t
-*-
-;; Copyright (C) 2014-2018 The Magit Project Contributors
+;; Copyright (C) 2014-2019 The Magit Project Contributors
;;
;; You should have received a copy of the AUTHORS.md file. If not,
;; see https://github.com/magit/with-editor/blob/master/AUTHORS.md.
@@ -432,8 +432,13 @@ And some tools that do not handle $EDITOR properly also
break."
(put 'with-editor-mode 'permanent-local t)
(defun with-editor-kill-buffer-noop ()
- (user-error (substitute-command-keys "\
-Don't kill this buffer. Instead cancel using \\[with-editor-cancel]")))
+ (if (memq this-command '(save-buffers-kill-terminal
+ save-buffers-kill-emacs))
+ (let ((run-hook-with-args-until-failure nil))
+ (with-editor-cancel nil)
+ t)
+ (user-error (substitute-command-keys "\
+Don't kill this buffer. Instead cancel using \\[with-editor-cancel]"))))
(defun with-editor-usage-message ()
;; Run after `server-execute', which is run using
- [nongnu] elpa/with-editor 76f238f 088/140: make: Remove leftover debug statement, (continued)
- [nongnu] elpa/with-editor 76f238f 088/140: make: Remove leftover debug statement, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 23919ec 095/140: Release version 2.8.2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor a16f5e8 101/140: with-editor-usage-message: New variable, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 45c29f9 103/140: Fix travis setup, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f17d129 073/140: Rename COPYING file to LICENSE, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ad5bb00 078/140: Improve detection of remacs client in macOS, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor fb9fdde 079/140: manual: Use a preamble to make initial text collapsible, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7ac5743 087/140: with-editor*: Correct debug declaration, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 9dd9f17 092/140: manual: Clarify with-editor-shell-command's description, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 38df9bf 094/140: manual: Prevent evaluation of code blocks, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7b8520b 096/140: with-editor-kill-buffer-noop: When killing Emacs silently cancel,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 4f06aba 102/140: with-editor-usage-message: Cosmetics, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 19ebf53 104/140: Handle async-bytecomp-allowed-packages properly, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d5c7772 105/140: with-editor-kill-buffer-noop: Revert previous kludge, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 814777c 107/140: Revert "Add .github/FUNDING.yml", Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d3150a5 110/140: make: Copy indices for htmlified info manuals, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7e0bf75 111/140: Release version 2.9.1, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 4fe66d4 114/140: Silence byte-compiler, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f25a707 115/140: make: No longer add dash to ORG_LOAD_PATH, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor e804473 113/140: with-editor-export-editor: Use printf instead of echo, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7ec873b 117/140: Release version 2.9.2, Jonas Bernoulli, 2021/08/06