all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
Subject: Sendmail/Mac: initialize correctly [patch]
Date: Mon, 26 Dec 2005 12:26:41 +0100	[thread overview]
Message-ID: <E77C26ED-9BCE-44CA-AB53-B0814C9AC63F@gmail.com> (raw)

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	other threads:[~2005-12-26 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-26 11:26 David Reitter [this message]
2005-12-26 19:24 ` Sendmail/Mac: initialize correctly [patch] Luc Teirlinck
2005-12-26 19:34 ` Luc Teirlinck
2005-12-27  0:00 ` Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E77C26ED-9BCE-44CA-AB53-B0814C9AC63F@gmail.com \
    --to=david.reitter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.