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#10650: view-mode inconsistencies wrt special mode-class Date: Thu, 02 Feb 2012 13:49:34 -0500 Message-ID: References: <9vehugoa9d.fsf@fencepost.gnu.org> <87pqe08kgs.fsf@gnu.org> <87ehuegj8y.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1328208655 22160 80.91.229.3 (2 Feb 2012 18:50:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2012 18:50:55 +0000 (UTC) Cc: Chong Yidong , 10650@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 02 19:50:54 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rt1k7-0001mD-5K for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Feb 2012 19:50:47 +0100 Original-Received: from localhost ([::1]:53091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt1k6-0003Qg-OO for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Feb 2012 13:50:46 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt1jz-0003QQ-IP for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 13:50:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt1jt-0002qx-RE for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 13:50:39 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt1jt-0002qt-OE for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 13:50:33 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Rt1kL-0004ep-Ka for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2012 13:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Feb 2012 18:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10650 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10650-submit@debbugs.gnu.org id=B10650.132820860717846 (code B ref 10650); Thu, 02 Feb 2012 18:51:01 +0000 Original-Received: (at 10650) by debbugs.gnu.org; 2 Feb 2012 18:50:07 +0000 Original-Received: from localhost ([127.0.0.1]:51166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt1jT-0004dn-61 for submit@debbugs.gnu.org; Thu, 02 Feb 2012 13:50:07 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52053) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rt1jQ-0004df-9A for 10650@debbugs.gnu.org; Thu, 02 Feb 2012 13:50:05 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q12InYZN018600; Thu, 2 Feb 2012 13:49:34 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id AD5DC130004; Thu, 2 Feb 2012 13:49:34 -0500 (EST) In-Reply-To: <87ehuegj8y.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 02 Feb 2012 02:40:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4120=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4120> : streams <725170> : uri <1058595> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:56395 Archived-At: >>> Personally I think a separate variable controlling which modes are >>> incompatible with view-mode would be better, but I'm not going to >>> complain if the definition of special modes is extended to cover this. >> I'm not sure exactly what's the idea with view-mode's use of special >> mode class, but IIUC it's that we don't want to enable view-mode in >> major modes that already have view-mode-like keybindings, which might >> boil down to something along the lines of "major modes which use >> suppress-keymap". > Without using the special mode class or adding a new separate variable, > the closest condition to match modes incompatible with view-mode would be: > (and (buffer-file-name) > (or (derived-mode-p 'special-mode) > (equal (keymap-parent (current-local-map)) special-mode-map))) > What is worth to note is that these modes don't suppress the > special-mode keymap, but inherit from it and override most of its > key bindings. I didn't mean to say that those modes use suppress-keymap directly, jus that their keymap is "suppressed" which is the case for any keymap which inherits from special-mode-map. Here's another heuristic: (eq 'undefined (lookup-key (current-local-map) [remap self-insert-command])) -- Stefan