branch: externals/jarchive
commit d209394a47db368b83a719e3ea411ef5d0d5e74e
Author: dannyfreeman <[email protected]>
Commit: dannyfreeman <[email protected]>
Set a different buffer name that doesn't match the jarchive-regex
so that future work on the opened buffer is NOT handled by jarchive,
only emacs. This fixes the bug where a kill-buffer-hook re-creates the
killed buffer
---
jarchive.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/jarchive.el b/jarchive.el
index d387cc62a4..09d35e16ef 100644
--- a/jarchive.el
+++ b/jarchive.el
@@ -41,18 +41,19 @@ provided when calling OP."
(let* ((file (car args))
(match (string-match jarchive--hybrid-path-regex file))
(jar (substring file (match-beginning 1) (match-end 1)))
- (file-in-jar (substring file (match-beginning 2))))
- (or (jarchive--inhibit op (find-buffer-visiting file))
- (with-current-buffer (create-file-buffer file)
+ (file-in-jar (substring file (match-beginning 2)))
+ (buffer-file (concat jar ":" file-in-jar)))
+ (or (find-buffer-visiting buffer-file)
+ (with-current-buffer (create-file-buffer buffer-file)
(message "jarchive: writing buffer %s " args)
(setq-local jarchive--managed-buffer t)
(archive-zip-extract jar file-in-jar)
- (setq-local buffer-file-name file)
+ (goto-char 0)
+ (set-visited-file-name buffer-file)
(setq-local default-directory (file-name-directory jar))
(setq-local buffer-offer-save nil)
(setq buffer-read-only t)
(set-auto-mode)
- (goto-char 0)
(set-buffer-modified-p nil)
(current-buffer)))))
(t (jarchive--inhibit op (apply op args)))))