From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH Date: Sat, 26 Aug 2023 08:06:39 +0000 Message-ID: <596919925b3ff290adc3@heytings.org> References: <83jztmro8z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39001"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65459@debbugs.gnu.org, Eli Zaretskii , Heime To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 26 10:07:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZoKJ-0009xC-0x for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Aug 2023 10:07:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZoK2-0005z9-Jb; Sat, 26 Aug 2023 04:07:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZoJt-0005xk-QJ for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 04:07:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZoJt-0005cm-0z for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 04:06:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZoJy-0004Al-1i for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 04:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Aug 2023 08:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65459 X-GNU-PR-Package: emacs Original-Received: via spool by 65459-submit@debbugs.gnu.org id=B65459.169303721016021 (code B ref 65459); Sat, 26 Aug 2023 08:07:02 +0000 Original-Received: (at 65459) by debbugs.gnu.org; 26 Aug 2023 08:06:50 +0000 Original-Received: from localhost ([127.0.0.1]:41693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZoJl-0004AL-PI for submit@debbugs.gnu.org; Sat, 26 Aug 2023 04:06:50 -0400 Original-Received: from heytings.org ([95.142.160.155]:54462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZoJi-0004AB-59 for 65459@debbugs.gnu.org; Sat, 26 Aug 2023 04:06:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1693037200; bh=OEFA508ChXmMWzd5UorcLU2JEdtAzSae7ekafrPFR0Y=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=tfzru8sT8a2SNIyfr3Th6T2Ku4Qfcb1rFTsLp9kMNaFhYDp7llBu9qR6nCWrbZfEw JF5r47iH0bpU4pjeYUc/y4akAMkfm3TEUAfF0N0r6kbHhNhM7/Uxw6UnIQHAKxcghf RiCUkkv2FamcK6mI1+YiPPRi87p6vSsybRi1mo9YFZzNKHytSRmfh3OF0rKRi22isv JWbGR0pwqyvK0i6CM1V9jb3GdaaekyKOIIDnBdCKEt8TAGbxNaTrb6EPrDeNRcOoFF 6f4V5AIGoG9zGExG3YRSo74/T/ujgJNlWgvCSOBGaeZYec+u+iUiVzXvOhgJak3ESD ltwq6iXspkbOg== In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268486 Archived-At: > > 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"?