[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to set a file major mode in elisp
From: |
Bastien |
Subject: |
Re: How to set a file major mode in elisp |
Date: |
Fri, 02 Nov 2007 15:05:14 +0000 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux) |
Mirko <mvukovic@nycap.rr.com> writes:
> In a piece of elisp, I would like to open an existing file and set its
> major mode for later editing. This is an example of the code that I
> am using
>
> (defun diary-entry ()
> (interactive)
> (find-file "~/diary")
> (goto-char (point-max))
> (open-line 1)
> (goto-char (point-max))
> ... )
This looks weird...
> 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?
(diary-mode) ?
--
Bastien