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

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

[nongnu] elpa/helm eeab712b27 3/3: Ensure temp file is deleted even when


From: ELPA Syncer
Subject: [nongnu] elpa/helm eeab712b27 3/3: Ensure temp file is deleted even when user kill buffer manually
Date: Tue, 6 Jun 2023 10:03:11 -0400 (EDT)

branch: elpa/helm
commit eeab712b274362924520b110d46c826f22300947
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Ensure temp file is deleted even when user kill buffer manually
---
 helm-elisp.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/helm-elisp.el b/helm-elisp.el
index bd710572d4..9225f8be5a 100644
--- a/helm-elisp.el
+++ b/helm-elisp.el
@@ -978,6 +978,11 @@ Special commands:
       (add-text-properties start (1- (point)) '(read-only t))
       (add-text-properties (1- (point)) (point) '(read-only t rear-nonsticky 
t))
       (set (make-local-variable 'helm-pretty-print-current-symbol) sym)
+      (add-hook 'kill-buffer-hook
+                (lambda ()
+                  (when (file-exists-p helm-pretty-print-temp-file-name)
+                    (delete-file helm-pretty-print-temp-file-name)))
+                nil t)
       (save-excursion (insert pp))
       (write-region
        (point-min) (point-max) helm-pretty-print-temp-file-name nil 1)
@@ -1019,7 +1024,6 @@ The associated variable is the local variable
 (defun helm-edit-variable-quit ()
   "Quit edit variable buffer."
   (interactive)
-  (delete-file helm-pretty-print-temp-file-name)
   (set-buffer-modified-p nil)
   (quit-window t)
   (helm-aif (get-buffer-window "*Diff*" 'visible)



reply via email to

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