From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5062: image-toggle-display overwrites nxml-mode local key map Date: Thu, 03 Dec 2009 02:59:16 +0200 Organization: JURTA Message-ID: <87ws15m3gb.fsf@mail.jurta.org> References: <87einifskr.fsf@mail.jurta.org> <87bpim8d5b.fsf@mail.jurta.org> <87fx7x5np9.fsf@mail.jurta.org> <87einh7zlw.fsf@mail.jurta.org> Reply-To: Juri Linkov , 5062@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 1259803700 15102 80.91.229.12 (3 Dec 2009 01:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Dec 2009 01:28:20 +0000 (UTC) Cc: Tassilo Horn , Brent Goodrick , 5062@emacsbugs.donarmstrong.com To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 03 02:28:12 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 1NG0UO-00084S-1q for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Dec 2009 02:28:12 +0100 Original-Received: from localhost ([127.0.0.1]:37294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NG0UN-0003Ol-KM for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Dec 2009 20:28:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NG0Tn-0002pr-AC for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 20:27:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NG0Tg-0002hH-RX for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 20:27:33 -0500 Original-Received: from [199.232.76.173] (port=39777 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NG0Tf-0002gQ-PA for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 20:27:27 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48445) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NG0Tf-0005Xp-5F for bug-gnu-emacs@gnu.org; Wed, 02 Dec 2009 20:27:27 -0500 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 nB31ROAm004933; Wed, 2 Dec 2009 17:27:24 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB31P7ST004708; Wed, 2 Dec 2009 17:25:07 -0800 Resent-Date: Wed, 2 Dec 2009 17:25:07 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Juri Linkov Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 03 Dec 2009 01:25:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 5062 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5062-submit@emacsbugs.donarmstrong.com id=B5062.12598031804210 (code B ref 5062); Thu, 03 Dec 2009 01:25:07 +0000 Original-Received: (at 5062) by emacsbugs.donarmstrong.com; 3 Dec 2009 01:19:40 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx2.starman.ee (smtp-out4.starman.ee [85.253.0.6]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB31JcR8004203 for <5062@emacsbugs.donarmstrong.com>; Wed, 2 Dec 2009 17:19:39 -0800 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (62.65.209.27.cable.starman.ee [62.65.209.27]) by mx2.starman.ee (Postfix) with ESMTP id 400C43F40B0; Thu, 3 Dec 2009 03:19:32 +0200 (EET) In-Reply-To: (Lennart Borgman's message of "Mon, 30 Nov 2009 00:16:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 02 Dec 2009 20:27:33 -0500 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:33160 Archived-At: >> Or did you mean a joint mode like `c-mode-and-image-minor-mode', >> `nxml-mode-and-image-minor-mode', `ps-mode-and-doc-view-minor-mode'? >> Wouldn't this be too clumsy? > > Yes, why would it be too clumsy? > > A more flexibel way might be to use define-globalized-minor-mode. The > turn on function there could make any check. It could for example look > in a list similar to auto-mode-alist, but for minor modes. > > But maybe that would take too long time? I think Stefan's idea of allowing auto-mode-alist to have entries like ("regexp" (major-mode minor-mode-1 minor-mode-2 ...)) is more universal. Two basic ways to specify modes are: 1. With Local Variables you can put in the first line -*- mode: major-mode; mode: minor-mode-1; mode: minor-mode-2; ... -*- or the same to the Local Variables list, or to the Directory Local Variables. 2. With `auto-mode-alist' you can bind filename patterns to major modes, but not to minor modes. (major-mode minor-mode-1 minor-mode-2 ...) would allow to do the same that Local Variables already allows to do, e.g. ("\\.xpm\\'" (c-mode image-minor-mode)), ("\\.svg\\'" (nxml-mode image-minor-mode)), ("\\.ps\\'" (ps-mode doc-view-minor-mode)), etc. PS: this feature currently is not too necessary, because in the patch I sent `image-mode-maybe' was replaced with `image-mode' in `auto-mode-alist' to display a file as an image by default (the default behavior in 23.1). And only if someone wants to change this default to display a file as text initially, this requires either adding `image-mode-maybe' to `auto-mode-alist' or a combination of normal-mode + image-minor-mode that can be implemented as a new feature. -- Juri Linkov http://www.jurta.org/emacs/