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: Thu, 02 Jan 2020 05:14:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Pieter van Oostrum <address@hidden> 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)))
>
> The documentation of defun says that its result is undefined. So either
> it should not be relied upon, or (if the result is reliably the defined
> function) it should be documented as such.

Indeed: the return value of `defun' even changed recently (from
returning the definition to returning the defined symbol).  Same for
defalias.

I think I'll file another bug report: adding user defined functions to
hooks not only has the common pitfall which is not warned about - the
alternative, using named functions, is also quite inconvenient since
defun's return value is unspecified.  I guess most users currently do it
wrong.  Or do I miss something?


Thanks,

Michael.





reply via email to

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