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

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

Re: How to set a file major mode in elisp


From: Eric Hanchrow
Subject: Re: How to set a file major mode in elisp
Date: Fri, 02 Nov 2007 06:56:50 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

    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





reply via email to

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