GNU bug report logs -
#12311
24.1.50; z in special-mode-map
Previous Next
Reported by: rms <at> gnu.org
Date: Thu, 30 Aug 2012 14:43:02 UTC
Severity: normal
Found in version 24.1.50
Fixed in version 24.3
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12311 in the body.
You can then email your comments to 12311 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Thu, 30 Aug 2012 14:43:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
rms <at> gnu.org
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 30 Aug 2012 14:43:06 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
In GNU Emacs 24.1.50.1 (mips64el-unknown-linux-gnu, GTK+ Version 2.12.12)
of 2012-07-31 on chiefs-gnewsense
Bzr revision: 109352 rgm <at> gnu.org-20120801021420-vmw6vrsr9w2xgkxf
Configured using:
`configure 'CFLAGS=-g -O0' '--with-gif=no' '--with-tiff=no''
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect:
shell-dirtrack-mode: t
gpm-mouse-mode: t
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Recent input:
RET g z C-x b o u t g TAB RET C-g C-h l C-x b o u t
g TAB C-g C-x d o u t g TAB RET C-h c z C-h f d i r
e d - m o r e DEL DEL d e RET C-x o TAB RET C-s k i
l l - t h C-s C-a C-x b . e m a c s RET C-x k RET C-x
C-f . e m a c s RET C-x C-v ESC DEL ESC DEL ESC DEL
ESC DEL RET C-s k i l l - t h ESC < C-x 1 C-s k i l
l - t h C-x b RET ESC < C-s C-s ESC x g r e p RET k
i l l - t h i s - b u f f e r RET ESC x g r e p RET
ESC p SPC * . e l RET C-x o C-u C-n C-n C-n C-n C-n
C-n C-u C-v C-u C-v C-x 1 C-u C-n C-n C-n C-n RET C-x
1 C-a C-u C-p C-u C-p C-p C-p C-p ESC f C-f C-@ C-e
ESC w C-x b . e m a c s RET ESC > RET ( d e f n e DEL
DEL i n e 0 k DEL DEL - k e y SPC C-y C-x 4 b RET C-a
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x o SPC
" z " SPC n i l ESC DEL u n d e f i n e d ) ESC b '
ESC C-x C-x C-s ESC x r e p o r t SPC e m a s SPC DEL
c s SPC b u g RET
Recent messages:
Mark set
Mark saved where search started
Mark set
Grep finished with no matches found
Grep finished (matches found)
Mark set [4 times]
undefined
Saving file /home/rms/.emacs...
Wrote /home/rms/.emacs
Scanning for dabbrevs...done
Load-path shadows:
None found.
Features:
(ispell byte-opt bytecomp byte-compile cconv macroexp rmailsum
compare-w novice doc-view image-mode arc-mode archive-mode jka-compr
bookmark pp shadow emacsbug edmacro kmacro vc-bzr find-func help-fns
apropos ind-util tabify man parse-time vc-cvs sgml-mode etags
dired-aux cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew
holidays hol-loaddefs cal-move cal-menu calendar cal-loaddefs epa-mail
epa derived epg epg-config rmailout rlogin dabbrev misearch
multi-isearch quail help-mode qp mule-util shell pcomplete grep
compile comint ansi-color ring mailalias rmailmm message sendmail
format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 dired t-mouse
time-date rmailedit rmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils paren cus-start cus-load tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
loaddefs button faces cus-face files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar
gtk x-toolkit x multi-tty emacs)
--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
Use Ekiga or an ordinary phone call
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Thu, 30 Aug 2012 15:42:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 12311 <at> debbugs.gnu.org (full text, mbox):
> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Thu, 30 Aug 2012 15:56:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 12311 <at> debbugs.gnu.org (full text, mbox):
> 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.
Feel free to remove it in the trunk, yes.
Stefan
bug marked as fixed in version 24.3, send any further explanations to
12311 <at> debbugs.gnu.org and rms <at> gnu.org
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Thu, 30 Aug 2012 19:29:04 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Thu, 30 Aug 2012 23:28:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 12311 <at> debbugs.gnu.org (full text, mbox):
I got rid of that binding.
--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
Use Ekiga or an ordinary phone call
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Sun, 02 Sep 2012 05:22:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 12311 <at> debbugs.gnu.org (full text, mbox):
The following message is a courtesy copy of an article
that has been posted to gmane.emacs.devel as well.
> * Drew Adams <qerj.nqnzf <at> benpyr.pbz> [2012-09-01 19:38:28 -0700]:
>
>> I use this all the time in buffers like *Help*,
>
> Why bother to kill *Help*? Why do that rather than `q'?
because 'q' will eventually start showing old *Help* buffers.
because 'q' deletes the window which I want to keep.
>> *Dired* &c. What am I supposed to use instead? C-u q?
>
> Sure, why not? Or `q' if you don't need to kill it.
because C-u q is two keystrokes; quite often I keep hitting 'z' until I
get to a buffer where z self-inserts.
> Or `C-x v' if you want to replace it.
C-x v is the vc prefix for me.
> You want to kill Dired but you don't want to use `C-u q'.
> OK, so bind `z' to killing once again if you want to.
the question is whether this is a generally useful binding.
I think it is.
> Or is it about other special-mode buffers? That's the useful question, to me.
> I would say forget about *Help* (which doesn't need to be killed) and Dired
> (which you sometimes don't want to kill).
>
> But are there special-mode buffers where `z' killing the buffer is really
> useful? If so, then maybe the fix was too heavy-handed.
I don't think special-mode buffers are "precious" - they are easily
restored, so killing them accidentally should not be a problem.
Apparently others disagree.
>> How is a ding more valuable than a useful behavior?
>
> Killing the buffer is not the only or the most useful behavior `z'
> could have in Dired. Dired is a rich mode with lots of keys already
> taken and with plenty of commands that could be bound to keys.
So bind it in dired mode. The change affects all the other special modes!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://dhimmi.com http://truepeace.org
http://think-israel.org http://pmw.org.il http://mideasttruth.com
Do the arithmetic or be doomed to talk nonsense. --John McCarthy
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Sun, 02 Sep 2012 13:42:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 12311 <at> debbugs.gnu.org (full text, mbox):
> > Or `C-x v' if you want to replace it.
>
> C-x v is the vc prefix for me.
I meant C-x C-v.
> > But are there special-mode buffers where `z' killing the
> > buffer is really useful? If so, then maybe the fix was
> > too heavy-handed.
>
> I don't think special-mode buffers are "precious" - they are easily
> restored, so killing them accidentally should not be a problem.
> Apparently others disagree.
I don't necessarily disagree, for one.
Richard's point was that not all special-mode buffers are non-precious. Your
point is that not all special-mode buffers are precious.
My point was about Dired (only): to not have Dired inherit from
special-mode-map. The problem was expressed in terms of Dired mode. But the
fix was to special-mode-map.
So far, the only special-mode buffers mentioned have been *Help* and Dired. To
me, *Help* is far from precious and Dired is one where I agree with Richard that
you don't want to be accidentally killing the buffer.
I can't speak to what is most appropriate for special mode in general. My point
was about Dired, where I agree with Richard about the annoyance/problem, but I
don't agree about the wider-ranging fix.
> > Killing the buffer is not the only or the most useful behavior `z'
> > could have in Dired. Dired is a rich mode with lots of keys already
> > taken and with plenty of commands that could be bound to keys.
>
> So bind it in dired mode. The change affects all the other
> special modes!
That is what I proposed: separate Dired from special-mode.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12311
; Package
emacs
.
(Mon, 03 Sep 2012 08:11:01 GMT)
Full text and
rfc822 format available.
Message #25 received at 12311 <at> debbugs.gnu.org (full text, mbox):
Sam Steingold <sds <at> gnu.org> writes:
> because 'q' will eventually start showing old *Help* buffers.
> because 'q' deletes the window which I want to keep.
The first point seems irrelevant; `q' should only show old buffers if
there is nothing better to show.
As for the second, we could add a defcustom to prevent `quit-window'
from deleting windows; would that be suitable for your usage?
> I don't think special-mode buffers are "precious" - they are easily
> restored, so killing them accidentally should not be a problem.
> Apparently others disagree.
One example of a special buffer which may be annoying to accidentally
delete is a *Packages* buffer, whose contents are fetched over a
network. Similarly with a non-DVCS VC-Dir buffer. But these are
personal value judgements, a.k.a. bikeshedding. There are two simple
solutions:
(define-key special-mode-map "z" ...)
or
C-x k RET
Emacs should strive to present a consistent user interface, so it's good
for special buffers to share as many keybindings as possible, when it
comes to basic operations like dismissal. That's why we've worked hard
to make these buffers use `q' (`quit-window'). In that context, it's
unacceptable to provide `z' for buffer-killing in some special buffers
but not others, for such a fuzzy reason as "precious" vs "non-precious".
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 01 Oct 2012 11:24:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 258 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.