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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 65459 <at> debbugs.gnu.org, heimeborgia <at> protonmail.com, monnier <at> iro.umontreal.ca
Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH
Date: Thu, 31 Aug 2023 12:42:54 +0300
> Date: Sat, 26 Aug 2023 08:06:39 +0000
> From: Gregory Heytings <gregory <at> heytings.org>
> cc: Heime <heimeborgia <at> protonmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 
>     65459 <at> debbugs.gnu.org
> 
> 
> >
> > The issue is not "don't use `(n)advice.el`", but "don't modify functions 
> > on the sly".  And by "functions" this refers to those things stored in 
> > the `symbol-function` slot of symbols in the global obarray.  This is 
> > because code that does `(my-foo ...)` usually expects to execute the 
> > code found in `(defun my-foo ...)` and not something else, and readers 
> > of that code often make the same assumption, so it can make debugging 
> > really nasty.
> >
> > Changing a function with `fset` (or `cl-letf` or `defalias`) is worse 
> > than using `advice-add`, for that reason: at least `advice-add` sets up 
> > the help system such that `C-h f` will (hopefully) warn you about the 
> > presence of an advice.
> >
> > For variables containing functions (such as 
> > `minibuffer-default-add-function`), there is no such expectation that 
> > calling this function will run some known piece of code, on the 
> > contrary: the whole point of the variable is to run difference pieces of 
> > code in different contexts, so modifying the function is perfectly OK, 
> > regardless whether you do it with `setq` or `add-function`.  Here I'd 
> > use `add-function` because it's simpler.
> >
> 
> Thanks, that clarifies that question!  Perhaps a paragraph along those 
> lines could be added to "(elisp)Advising Functions"?

Feel free to suggest a clarification for the manual, and thanks in
advance.




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.