]> git.eshelyaron.com Git - emacs.git/commitdiff
Prompt to save gnus-cloud-method.
authorTed Zlatanov <tzz@lifelogs.com>
Wed, 27 Jul 2016 19:22:02 +0000 (15:22 -0400)
committerTed Zlatanov <tzz@lifelogs.com>
Wed, 27 Jul 2016 19:22:02 +0000 (15:22 -0400)
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

index 66fb9ee1b59f704924352216e5a206a1fa3b2a32..6dbb54efb4a404ccbcc4c3e12c09100ec29ecd1f 100644 (file)
@@ -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))))