From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH Date: Mon, 04 Sep 2023 17:35:43 -0400 Message-ID: References: <83jztmro8z.fsf@gnu.org> <596919925b3ff290adc3@heytings.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35377"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65459@debbugs.gnu.org, Eli Zaretskii , Heime To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 04 23:36:17 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 1qdHF3-0008zh-HR for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Sep 2023 23:36:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdHEs-0006LS-6x; Mon, 04 Sep 2023 17:36: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 1qdHEo-0006FL-9U for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2023 17:36:03 -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 1qdHEo-0004c4-1I for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2023 17:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdHEn-0003al-LN for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2023 17:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Sep 2023 21:36:01 +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.169386335913799 (code B ref 65459); Mon, 04 Sep 2023 21:36:01 +0000 Original-Received: (at 65459) by debbugs.gnu.org; 4 Sep 2023 21:35:59 +0000 Original-Received: from localhost ([127.0.0.1]:52853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdHEl-0003aU-6X for submit@debbugs.gnu.org; Mon, 04 Sep 2023 17:35:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdHEi-0003aH-GQ for 65459@debbugs.gnu.org; Mon, 04 Sep 2023 17:35:58 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DBA3944452B; Mon, 4 Sep 2023 17:35:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1693863344; bh=ooa78AgcWmYHJucr5abnIZCQF+6gjOIRqGQxhkrzaMQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nzyDNgkMU82lvRdJO+fFttTPr6RD+oeSk8FdFP4TwK9ExYVKodihlnBhjjkKeGg6U kaFz4Wc9mVR+LujC6G8VK+K/xlCUstMUQMdOLVFhnmDCDiTvd9uy04t3O2S+YX1pAv RjDmIuPbidk0YMTqJV1bTK1GYaMuusc45i/DwS5b0EGE0fWWaKFggNIo31z3gKr0eA 5iyWSSGMF8/RTMtDaWWzA/go+0mMdT25Gz4wN+j+H+619sL1kHRXqplzIpjx0I512V qFYbtX+3H27lxCnKrrRc2+oktRRNyn5RHrlaxg5Fhv1GUnxbTP3pEWsnPDUks5Tkjb r/3NsDBb3r2qQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DB0434444F6; Mon, 4 Sep 2023 17:35:44 -0400 (EDT) Original-Received: from pastel (69-165-136-223.dsl.teksavvy.com [69.165.136.223]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 89BD51202AF; Mon, 4 Sep 2023 17:35:44 -0400 (EDT) In-Reply-To: <596919925b3ff290adc3@heytings.org> (Gregory Heytings's message of "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:269314 Archived-At: > Thanks, that clarifies that question! Perhaps a paragraph along those lines > could be added to "(elisp)Advising Functions"? What about the following? Stefan 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}).