From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#4169: 23.1.50; default mode for xml files not correct Date: Tue, 18 Aug 2009 04:25:06 +0200 Message-ID: References: <48317C0E1A69429482B1548C992F0FFC@xahPC> Reply-To: Lennart Borgman , 4169@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250802973 11442 80.91.229.12 (20 Aug 2009 21:16:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2009 21:16:13 +0000 (UTC) Cc: Xah Lee , 4169@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 20 23:16:06 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 1MeEzJ-0006EA-1Q for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 23:16:01 +0200 Original-Received: from localhost ([127.0.0.1]:58560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeEzI-0005VC-7V for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Aug 2009 17:16:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeEz7-0005PP-3f for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:15:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeEz2-0005LM-CP for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:15:48 -0400 Original-Received: from [199.232.76.173] (port=53539 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeEz1-0005Kx-G7 for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:15:43 -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 1MeEz0-0007El-NF for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 17:15:43 -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 n7KKkpoU019227; Thu, 20 Aug 2009 13:48:04 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7KKLp6Z014342; Thu, 20 Aug 2009 13:21:51 -0700 Resent-Date: Thu, 20 Aug 2009 13:21:51 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Lennart Borgman Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 20 Aug 2009 20:21:49 +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.125056231427782 (code B ref 4169); Thu, 20 Aug 2009 20:21:49 +0000 Original-Received: (at 4169) by emacsbugs.donarmstrong.com; 18 Aug 2009 02:25:14 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-yw0-f184.google.com (mail-yw0-f184.google.com [209.85.211.184]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7I2PCAx027595 for <4169@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 19:25:13 -0700 Original-Received: by ywh14 with SMTP id 14so4707989ywh.1 for <4169@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 19:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=YCsXZ7YqeiO5CYWeWLfxvVM3j4ZDroip7TxEsp5Cf6c=; b=bkQLwWojjxwv/Du5IAFobxqeZDEbwCHf7qt38FaCs/DFKZZuP/CW8cxqh+Avxkvo4F 3oNC8UJRnqa2iIqnAcxxrMC9Cttjr3E5pmJgi//jdbSFF7Sm7c7navHlO37/UFBQiQAm iuymYwzu/wR5jK2QbdxNMU18noO75YGNoqnRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kCzoZKOrLE8PykcQskc5tC1qtxTIylKk1d49ykNvTVhe736Xz211jnQXjDg36q8Pql rMmW13VNMnIFSIz2j3MkOtDz1Eh1EBLTSaAvFWbiW/Z41D2QqnmrKZ50XiuFtVsVeFUA MSzVALXvmGftLSlBknvXRrpxtPBDxRDX3tlPU= Original-Received: by 10.100.24.9 with SMTP id 9mr4457031anx.132.1250562306969; Mon, 17 Aug 2009 19:25:06 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 20 Aug 2009 17:15:48 -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:30367 Archived-At: On Tue, Aug 18, 2009 at 4:18 AM, Stefan Monnier wrote: >>>> 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). That is a good idea, but I would suggest using a table in between instead of fset. And a simple way to manipulate that table. (Maybe putting a property like 'this-is-a-major-mode on major mode functions?)