From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH Date: Thu, 31 Aug 2023 12:42:54 +0300 Message-ID: <83il8veee9.fsf@gnu.org> References: <83jztmro8z.fsf@gnu.org> <596919925b3ff290adc3@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65459@debbugs.gnu.org, heimeborgia@protonmail.com, monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 31 11:44:05 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 1qbeDd-000694-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 11:44:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbeDT-0006lY-UQ; Thu, 31 Aug 2023 05:43:55 -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 1qbeDS-0006l8-I2 for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 05:43:54 -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 1qbeDS-0007wk-9Q for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 05:43:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbeDa-000343-9s for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Aug 2023 09:44: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.169347500711725 (code B ref 65459); Thu, 31 Aug 2023 09:44:02 +0000 Original-Received: (at 65459) by debbugs.gnu.org; 31 Aug 2023 09:43:27 +0000 Original-Received: from localhost ([127.0.0.1]:54886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbeD1-000333-F5 for submit@debbugs.gnu.org; Thu, 31 Aug 2023 05:43:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbeCz-00032p-Dq for 65459@debbugs.gnu.org; Thu, 31 Aug 2023 05:43:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbeCm-0007sU-1x; Thu, 31 Aug 2023 05:43:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=HBHUpkFVKQB/sygCFr8UU7IjWNRqtpeZxc8hLRVT0Bc=; b=gpouuj5zyUTH Dql1pJhf1WTAfQvYJYupYHPW5hysybOUSOas2Y7l8qaPuk0bazg9Yi1lMpXnl/+bAcwp/ZteoaZLu YBE0vvluTQdVTPtBDO13veB+61YuIdIMcN/NIbYynNP9VGtmm2xagc9ILrmvX/TwNRvL8m43feOrC /ArGx1zptIknRIdRzsOmdyVvrZeVMeReyCRC7UnxU8Qng1SLL7xAuGtyyAoA58Qx2aC9WCjc+k1fW BWjfOZRE0rkESvedVA/tjGPbmMKYiABEKbjVhrFkvDNjIktCHPcHoo7OsBUrP/S/GudBZcW7fN6om l4u4LraSSWVVgP82/Br1mw==; In-Reply-To: <596919925b3ff290adc3@heytings.org> (message from Gregory Heytings on Sat, 26 Aug 2023 08:06:39 +0000) 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:268804 Archived-At: > Date: Sat, 26 Aug 2023 08:06:39 +0000 > From: Gregory Heytings > cc: Heime , Eli Zaretskii , > 65459@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.