aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2011-07-11 22:15:04 +0200
committerLars Magne Ingebrigtsen2011-07-11 22:15:04 +0200
commit9988520a263e1cd78b1be5d182a6cc38cf307f5f (patch)
tree55777fa537497e90fde64cbd2860cdbdfd013394
parenteab5dc0727f022842e4b4eadd4b0ab0ce4b12939 (diff)
downloademacs-9988520a263e1cd78b1be5d182a6cc38cf307f5f.tar.gz
emacs-9988520a263e1cd78b1be5d182a6cc38cf307f5f.zip
Use `customize-save-variable' unconditionally, now that it works under emacs -Q
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/mail/sendmail.el6
-rw-r--r--lisp/mail/smtpmail.el10
3 files changed, 9 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f1c36a9feea..af6079ec0eb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org> 12011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * mail/sendmail.el (sendmail-query-once): Use
4 `customize-save-variable' unconditionally, now that it works under
5 emacs -Q.
6
7 * mail/smtpmail.el (smtpmail-query-smtp-server): Ditto.
8
3 * cus-edit.el (custom-file): Take an optional no-error variable. 9 * cus-edit.el (custom-file): Take an optional no-error variable.
4 (customize-save-variable): Set the variable, and give a warning if 10 (customize-save-variable): Set the variable, and give a warning if
5 running under "emacs -q". 11 running under "emacs -q".
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 5ffc834f533..fe20ad921da 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -159,8 +159,6 @@ This is used by the default mail-sending commands. See also
159(defvar sendmail-query-once-function 'query 159(defvar sendmail-query-once-function 'query
160 "Either a function to send email, or the symbol `query'.") 160 "Either a function to send email, or the symbol `query'.")
161 161
162(autoload 'custom-file "cus-edit")
163
164;;;###autoload 162;;;###autoload
165(defun sendmail-query-once () 163(defun sendmail-query-once ()
166 "Send an email via `sendmail-query-once-function'. 164 "Send an email via `sendmail-query-once-function'.
@@ -198,9 +196,7 @@ function to use, and then save that choice."
198 'smtpmail-send-it 196 'smtpmail-send-it
199 default)) 197 default))
200 (kill-buffer (current-buffer)))))) 198 (kill-buffer (current-buffer))))))
201 (if (ignore-errors (custom-file)) 199 (customize-save-variable 'sendmail-query-once-function function)))
202 (customize-save-variable 'sendmail-query-once-function function)
203 (setq sendmail-query-once-function function))))
204 (funcall sendmail-query-once-function)) 200 (funcall sendmail-query-once-function))
205 201
206;;;###autoload 202;;;###autoload
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 57356f3315b..073e2fa4a3c 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -587,8 +587,6 @@ The list is in preference order.")
587(defun smtpmail-response-text (response) 587(defun smtpmail-response-text (response)
588 (mapconcat 'identity (cdr response) "\n")) 588 (mapconcat 'identity (cdr response) "\n"))
589 589
590(autoload 'custom-file "cus-edit")
591
592(defun smtpmail-query-smtp-server () 590(defun smtpmail-query-smtp-server ()
593 (let ((server (read-string "Outgoing SMTP mail server: ")) 591 (let ((server (read-string "Outgoing SMTP mail server: "))
594 (ports '(587 "smtp")) 592 (ports '(587 "smtp"))
@@ -600,12 +598,8 @@ The list is in preference order.")
600 (setq port (pop ports))) 598 (setq port (pop ports)))
601 (when (setq stream (ignore-errors 599 (when (setq stream (ignore-errors
602 (open-network-stream "smtp" nil server port))) 600 (open-network-stream "smtp" nil server port)))
603 (if (ignore-errors (custom-file)) 601 (customize-save-variable 'smtpmail-smtp-server server)
604 (progn 602 (customize-save-variable 'smtpmail-smtp-service port)
605 (customize-save-variable 'smtpmail-smtp-server server)
606 (customize-save-variable 'smtpmail-smtp-service port))
607 (setq smtpmail-smtp-server server
608 smtpmail-smtp-service port))
609 (delete-process stream))) 603 (delete-process stream)))
610 (unless smtpmail-smtp-server 604 (unless smtpmail-smtp-server
611 (error "Couldn't contact an SMTP server")))) 605 (error "Couldn't contact an SMTP server"))))