<<< Date Index >>>     <<< Thread Index >>>

Re: xemacs, color, mail headers....



On Thu, Nov 20 2003 at 03:26:26PM BRST, Matt Price <matt.price@xxxxxxxxxxx> 
wrote:

> just switched from emacs to xemacs as my mutt mail editor.  this is
> great because now I can use gnuserv -nw, that is, attach an existing
> xemacs session to the current terminal, so I don't have to wait the 10
> seconds or so it takes for emacs to load every time I write a mail...
> 
> but I have a couple of problems, namely:
> 
> - in general, color isn't working when xemacs is run inside a
> terminal.  Not really a mutt question, but if anyone has any
> suggestions...

        It isn't working at all, or it shows very few colours?

        When I started using xemacs, I noticed its default colour selection
didn't work very well on the console, I had to change them with "M-x
customize-group RET faces RET"

> more particularly, when I used emacs, I had this great bit of code in
> my .emacs:

        You say later that this doesn't work in xemacs. Which part doesn't
work?

> (defun axels-mail-mode-hook () (

        How have you told xemacs to use this mode to edit mutt files?

> turn-on-auto-fill) ;;; Auto-Fill is necessary for mails 
> (turn-on-font-lock) ;;; Font-Lock is always cool*g* 
> (flush-lines "^\\(> \n\\)*> -- \n\\(\n?> .*\\)*") ;;; Kills quoted sigs. 
> (not-modified) ;;; We haven't changed the buffer, haven't we? *g* 
> (mail-text) ;;; Jumps to the beginning of the mail text 
> 
> (setq make-backup-files nil) ;;; No backups necessary. ) 
> (or (assoc "mutt-"
> auto-mode-alist) 
> (setq auto-mode-alist (cons '("mutt-" . mail-mode)
> auto-mode-alist))) 

        you call mail-mode here, but it's inside the hook! The hook has to
be executed in the first place for this to be called, it seems a bit out of
place.

        I'm not really a lisp programme, but, from what I know, hooks get
called when "something" specific happens. In a mode-hook, usually when that
mode gets called. The code you posted inverts things: the mode is called
inside the hook! So unless you somehow call axels-mail-mode , this hook is
not going to be executed.

        Try putting the "(or (assoc ...) (setq ...) auto-mode-alist)"
outside the hook, perhaps calling a custom mode (call it "axels-mail-mode",
if you will). Then you (defun axels-mail-mode-hook ()) and customize things
in there. It should work (I do something very similar here and it works :)

> (add-hook 'mail-mode-hook 'axels-mail-mode-hook)

        See? You call axels-mail-mode-hook from inside
mail-mode-hook. mail-mode-hook gets called when mail-mode is called. But
mail-mode is called from within axels-mail-mode-hook!

        I honestly don't know how this worked in emacs :)

> (server-start) 
> ;;; For use with emacsclient

        BTW, if you're going to use gnuclient, you should change
"(server-start)" for "(gnuserv-start").

        Hope this helps.



                rbp
-- 
 Rodrigo Bernardo Pimentel                         <rbp@xxxxxxxxxxxx>
 http://isnomore.net                          GPG KeyId: <0x0DB14978>

Picard: [...] After all, Number One, we're only mortal...
Riker: Speak for yourself, Sir. I plan to live forever.