emacs-devel
[Top][All Lists]
Advanced

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

Re: Sendmail/Mac: initialize correctly [patch]


From: Luc Teirlinck
Subject: Re: Sendmail/Mac: initialize correctly [patch]
Date: Mon, 26 Dec 2005 18:00:14 -0600 (CST)

I believe that the alternative solution given by the two patches below
should work.  It autoloads the standard-value property, which then
becomes available for `custom-reevaluate-setting'.

It has the advantage of not making the standard-value expression,
which is user visible through "Show initial Lisp expression", more
complex.  It has the disadvantage of duplicating this expression in the
source code, but the two occurrences are close together in the same
file, so it would be easy to update both at once should it be changed.
It would probably be possible to write a macro that writes the two
autoloads at once, so that there would be only one expression to
update.  However, if send-mail-function is the only instance, that is
probably not worth the trouble.

Of course, if you try out the patch, you have to make sure to update
your loaddefs properly.

Note that tex-dvi-view-command solves the same problem by allowing
the value to be any Lisp expression.  Then it evaluates that
expression at run time.  But that seems to make things more complex
for the user in the Custom buffer.

Here are the patches:

===File ~/sendmail-diff=====================================
*** sendmail.el 09 Dec 2005 17:35:30 -0600      1.299
--- sendmail.el 26 Dec 2005 17:08:01 -0600      
***************
*** 123,128 ****
--- 123,137 ----
    :type 'regexp
    :group 'sendmail)
  
+ ;; Prevent problems with `window-system' not having the correct value
+ ;; when loaddefs.el is loaded. `custom-reevaluate-setting' needs the
+ ;; standard value.
+ ;;;###autoload
+ (put 'send-mail-function 'standard-value
+      '((if (and window-system (memq system-type '(darwin windows-nt)))
+          'mailclient-send-it
+        'sendmail-send-it)))
+ 
  ;; Useful to set in site-init.el
  ;;;###autoload
  (defcustom send-mail-function
============================================================

===File ~/startup-diff======================================
*** startup.el  12 Dec 2005 20:44:32 -0600      1.391
--- startup.el  26 Dec 2005 17:13:52 -0600      
***************
*** 776,781 ****
--- 776,782 ----
    (custom-reevaluate-setting 'mouse-wheel-down-event)
    (custom-reevaluate-setting 'mouse-wheel-up-event)
    (custom-reevaluate-setting 'file-name-shadow-mode)
+   (custom-reevaluate-setting 'send-mail-function)
  
    ;; Register default TTY colors for the case the terminal hasn't a
    ;; terminal init file.
============================================================




reply via email to

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