From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Specifying mode in file variables trouble Date: Wed, 24 Sep 2008 18:23:10 +0200 Message-ID: <48DA696E.4060807@gmail.com> References: <48D44761.6000809@gmail.com> <87ljxny6n8.fsf@catnip.gol.com> <48D44C79.9020004@gmail.com> <48D63F30.8060102@gmail.com> <48D6E8FB.4070108@gmail.com> <48D79A25.7050000@gmail.com> <48D8BB40.6060806@gmail.com> <48D9536D.50004@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222273481 3312 80.91.229.12 (24 Sep 2008 16:24:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2008 16:24:41 +0000 (UTC) Cc: dmhouse@gmail.com, monnier@iro.umontreal.ca, aaron.s.hawley@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 24 18:25:38 2008 connect(): Connection refused 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 1KiXAC-00078Y-IK for ged-emacs-devel@m.gmane.org; Wed, 24 Sep 2008 18:24:28 +0200 Original-Received: from localhost ([127.0.0.1]:33953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiX9A-0002hb-DK for ged-emacs-devel@m.gmane.org; Wed, 24 Sep 2008 12:23:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiX96-0002gY-57 for emacs-devel@gnu.org; Wed, 24 Sep 2008 12:23:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiX95-0002gI-La for emacs-devel@gnu.org; Wed, 24 Sep 2008 12:23:19 -0400 Original-Received: from [199.232.76.173] (port=47163 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiX95-0002gF-J7 for emacs-devel@gnu.org; Wed, 24 Sep 2008 12:23:19 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:48218) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiX94-0006Nq-0z; Wed, 24 Sep 2008 12:23:18 -0400 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:65449 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KiX92-0006kf-3o; Wed, 24 Sep 2008 18:23:16 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-Enigmail-Version: 0.95.7 X-Antivirus: avast! (VPS 080923-0, 2008-09-23), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KiX92-0006kf-3o. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KiX92-0006kf-3o 3b62b25eea43a20a070441644ed7053f X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) 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:104111 Archived-At: Richard M. Stallman wrote: > > I'm not sure whether majmodpri is a useful feature, because I am not > > convinced there is a real problem to be solved. What is a real case > > of the problem, and is there another solution? > > I tried to describe the problem in the comment in majmodpri.el. Is that > comment not clear? > > I can see what feature the file implements, for controlling the order > of `auto-mode-alist' and a few other variables. I do not see that the > feature is useful. > > If you show me a REAL case in which this is useful, that might convice me. When I wrote the majmodpri.el I had third party elisp files in mind. For files inside Emacs we can perhaps use a simpler mechanism. It is quite common that third party files adds themselves to auto-mode-alist when they are loaded. At least some of the php-mode.el varianst that are available does that; they bind .php to the php-mode the supply. This will then be the default major mode for .php files. We can of course say that should not have this side effect, but that does not help all times. (We have already done that.) This problem actually exists inside Emacs too. Today there are two major modes for editing XML files. majmodpri.el offers a way to solve this type of problem through custom (though it may of course need some changes). > I am not impressed by imaginary hypothetical cases. > > > But if we want such a facility, we should implement it right. The > > right way is to insert these elements in the proper position the first > > time. > > Unfortunately that can't be done. Please see the comment above. > > Of course it can be done. Yes, but this is a misunderstanding. I was thinking of the problems I wrote about above. > It is easy to write a function that would > add an item to `auto-mode-alist' and choose where to put it based on > whatever criteria we like. It could take four three arguments, one > being the major mode that the elements are for, and the other three > being elements to add to the three variables that majmodpri sorts. > And it could insert them in the proper order. > > I don't know if it is useful, but it is not hard.