branch: elpa/with-editor
commit b8641ac189a5e2635b5f97c2fa3777baeea51e8a
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
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)