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

Re: xemacs qyestion



On Wed, Jul 15, 2009 at 09:12:24AM +0200, Joost Kremers wrote:
> On Wed, Jul 15, 2009 at 12:54:04AM -0600, lee wrote:
> > (setq auto-mode-alist
> >   (append
> >    '(("/tmp/mutt-cat-.*" . post-mode))
> >    auto-mode-alist))
> 
> you could also do:
> 
> (add-to-list 'auto-mode-alist '("mutt-cat-.*" . post-mode))

Yeah --- but as long as it works, I better don't change it :)

> > How do I make it so that flyspell-mode is also turned on
> > automatically?
> 
> by putting it in a hook that is run when post-mode is run. normally, a major
> mode will have such a hook, simply called <major-mode>-hook, i.e. in the case 
> of
> post-mode it should be post-mode-hook. so:
> 
> (add-hook 'post-mode-hook 'turn-on-flyspell)
> 
> should *probably* do it. (but check the documentation for flyspell-mode to 
> find
> out what the best way is to turn it on. i don't use it so i don't know...)

It doesn't work. Unfortunately, I couldn't find documentation about
flyspell-mode yet. And I don't know what the "hooks" do. There is some
documentation, like about elisp, but what I haven't found is a
documentation that would explain things like that so that one could
learn how to program emacs.

Maybe it's not working because I'm using xemacs, and I'm starting
gnuclient from within mutt to edit mails.

> > I'm guessing that the flyspell-mode is not a mode despite it appears
> > to be one,
> 
> it is, it's just not a major mode but a minor mode.
> 
> > which probably is why I can't make it turn on
> > automatically. And if it's not a mode, it shouldn't be called mode.
> 
> you haven't described what you've tried to do to turn it on, so no-one can say
> what you might have done wrong...

Well, I just tried things to get it to work, it doesn't really matter
why they didn't. But one thing I tried was to append flyspell-mode to
auto-mode-alist just like post-mode:


(setq auto-mode-alist
  (append
   '(("/tmp/mutt-cat-.*" . post-mode))
   auto-mode-alist))

(setq auto-mode-alist
  (append
   '(("/tmp/mutt-cat-.*" . flyspell-mode))
   auto-mode-alist))


and some variations of


(setq auto-mode-alist
  (append
   '(("/tmp/mutt-cat-.*" . (post-mode flyspell-mode)))
   auto-mode-alist))


That's logical and should work, but it doesn't. I googled and found
some examples where flyspell-mode was turned on automatically and
tried some of them, to no avail. Some used (flyspell-mode 1), others
seemed to make up functions to turn it on, and there were some that
used hooks.

> (BTW, i think your question would be better asked on an emacs news group or
> mailing list.)

You're right --- but I didn't want to subsribe to another mailing list
or forum to ask only one simple question, and since there are users
here using emacs as editor for mutt like I do, they might know how to
do it, and it might be of use to those who don't --- and thus not too
badly misplaced here. But maybe it turns out to be a very difficult
question?