From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4169: 23.1.50; default mode for xml files not correct Date: Mon, 17 Aug 2009 22:18:12 -0400 Message-ID: References: <48317C0E1A69429482B1548C992F0FFC@xahPC> Reply-To: Stefan Monnier , 4169@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250802796 10817 80.91.229.12 (20 Aug 2009 21:13:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2009 21:13:16 +0000 (UTC) Cc: Xah Lee , 4169@emacsbugs.donarmstrong.com To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 20 23:13:08 2009 Return-path: Envelope-to: geb-bug-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 1MeEwV-0004tF-Un for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 23:13:08 +0200 Original-Received: from localhost ([127.0.0.1]:37126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeEwV-0003ur-4W for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 17:13:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeEuP-0001fs-KF for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:10:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeEuK-0001X2-UZ for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:10:57 -0400 Original-Received: from [199.232.76.173] (port=55437 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeEuK-0001Wn-Ik for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:10:52 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52315) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeEuJ-0007El-WF for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:10:52 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7KKkpoA019227; Thu, 20 Aug 2009 13:48:02 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7KKLQkw014302; Thu, 20 Aug 2009 13:21:26 -0700 Resent-Date: Thu, 20 Aug 2009 13:21:26 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 20 Aug 2009 20:21:25 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4169 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4169-submit@emacsbugs.donarmstrong.com id=B4169.125056190026456 (code B ref 4169); Thu, 20 Aug 2009 20:21:25 +0000 Original-Received: (at 4169) by emacsbugs.donarmstrong.com; 18 Aug 2009 02:18:20 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7I2IIlS026445 for <4169@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 19:18:19 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtgEAL+riUpFpZNo/2dsb2JhbACBUtRfhBkFh0k X-IronPort-AV: E=Sophos;i="4.43,399,1246852800"; d="scan'208";a="43699639" Original-Received: from 69-165-147-104.dsl.teksavvy.com (HELO ceviche.home) ([69.165.147.104]) by ironport2-out.teksavvy.com with ESMTP; 17 Aug 2009 22:17:40 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 670DEB407B; Mon, 17 Aug 2009 22:18:12 -0400 (EDT) In-Reply-To: (Lennart Borgman's message of "Mon, 17 Aug 2009 16:35:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 20 Aug 2009 17:10:56 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30358 Archived-At: >>> I wrote majmodpri.el (part of nXhtml) to take care of this kind of >>> problem and suggested that something like it should be included in >>> Emacs. There has not been any positive response to it yet. >>> >>> The reason I wrote it was that this problem is much more prominent >>> when there are multi major modes as an alternative too. (For an xhtml >>> file for example you could use html-mode, nxml-mode, html-mumamo-mode, >>> nxhtml-mumamo-mode etc.) >> >> I'm not sure how emacs choose modes, or the policies, mechanisms, file >> locations...etc, or what majmodpri.el is supposed to do. Anyway, i thought >> this warrant a bug report for the record. Thanks. > Major modes are choosen by searching auto-mode-alist etc. The first > hit is choosen. (Sometimes the lists are searched several times > though.) > majmodpri.el sorts the list so that the major modes (or multi major > modes) that the user prefers comes first. When we offer several different modes for the same language (e.g. perl-mode vs cperl-mode), we should try to make auto-mode-alist (and other such facilities) point to a function alias (e.g. html-mode) which can then point to whichever major mode the user favors. E.g. we should probably rename sgml-mode.el's html-mode to sgml-html-mode, and then make (defalias 'html-mode 'sgml-html-mode) so that the user can easily (fset 'html-mode 'my-html-mode). Stefan