branch: externals/jarchive
commit a5ab89db3f7bf248f3f0ff0ad97767f2c9fe01e5
Author: dannyfreeman <[email protected]>
Commit: dannyfreeman <[email protected]>
Do not set default-directory, and manually set buffer-file-name
When `eglot-extend-to-xref` is `t`, this allows eglot to manage the
newly opened buffer with the current server instead of starting a new
one.
For clojure-lsp in particular, this does not allow continued xref use to
work. For that, the buffer still needs to be saved to disk I believe.
lsp-mode I think handles this specially for clojure by dumping extracted
files to a temp directory and including that directory in the current
project somehow.
---
jarchive.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/jarchive.el b/jarchive.el
index 589821c145..2423b2d2f9 100644
--- a/jarchive.el
+++ b/jarchive.el
@@ -71,8 +71,7 @@ provided when calling OP."
(with-current-buffer (create-file-buffer buffer-file)
(archive-zip-extract jar file-in-jar)
(goto-char 0)
- (set-visited-file-name buffer-file)
- (setq-local default-directory (file-name-directory jar))
+ (setq-local buffer-file-name buffer-file)
(setq-local buffer-offer-save nil)
(setq-local buffer-read-only t)
(set-auto-mode)