emacs-devel
[Top][All Lists]
Advanced

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

Sendmail/Mac: initialize correctly [patch]


From: David Reitter
Subject: Sendmail/Mac: initialize correctly [patch]
Date: Mon, 26 Dec 2005 12:26:41 +0100

The current implementation of the defcustom `send-mail-function' doesn't initialize the value correctly because it looks at `window- system', which has a different value at compile time, and the initial value of the defcustoms is stored at that point (ldefs, I think) because it's an autoload.

The below patch fixes that; I'm not aware of a more elegant solution (I asked in an earlier thread on Nov 24).

-- D




Index: lisp/mail/sendmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/sendmail.el,v
retrieving revision 1.299
diff -c -r1.299 sendmail.el
*** lisp/mail/sendmail.el       9 Dec 2005 16:44:16 -0000       1.299
--- lisp/mail/sendmail.el       20 Dec 2005 12:39:35 -0000
***************
*** 126,134 ****
  ;; Useful to set in site-init.el
  ;;;###autoload
  (defcustom send-mail-function
!   (if (and window-system (memq system-type '(darwin windows-nt)))
!       'mailclient-send-it
!     'sendmail-send-it)
    "Function to call to send the current buffer as mail.
  The headers should be delimited by a line which is
  not a valid RFC822 header or continuation line,
--- 126,146 ----
  ;; Useful to set in site-init.el
  ;;;###autoload
  (defcustom send-mail-function
!   (progn ;; init value will be included in autoloads
!     (defun send-mail-function-default ()
!       "Initial value for `send-mail-function'"
!       (if (and window-system
!              (memq system-type '(darwin windows-nt)))
!         'mailclient-send-it
!       'sendmail-send-it))
!     (add-hook 'before-init-hook       
!             ;; evaluate at runtime when window-system is known
!             (lambda ()
!               "Initialize `send-mail-function'"
!               (set-default 'send-mail-function
!                            (send-mail-function-default))))
!     ;; initialize defcustom to the current default
!     (send-mail-function-default))
    "Function to call to send the current buffer as mail.
  The headers should be delimited by a line which is
  not a valid RFC822 header or continuation line,





reply via email to

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