unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Elisp help needed
@ 2003-11-26 22:59 Tassilo Horn
  2003-11-27  6:29 ` Eli Zaretskii
       [not found] ` <mailman.693.1069918173.399.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Tassilo Horn @ 2003-11-26 22:59 UTC (permalink / raw)


Hi,

I need some help with Elisp. I want to configure Gnus to my needs and
therefore wrote an Elisp function which should fetch the From-line of
mails I wanna send. With the From-line it should decide which
smtp-server the mail should be send through.
My code is:

(defun fs-change-smtp ()
  "Change the SMTP server according to the current from line."
  (save-excursion
    (let ((from
	   (save-restriction
	     (message-narrow-to-headers)
	     (message-fetch-field "from"))))
      (cond
       ((string-match from "heimdall@uni-koblenz.de")
	(setq smtpmail-smtp-server "mailhost.uni-koblenz.de"))
       ((string-match from "tassilo.horn@freenet.de")
	(setq smtpmail-smtp-server "mx.freenet.de"))
       ((string-match from "tassilo.horn@gmx.de")
	(setq smtpmail-smtp-server "mail.gmx.de"))
       (t
	(setq smtpmail-smtp-server "mailhost.uni-koblenz.de"))))))
(add-hook 'message-send-hook 'fs-change-smtp)

But this doesn't work correctly. Always the default of the cond is
taken, even the From-line is another mail address (gmx or freenet). So I
think that the variable from has the wrong content.

Does anybody find the bug?
Or does anyone have another solution for my problem?

Much thanks in advance,
Tassilo

-- 
"I dunno - the guy who wrote the mouse driver in Windows systems was a
 genius. Ever noticed that the mouse can still work when the whole OS
 has crashed in a screaming heap?" - John Wiltshire

^ permalink raw reply	[flat|nested] 10+ messages in thread
* elisp help needed
@ 2006-03-01 16:58 Robert D. Crawford
  2006-03-01 21:37 ` RD
  2006-03-02 12:50 ` Katsumi Yamaoka
  0 siblings, 2 replies; 10+ messages in thread
From: Robert D. Crawford @ 2006-03-01 16:58 UTC (permalink / raw)


I have the following lines in my .emacs file:

(remove-hook 'w3m-after-cursor-move-hook
     #'w3m-print-this-url)

and for some reason, to get it to eval I have to do it by hand every
time I restart emacs.  I *think* this might be the only code that is not
being evaled, but I do not know any way to be certain.  I know that
there are things below this line that are being correctly evaled.  All
the code in the customize section seems to be ok, and I have a function
that byte-compiles .el files when they are saved that works.

Is there some way to know what is being evaled?

Thanks,

rdc

-- 
<========================================================================>
Robert D. Crawford                                      rdc1x@comcast.net

Q:	How many IBM 370's does it take to execute a job?
A:	Four, three to hold it down, and one to rip its head off.
<========================================================================>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-03-04 13:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-26 22:59 Elisp help needed Tassilo Horn
2003-11-27  6:29 ` Eli Zaretskii
     [not found] ` <mailman.693.1069918173.399.help-gnu-emacs@gnu.org>
2003-11-27  8:48   ` Tassilo Horn
  -- strict thread matches above, loose matches on Subject: below --
2006-03-01 16:58 elisp " Robert D. Crawford
2006-03-01 21:37 ` RD
2006-03-02 11:36   ` Robert D. Crawford
2006-03-04 12:26     ` Tim Cross
2006-03-04 13:57       ` Robert D. Crawford
2006-03-02 12:50 ` Katsumi Yamaoka
2006-03-02 13:34   ` Robert D. Crawford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).