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

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

[nongnu] elpa/with-editor b8641ac 054/140: with-editor-output-filter: do


From: Jonas Bernoulli
Subject: [nongnu] elpa/with-editor b8641ac 054/140: with-editor-output-filter: don't assume default-directory is valid
Date: Fri, 6 Aug 2021 12:51:19 -0400 (EDT)

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

    with-editor-output-filter: don't assume default-directory is valid
    
    ... because `with-editor-process-filter' may bind it to nil.
    
    When we still used `file-remote-p' instead of `tramp-tramp-file-p' in
    `with-editor-output-filter' (i.e. before 9fc047751b53), then that did
    not matter because the latter simply returns nil when its argument is
    nil, while the former raises an error.
---
 with-editor.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/with-editor.el b/with-editor.el
index a29cc41..2b35b52 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -521,7 +521,7 @@ which may or may not insert the text into the PROCESS' 
buffer."
               (file (match-string 2 string)))
           (with-current-buffer
               (find-file-noselect
-               (if (file-name-absolute-p file)
+               (if (and (file-name-absolute-p file) default-directory)
                    (concat (file-remote-p default-directory) file)
                  (expand-file-name file)))
             (with-editor-mode 1)



reply via email to

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