From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Sendmail/Mac: initialize correctly [patch] Date: Mon, 26 Dec 2005 12:26:41 +0100 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135599085 18383 80.91.229.2 (26 Dec 2005 12:11:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2005 12:11:25 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 26 13:11:24 2005 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EqrCA-0006R8-Fy for ged-emacs-devel@m.gmane.org; Mon, 26 Dec 2005 13:11:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eqr3u-0004uB-ES for ged-emacs-devel@m.gmane.org; Mon, 26 Dec 2005 07:02:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eqqbo-0002Id-P7 for emacs-devel@gnu.org; Mon, 26 Dec 2005 06:33:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EqqZJ-0001rn-QD for emacs-devel@gnu.org; Mon, 26 Dec 2005 06:31:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EqqWN-0001ay-4F for emacs-devel@gnu.org; Mon, 26 Dec 2005 06:28:08 -0500 Original-Received: from [66.249.92.199] (helo=uproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EqqWA-0004vv-Sy for emacs-devel@gnu.org; Mon, 26 Dec 2005 06:27:55 -0500 Original-Received: by uproxy.gmail.com with SMTP id u2so364812uge for ; Mon, 26 Dec 2005 03:26:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=Pz/+ub/zWZAGql5YiXwsNK4SgYj2mXiiDerb7fwFtTMG0pTBxs9bQ6YE4ii2hnERZGIeH/G2xMWTBOjySpAHT58aUER+cfmFih0QFKKFn0MIiSPnQaMUMZDuJARsXKEzf0TwtkpGtzViT/+4eEIQ+LqceRO4se3p1BwaeLPnJsI= Original-Received: by 10.67.27.1 with SMTP id e1mr1879371ugj; Mon, 26 Dec 2005 03:26:49 -0800 (PST) Original-Received: from ?192.168.178.111? ( [84.169.166.194]) by mx.gmail.com with ESMTP id c1sm3123719ugf.2005.12.26.03.26.49; Mon, 26 Dec 2005 03:26:49 -0800 (PST) Original-To: Emacs-Devel ' X-Mailer: Apple Mail (2.746.2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48375 Archived-At: 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,