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

From: Pieter van Oostrum <[email-masked]>
Date: Sat, 04 Jan 2020 00:18:39 +0100

積丹尼 Dan Jacobson <[email-masked]> writes:

>>>>>> "PvO" == Pieter van Oostrum <[email-masked]> writes:
> PvO> Michael Heerdegen <[email-masked]> writes:
>
>>> 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)))
>
> PvO> The documentation of defun says that its result is undefined. So either
> PvO> it should not be relied upon, or (if the result is reliably the defined
> PvO> function) it should be documented as such.
>
> OK. So what is the best way I should write it for my .emacs file? Thanks.

Well, this is how I do it.

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

(add-hook 'dired-load-hook 'my-dired-load-hook-fun)

-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]