help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to set a file major mode in elisp


From: Mirko
Subject: How to set a file major mode in elisp
Date: Fri, 02 Nov 2007 05:42:11 -0700
User-agent: G2/1.0

Hi,

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))
... )

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?

Thank you,

Mirko



reply via email to

[Prev in Thread] Current Thread [Next in Thread]