GNU bug report logs - #65459
completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Tue, 22 Aug 2023 22:05:02 UTC

Severity: normal

Full log


Message #155 received at 65459 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Gregory Heytings <gregory <at> heytings.org>
Cc: Heime <heimeborgia <at> protonmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 65459 <at> debbugs.gnu.org
Subject: Re: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION
 and REQUIRE-MATCH
Date: Mon, 4 Sep 2023 15:16:15 -0700
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

>> Thanks, that clarifies that question!  Perhaps a paragraph along those lines
>> could be added to "(elisp)Advising Functions"?
>
> What about the following?

I think it's a good addition.

> diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
> index 53525e6b386..236b823e7e6 100644
> --- a/doc/lispref/functions.texi
> +++ b/doc/lispref/functions.texi
> @@ -1994,9 +1994,16 @@ Advising Named Functions
>  debugging does not notice or remember that the function has been modified
>  by advice.
>
> -  For these reasons, advice should be reserved for the cases where you
> -cannot modify a function's behavior in any other way.  If it is
> -possible to do the same thing via a hook, that is preferable
> +  Note that the problems are not due to advice per se, but to the act
> +of modifying a named function.  It is even more problematic to modify
> +a named function via lower-level primitives like @code{fset},
> +@code{defalias}, or @code{cl-letf}.  From that point of view, advice
> +is the better way to modify a named function because it keeps track of
> +the modifications, so they can be listed and undone.
> +
> +  Modifying a named function should be reserved for
> +the cases where you cannot modify Emacs' behavior in any other way.
> +If it is possible to do the same thing via a hook, that is preferable
>  (@pxref{Hooks}).  If you simply want to change what a particular key
>  does, it may be better to write a new command, and remap the old
>  command's key bindings to the new one (@pxref{Remapping Commands}).




This bug report was last modified 1 year and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.