gnu.emacs.help
[Top] [All Lists]

Re: How to set a file major mode in elisp

Subject: Re: How to set a file major mode in elisp
From: Mirko
Date: Fri, 02 Nov 2007 09:54:19 -0700
Newsgroups: gnu.emacs.help

On Nov 2, 9:56 am, Eric Hanchrow <off...@xxxxxxxxx> wrote:
>     I will be adding an entry to the diary file, and I would like the
>     buffer to be in the diary mode.  Is there some way of specifying it
>     explicitly instead of using auto-mode-alist?
>
> Sure --
>
>     (defun diary-entry ()
>       (interactive)
>       (find-file "~/diary")
>       (diary-mode)
> ;-----^^^^^^^^^^^^
>       (goto-char (point-max))
>       (open-line 1)
>       (goto-char (point-max))
>     ... )
>
> --
> The woods aren't any drier than they were in 2000, but there
> are a lot more people with matches.
>         -- Doug Chapin, Electionline.org

Thank you.  I don't think I will use Sebastian's suggestion, because I
don't want to mess with the diary file format if I can avoid it.

So, I will use the (obvious)  (diary-mode)

Mirko


<Prev in Thread] Current Thread [Next in Thread>