bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#38818: Dired: mention deleting buffers, not just windows


From: Michael Heerdegen
Subject: bug#38818: Dired: mention deleting buffers, not just windows
Date: Wed, 01 Jan 2020 05:53:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> OK, I'll use
> (add-hook
>  'dired-load-hook
>  (function
>   (lambda ()
>     (load "dired-x")
>     (define-key dired-mode-map "q" 'kill-current-buffer)
>     )))
> until something more fancy is invented.

Slightly better version:

(add-hook
 'dired-load-hook
 (defun my-dired-load-hook-fun ()
   (require 'dired-x)
   (define-key dired-mode-map "q" #'kill-current-buffer)))

-- a named function can't accidentally be added multiple times to a
hook, lambda already self-quotes, and `require' doesn't unnecessarily
reload a file.

BTW, the q binding in dired-mode-map originates from special-mode-map
from which dired-mode-map inherits.  These are all bindings that it inherits:

SPC             scroll-up-command
-               negative-argument
0 .. 9          digit-argument
<               beginning-of-buffer
>               end-of-buffer
?               describe-mode
g               revert-buffer
h               describe-mode
q               quit-window
DEL             scroll-down-command
S-SPC           scroll-down-command
<remap>         Prefix Command

So the q binding is somewhat standard, and other modes may share your
problem.

Ok, I can't help further, I don't want to propose a solution.

Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]