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

From: Pieter van Oostrum <[email-masked]>
Date: Sat, 04 Jan 2020 14:57:38 +0100

Michael Heerdegen <[email-masked]> writes:

> 積丹尼 Dan Jacobson <[email-masked]> writes:
>
>> >>>>> "PvO" == Pieter van Oostrum <[email-masked]> writes:
>> PvO> Well, this is how I do it.
>>
>> PvO> (defun my-dired-load-hook-fun ()
>> PvO>        (require 'dired-x)
>> PvO>        (define-key dired-mode-map "q" #'kill-current-buffer))
>>
>> PvO> (add-hook 'dired-load-hook 'my-dired-load-hook-fun)
>>
>> OK, but this does not seem environmentally friendly, leaving a function
>> (that I hereby promise not to use a second time,) lying around.
>
> Your lambda will also keep lying around.  The name "dired-load-hook"
> will keep lying around.

Yes, of course, I want that.

> And: for most of the hooks you want to add stuff to you probably can't
> be sure that it won't be run more than once.  Undefining cries for
> errors.  It's also not necessary, those few additional names hardly make
> a difference.

For me it doesn't. It was Dan who complained about that.
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]