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'.
This commit is contained in:
Ted Zlatanov 2016-07-27 15:22:02 -04:00
parent 773778e1c0
commit ec359399a4
No known key found for this signature in database
GPG key ID: 11F23D0A4E4B9DEE

View 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))))