From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: buffer-auto-mode-alist (was: Scratch buffer annoyance) Date: Mon, 20 Aug 2007 14:31:24 -0400 Message-ID: References: <85ejinrqgk.fsf@lola.goethe.zz> <35917.128.165.123.18.1185998078.squirrel@webmail.lanl.gov> <85vebzq7vd.fsf@lola.goethe.zz> <87odhqethv.fsf@catnip.gol.com> <87zm18v7ug.fsf@jurta.org> <85abt7kck1.fsf@lola.goethe.zz> <87hcndc3zc.fsf@jurta.org> <86fy2wbujj.fsf@lola.quinscape.zz> <86sl6van2y.fsf@lola.quinscape.zz> <85ps1zdpw3.fsf@lola.goethe.zz> <87643oed00.fsf@jurta.org> <87zm0nrzjn.fsf_-_@jurta.org> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1187634604 27447 80.91.229.12 (20 Aug 2007 18:30:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2007 18:30:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 20 20:30:01 2007 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.50) id 1INC0m-0003GW-Dc for ged-emacs-devel@m.gmane.org; Mon, 20 Aug 2007 20:30:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INC0m-0002Ep-7H for ged-emacs-devel@m.gmane.org; Mon, 20 Aug 2007 14:30:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INByH-0001EW-HI for emacs-devel@gnu.org; Mon, 20 Aug 2007 14:27:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INByE-0001Cq-Mx for emacs-devel@gnu.org; Mon, 20 Aug 2007 14:27:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INByE-0001Ce-HZ for emacs-devel@gnu.org; Mon, 20 Aug 2007 14:27:22 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1INByE-0004cS-IK for emacs-devel@gnu.org; Mon, 20 Aug 2007 14:27:22 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1INC28-0000ua-NK; Mon, 20 Aug 2007 14:31:24 -0400 In-reply-to: <87zm0nrzjn.fsf_-_@jurta.org> (message from Juri Linkov on Mon, 20 Aug 2007 02:16:16 +0300) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:76851 Archived-At: I think the best way to implement this feature is to add a new hook `after-create-buffer-hook' containing a function that sets buffer mode according to `buffer-auto-mode-alist'. This hook could be called from `get-buffer-create'. I would rather put the code directly into `get-buffer-create' and avoid using a hook to run it. When a feature is standardly on, it is cleaner not to do it using a hook. This hook will also help to remove defadvice for `create-file-buffer' in uniquify.el when a uniquify renaming function will be appended after buffer-auto-mode-alist renaming function in this hook. That might be a good reason this hook. But we do not want to depend on the order of hook functions. So we should handle `buffer-auto-mode-alist' explicitly before running the hook.