[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor f69daaf 084/140: with-editor-{finish, cancel}:
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor f69daaf 084/140: with-editor-{finish, cancel}: Run post hooks in correct directory |
Date: |
Fri, 6 Aug 2021 12:51:25 -0400 (EDT) |
branch: elpa/with-editor
commit f69daaf0acd9096bd3758fdc73a34b1a48d9c4f1
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
with-editor-{finish,cancel}: Run post hooks in correct directory
Run `with-editor-post-{finish,cancel}-hook' in the same directory as
was current in the buffer from which `with-editor-{finish,cancel}'
was invoked. This is necessary because running `with-editor-return'
likely changes the value of `default-directory', since it changes
the current directory.
---
with-editor.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index ba01946..88c55ba 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -332,11 +332,13 @@ And some tools that do not handle $EDITOR properly also
break."
(when (run-hook-with-args-until-failure
'with-editor-finish-query-functions force)
(let ((with-editor-post-finish-hook-1
- (ignore-errors (delq t with-editor-post-finish-hook))))
+ (ignore-errors (delq t with-editor-post-finish-hook)))
+ (dir default-directory))
(run-hooks 'with-editor-pre-finish-hook)
(with-editor-return nil)
(accept-process-output nil 0.1)
- (run-hooks 'with-editor-post-finish-hook-1))))
+ (let ((default-directory dir))
+ (run-hooks 'with-editor-post-finish-hook-1)))))
(defun with-editor-cancel (force)
"Cancel the current edit session."
@@ -348,11 +350,13 @@ And some tools that do not handle $EDITOR properly also
break."
(setq message (funcall message)))
(let ((with-editor-post-cancel-hook-1
(ignore-errors (delq t with-editor-post-cancel-hook)))
- (with-editor-cancel-alist nil))
+ (with-editor-cancel-alist nil)
+ (dir default-directory))
(run-hooks 'with-editor-pre-cancel-hook)
(with-editor-return t)
(accept-process-output nil 0.1)
- (run-hooks 'with-editor-post-cancel-hook-1))
+ (let ((default-directory dir))
+ (run-hooks 'with-editor-post-cancel-hook-1)))
(message (or message "Canceled by user")))))
(defun with-editor-return (cancel)
- [nongnu] elpa/with-editor 7c51288 122/140: make-process--with-editor-process-filter: &allow-other-keys, (continued)
- [nongnu] elpa/with-editor 7c51288 122/140: make-process--with-editor-process-filter: &allow-other-keys, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 236c158 127/140: Require subr-x for when-let, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 36e163c 132/140: manual: Reorder header properties a bit, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ebcbd3b 134/140: Use defvar-local instead of make-variable-buffer-local, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 48e1b2d 082/140: with-editor-shell-command-use-emacsclient: Fix last modified info, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ac6b2e3 085/140: with-editor*: New macro, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 53dcd4d 106/140: Fix typos, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 590ff0b 124/140: manual: Use a favicon in html export, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor a339d65 126/140: with-editor-export-editor: Support vterm, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5b62e6e 138/140: AUTHORS.md: Update list of contributors, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f69daaf 084/140: with-editor-{finish, cancel}: Run post hooks in correct directory,
Jonas Bernoulli <=
- [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