From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.help Subject: Re: How to set a file major mode in elisp Date: Fri, 02 Nov 2007 15:05:14 +0000 Message-ID: <87y7dgbsd1.fsf@bzg.ath.cx> 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 1194012397 3905 80.91.229.12 (2 Nov 2007 14:06:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2007 14:06:37 +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 15:06:37 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 1Inx9s-0003cp-6J for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2007 15:06:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Inx9i-0002CU-28 for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2007 10:05:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Inx9S-0002BN-3l for help-gnu-emacs@gnu.org; Fri, 02 Nov 2007 10:05:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Inx9P-0002At-Q0 for help-gnu-emacs@gnu.org; Fri, 02 Nov 2007 10:05:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Inx9P-0002Ap-GZ for help-gnu-emacs@gnu.org; Fri, 02 Nov 2007 10:05:31 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.189]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Inx9O-0006yE-TD for help-gnu-emacs@gnu.org; Fri, 02 Nov 2007 10:05:31 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 19so1043532fkr for ; Fri, 02 Nov 2007 07:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:received:from:to:subject:in-reply-to:references:user-agent:date:message-id:mime-version:content-type:sender; bh=KXcwTd5Pi7+LzHJDfrWi+ilge5BbxJyDy5sWA1U8YB8=; b=NH/swWOjlPLGrWINLICZxJ3rH7ttRrarlbSjPaWjWkgkGGAoDKhy9et6YIkRSwM41nBqNFQID8AMbw4s0E+KFoTiZhRAif8YHrO3nRz4v52KNlgMRXdSBorg9P61oXEI4Qjpzpd9zkTwMj8Rf9FTlXmAumEre1/2itLk13Fubu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:from:to:subject:in-reply-to:references:user-agent:date:message-id:mime-version:content-type:sender; b=XFJSoUy1vyOLmzNPYqDShaIJmZdaKfTrlR2xCo/S22AZHhnXV+1yzxBcB90hDd52T/RWU6EKIn65OKJyVH7gSK4yDytMqm6g2qAURDjLqTWcgBV6lpPq1N0OMdpA3aPpumYP6X0xEeRoq632+6yGlp1tFYJRgJbH9q9UKyUx9VA= Original-Received: by 10.82.124.10 with SMTP id w10mr3099336buc.1194012329544; Fri, 02 Nov 2007 07:05:29 -0700 (PDT) Original-Received: from bzg.ath.cx ( [129.199.12.108]) by mx.google.com with ESMTPS id g1sm6880231muf.2007.11.02.07.05.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2007 07:05:28 -0700 (PDT) Original-Received: by bzg.ath.cx (Postfix, from userid 1000) id 7BAC81575BA; Fri, 2 Nov 2007 15:05:14 +0000 (GMT) In-Reply-To: <1194007331.617716.265210@19g2000hsx.googlegroups.com> (Mirko's message of "Fri, 02 Nov 2007 05:42:11 -0700") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:48986 Archived-At: Mirko 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