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#5062: 23.1.50; image-toggle-display overwrites nxml-mode local key map Date: Sun, 29 Nov 2009 13:33:06 -0500 Message-ID: References: <87einifskr.fsf@mail.jurta.org> <87bpim8d5b.fsf@mail.jurta.org> <87fx7x5np9.fsf@mail.jurta.org> Reply-To: Stefan Monnier , 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 1259520465 15638 80.91.229.12 (29 Nov 2009 18:47:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Nov 2009 18:47:45 +0000 (UTC) Cc: Tassilo Horn , Brent Goodrick , 5062@emacsbugs.donarmstrong.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 29 19:47:37 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 1NEoo4-0001L4-QF for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Nov 2009 19:47:37 +0100 Original-Received: from localhost ([127.0.0.1]:49056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEoo4-0008Mm-JF for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Nov 2009 13:47:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NEonz-0008MS-7C for bug-gnu-emacs@gnu.org; Sun, 29 Nov 2009 13:47:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NEonu-0008LT-Bg for bug-gnu-emacs@gnu.org; Sun, 29 Nov 2009 13:47:30 -0500 Original-Received: from [199.232.76.173] (port=51293 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEonu-0008LQ-9K for bug-gnu-emacs@gnu.org; Sun, 29 Nov 2009 13:47:26 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34578) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NEont-00031B-Py for bug-gnu-emacs@gnu.org; Sun, 29 Nov 2009 13:47:26 -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 nATIlNhL000370; Sun, 29 Nov 2009 10:47:23 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nATIe5o3032165; Sun, 29 Nov 2009 10:40:05 -0800 Resent-Date: Sun, 29 Nov 2009 10:40:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sun, 29 Nov 2009 18:40:04 +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.125951959431674 (code B ref 5062); Sun, 29 Nov 2009 18:40:04 +0000 Original-Received: (at 5062) by emacsbugs.donarmstrong.com; 29 Nov 2009 18:33:14 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nATIXCMZ031666 for <5062@emacsbugs.donarmstrong.com>; Sun, 29 Nov 2009 10:33:14 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroEAGdNEktFpYc//2dsb2JhbACBTdIShDEEihk X-IronPort-AV: E=Sophos;i="4.47,308,1257138000"; d="scan'208";a="50285527" Original-Received: from 69-165-135-63.dsl.teksavvy.com (HELO ceviche.home) ([69.165.135.63]) by ironport2-out.pppoe.ca with ESMTP; 29 Nov 2009 13:33:06 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 83C6CB40E6; Sun, 29 Nov 2009 13:33:06 -0500 (EST) In-Reply-To: <87fx7x5np9.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 29 Nov 2009 18:03:50 +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: Sun, 29 Nov 2009 13:47:30 -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:33039 Archived-At: > Even though doc-view is a superset of image-mode, currently I see no way > to merge them cleanly. As mentioned, it may not be easy or even desirable to merge them completely. But we should strive to keep them as close as possible and to make doc-view use image-mode.el functions and data wherever possible. Maybe if one cannot be a derived mode of them other, we could make a "shared parent" mode (like an abstract class). > But using the same handling of major/minor modes > would be good. The patch below leaves the role for `image-minor-mode' > to only provide the `C-c C-c' binding, and also toggles between > `image-mode' and `image-mode-maybe' in `image-toggle-display' . I haven't looked in detail (partly because it doesn't apply to the current code because of some other change I installed in the mean time), but it looks good. > One open question is about using `image-mode-maybe'. With this > patch, it's essentially a combination of a non-image major mode > (`normal-mode' with image-mode entries removed from `auto-mode-alist') > and `image-minor-mode'. So when `image-mode-maybe' is present in > `auto-mode-alist' this means "to set a non-image major mode and > image-minor-mode". > It would be more nice to get rid of `image-mode-maybe', and to use > `image-minor-mode' in `auto-mode-alist'. But I don't know how to > specify both a non-image major mode and image-minor-mode > at the same time using `auto-mode-alist'. IIRC auto-mode-alist can point to minor-modes (the auto-mode-alist entry needs to look something like ("regexp" minor-mode t)), but I don't think it can be used here (the constraints on how it can be used are very strict since it needs to "consume" a suffix and be called before the major-mode). Maybe we could extend auto-mode-alist to allow things like ("regexp" (major-mode minor-mode-1 minor-mode-2 ...)). > The approach currently used in doc-view for PS files is more ugly than > using `image-mode-maybe'. It adds to ps-mode.el the line: > (declare-function doc-view-minor-mode "doc-view") To the extent that postscript would always use image-minor-mode anyway, I think the way it's done now is at least as clean if not cleaner than relying on image-mode-maybe (image-mode-maybe is fairly hackish). > I think this should be changed to use the solution described above > adding e.g. `doc-view-mode-maybe' (or a better name) as a combination > of a non-image major mode and image minor-mode. I don't think that would be an improvement. This is in contrast to XPM and SVG formats where they get combined with major-modes that are also used for non-image documents, so it wouldn't make sense for nxml-mode or c-mode to always enable image-minor-mode. Stefan