emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ec35939: Prompt to save gnus-cloud-method.


From: Teodor Zlatanov
Subject: [Emacs-diffs] master ec35939: Prompt to save gnus-cloud-method.
Date: Wed, 27 Jul 2016 19:22:26 +0000 (UTC)

branch: master
commit ec359399a47f852b4d022a30245449438e349193
Author: Ted Zlatanov <address@hidden>
Commit: Ted Zlatanov <address@hidden>

    Prompt to save gnus-cloud-method.
    
    Since `gnus-cloud-method' is a defcustom, when it's set, we should
    prompt the user to save it, so the customization is not lost on
    restart.
    
    * gnus-srvr.el (gnus-server-toggle-cloud-method-server): Prompt to
    save the customization of `gnus-cloud-method'.
---
 lisp/gnus/gnus-srvr.el |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 66fb9ee..6dbb54e 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -1156,7 +1156,12 @@ Requesting compaction of %s... (this may take a long 
time)"
     (unless (gnus-cloud-host-acceptable-method-p server)
       (error "The server under point can't host the Emacs Cloud"))
 
-    (custom-set-variables '(gnus-cloud-method server))
+    (when (not (string-equal gnus-cloud-method server))
+      (custom-set-variables '(gnus-cloud-method server))
+      ;; Note we can't use `Custom-save' here.
+      (when (gnus-yes-or-no-p
+             (format "The new cloud host server is %S now. Save it? " server))
+        (customize-save-variable 'gnus-cloud-method server)))
     (when (gnus-yes-or-no-p (format "Upload Cloud data to %S now? " server))
       (gnus-message 1 "Uploading all data to Emacs Cloud server %S" server)
       (gnus-cloud-upload-data t))))



reply via email to

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