From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#12311: 24.1.50; z in special-mode-map Date: Thu, 30 Aug 2012 08:40:36 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346341259 22460 80.91.229.3 (30 Aug 2012 15:40:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2012 15:40:59 +0000 (UTC) To: , <12311@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 30 17:41:01 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T76rc-000667-5p for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Aug 2012 17:41:00 +0200 Original-Received: from localhost ([::1]:37272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T76rZ-00068y-VU for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Aug 2012 11:40:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T76rW-00068m-CQ for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2012 11:40:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T76rU-0008Ly-Mo for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2012 11:40:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T76rU-0008Lp-If for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2012 11:40:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T76sc-0001F3-NO for bug-gnu-emacs@gnu.org; Thu, 30 Aug 2012 11:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Aug 2012 15:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12311 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12311-submit@debbugs.gnu.org id=B12311.13463413154756 (code B ref 12311); Thu, 30 Aug 2012 15:42:02 +0000 Original-Received: (at 12311) by debbugs.gnu.org; 30 Aug 2012 15:41:55 +0000 Original-Received: from localhost ([127.0.0.1]:58209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T76sU-0001Ee-7w for submit@debbugs.gnu.org; Thu, 30 Aug 2012 11:41:54 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:24763) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T76sR-0001EV-44 for 12311@debbugs.gnu.org; Thu, 30 Aug 2012 11:41:51 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q7UFedCA021951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 Aug 2012 15:40:39 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7UFecBD004098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 30 Aug 2012 15:40:38 GMT Original-Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7UFebAM030787; Thu, 30 Aug 2012 10:40:37 -0500 Original-Received: from dradamslap1 (/130.35.178.248) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Aug 2012 08:40:37 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac2GvaZD0HIEYgo2Qmys/AE5RHBTngABCqbQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] 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:63611 Archived-At: > I just discovered why some of the Dired buffers I always keep > occasionally disappear. It is because the binding of z in > special-mode-map makes it so easy to kill them. > > I just got rid of that binding in my .emacs, but I think that binding > is a bad idea. Not all the buffers in special modes are things people > don't mind deleting, and this key can cause annoyance if typed by > accident. +1 --- FWIW, I have long bound `z' to `diredp-compress-this-file', which is just a this-file version of `Z' (`dired-do-compress'). (defun diredp-compress-this-file () "In Dired, compress or uncompress the file on the cursor line." (interactive) (dired-do-compress 1)) --- Why do we even bother to have `dired-mode-map' inherit from `special-mode-map'? These are the only keys from `special-mode-map' that Dired does not already override: - and 0-9 negative-argument and digit-argument ? and h describe-mode g revert-buffer q quit-window z kill-this-buffer (That and the fact that `s-m-m' uses `suppress-keymap'.) And when you consider that for `g' Dired defines its own `revert-function', there is not a lot that is really taken from `s-m-m'. Dired overrides `SPC', `DEL', `>', and `<'. And `h' could also be overridden to serve a Dired purpose in the future (`h' just duplicates `?'). We might as well just define the keys we want directly in `dired-mode-map' and call `suppress-keymap' there. Inheritance is useful if it really saves (factors out) something significant, or if we want to be able to change something in one place and have that affect other places. The tradeoff is the extra coupling/dependency - someone changing `s-m-m' needs to think carefully about how that change might affect each mode that inherits from it. In the case of Dired, inheritance of `s-m-m' doesn't offer much, IMHO.