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

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

[elpa] externals-release/org e2366ac283: * lisp/org-persist.el: Do not l


From: ELPA Syncer
Subject: [elpa] externals-release/org e2366ac283: * lisp/org-persist.el: Do not litter /tmp when native compiling
Date: Wed, 21 Dec 2022 13:57:57 -0500 (EST)

branch: externals-release/org
commit e2366ac2830d073392fd9aae3b79ecdd87353bc9
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    * lisp/org-persist.el: Do not litter /tmp when native compiling
    
    Remove the directory created by `make-temp-file' when Emacs is called
    with -Q command line argument.  Only use the return value as the
    directory to be created when something is actually stored by
    org-persist while running Emacs.
    
    Reported-by: William Denton <wtd@pobox.com>
    Link: 
https://orgmode.org/list/alpine.DEB.2.22.394.2212211213480.270543@shell3.miskatonic.org
---
 lisp/org-persist.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 6ccf357784..80ecd85886 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -978,13 +978,17 @@ Also, remove containers associated with non-existing 
files."
     (add-hook 'kill-emacs-hook #'org-persist-gc)))
 
 ;; Point to temp directory when `org-persist--disable-when-emacs-Q' is set.
-(if (and org-persist--disable-when-emacs-Q
-         ;; FIXME: This is relying on undocumented fact that
-         ;; Emacs sets `user-init-file' to nil when loaded with
-         ;; "-Q" argument.
-         (not user-init-file))
-    (setq org-persist-directory
-          (make-temp-file "org-persist-" 'dir)))
+(when (and org-persist--disable-when-emacs-Q
+           ;; FIXME: This is relying on undocumented fact that
+           ;; Emacs sets `user-init-file' to nil when loaded with
+           ;; "-Q" argument.
+           (not user-init-file))
+  (setq org-persist-directory
+        (make-temp-file "org-persist-" 'dir))
+  ;; We don't need the temp directory to exist.
+  ;; `org-persist-write-all' will refrain from creating and writing to the dir 
if
+  ;; none exists yet.
+  (delete-directory org-persist-directory))
 
 (add-hook 'after-init-hook #'org-persist-load-all)
 



reply via email to

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