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: 積丹尼 Dan Jacobson
Subject: bug#38818: Dired: mention deleting buffers, not just windows
Date: Wed, 01 Jan 2020 13:11:15 +0800

>> (add-hook
>> 'dired-load-hook
>> (function
>> (lambda ()
>> (load "dired-x")
>> (define-key dired-mode-map "q" 'kill-current-buffer)
>> )))

>>>>> "MH" == Michael Heerdegen <address@hidden> writes:

MH> Slightly better version:

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

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

OK!
(info "(emacs) Hooks") just mentions the old fashioned way.
Maybe someone should update it.
OK maybe it is intentionally still full of those lambdas, for small jobs.





reply via email to

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