From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: major mode in new buffers Date: Tue, 30 Mar 2010 23:02:32 -0400 Message-ID: References: <2f8988ff1003300457w38ee4bf0h259cd7a7187298e0@mail.gmail.com> <87oci5ev6a.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1270004594 32639 80.91.229.12 (31 Mar 2010 03:03:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 31 Mar 2010 03:03:14 +0000 (UTC) Cc: Juri Linkov , =?iso-8859-1?Q?Ren=E9?= Kyllingstad , emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 31 05:03:05 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NwoCp-0001lV-Si for ged-emacs-devel@m.gmane.org; Wed, 31 Mar 2010 05:03:04 +0200 Original-Received: from localhost ([127.0.0.1]:45654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwoCg-0006xv-7C for ged-emacs-devel@m.gmane.org; Tue, 30 Mar 2010 23:02:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwoCa-0006uf-FM for emacs-devel@gnu.org; Tue, 30 Mar 2010 23:02:44 -0400 Original-Received: from [140.186.70.92] (port=59553 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwoCW-0006oJ-0j for emacs-devel@gnu.org; Tue, 30 Mar 2010 23:02:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwoCR-0005wV-Aa for emacs-devel@gnu.org; Tue, 30 Mar 2010 23:02:39 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:63632 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwoCR-0005w7-7w for emacs-devel@gnu.org; Tue, 30 Mar 2010 23:02:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAMtXsktLd/h9/2dsb2JhbACbJ3LANIUABIsj X-IronPort-AV: E=Sophos;i="4.51,338,1267419600"; d="scan'208";a="59902772" Original-Received: from 75-119-248-125.dsl.teksavvy.com (HELO ceviche.home) ([75.119.248.125]) by ironport2-out.pppoe.ca with ESMTP; 30 Mar 2010 23:02:33 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id EA850660BF; Tue, 30 Mar 2010 23:02:32 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Wed, 31 Mar 2010 03:28:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122951 Archived-At: >> that the following code can be used for a new non-file buffer to set its >> major mode based on the buffer name: >>=20 >> =A0(setq-default major-mode (lambda () >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if buffer-file-= name >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (fundame= ntal-mode) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (let ((buffe= r-file-name (buffer-name))) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (set-aut= o-mode))))) > Try > emacs -Q -l ehelp --eval "(setq-default major-mode ...etc)" > M-x electric-describe-function car > r What about it? Stefan