[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to set a file major mode in elisp
From: |
Mirko |
Subject: |
Re: How to set a file major mode in elisp |
Date: |
Fri, 02 Nov 2007 09:54:19 -0700 |
User-agent: |
G2/1.0 |
On Nov 2, 9:56 am, Eric Hanchrow <off...@blarg.net> 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