From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mirko Newsgroups: gmane.emacs.help Subject: Re: How to set a file major mode in elisp Date: Fri, 02 Nov 2007 09:54:19 -0700 Organization: http://groups.google.com Message-ID: <1194022459.106954.3760@o80g2000hse.googlegroups.com> References: <1194007331.617716.265210@19g2000hsx.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1194025820 20515 80.91.229.12 (2 Nov 2007 17:50:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2007 17:50:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 02 18:50:24 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Io0f0-0000ov-04 for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2007 18:50:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Io0Vu-00052l-C9 for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2007 13:40:58 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!o80g2000hse.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: 208.218.238.20 Original-X-Trace: posting.google.com 1194022459 23855 127.0.0.1 (2 Nov 2007 16:54:19 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 2 Nov 2007 16:54:19 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: o80g2000hse.googlegroups.com; posting-host=208.218.238.20; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153509 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48992 Archived-At: On Nov 2, 9:56 am, Eric Hanchrow 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