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

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

[elpa] externals/preview-tailor be0dd57dca 2/6: Save only when initializ


From: ELPA Syncer
Subject: [elpa] externals/preview-tailor be0dd57dca 2/6: Save only when initialized
Date: Mon, 17 Jun 2024 21:58:57 -0400 (EDT)

branch: externals/preview-tailor
commit be0dd57dca414707415911f53ba7dd0a3b8c5340
Author: Paul Nelson <ultrono@gmail.com>
Commit: Paul Nelson <ultrono@gmail.com>

    Save only when initialized
    
    * preview-tailor.el (preview-tailor--initialized): New variable.
    (preview-tailor-save): Save only when initialized.
---
 preview-tailor.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/preview-tailor.el b/preview-tailor.el
index acf6eb2b02..65701381bd 100644
--- a/preview-tailor.el
+++ b/preview-tailor.el
@@ -137,19 +137,24 @@ Use SCALE if provided, otherwise prompt for it."
       (insert-file-contents preview-tailor-storage-file)
       (setq preview-tailor-multipliers (read (current-buffer))))))
 
+(defvar preview-tailor--initialized nil
+  "Non-nil if preview-tailor has been initialized.")
+
 ;;;###autoload
 (defun preview-tailor-init ()
   "Initialize preview-tailor."
   (interactive)
   (preview-tailor-load)
-  (setq preview-scale-function #'preview-tailor--calculate))
+  (setq preview-scale-function #'preview-tailor--calculate)
+  (setq preview-tailor--initialized t))
 
 ;;;###autoload
 (defun preview-tailor-save ()
   "Save preview-tailor customization to a dotfile."
   (interactive)
-  (with-temp-file preview-tailor-storage-file
-    (prin1 preview-tailor-multipliers (current-buffer))))
+  (when preview-tailor--initialized
+    (with-temp-file preview-tailor-storage-file
+      (prin1 preview-tailor-multipliers (current-buffer)))))
 
 (provide 'preview-tailor)
 ;;; preview-tailor.el ends here



reply via email to

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