From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master 49e06183f5 1/3: Allow REQUIRE-MATCH to be a function Date: Sat, 11 Jun 2022 18:11:58 +0200 Message-ID: <874k0rqiwh.fsf@gnus.org> References: <165484935985.12525.14065631018362412932@vcs2.savannah.gnu.org> <20220610082240.A7222C01683@vcs2.savannah.gnu.org> <87pmjfsc1v.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32021"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Daniel Mendler To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 11 18:13:01 2022 Return-path: Envelope-to: ged-emacs-devel@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 1o03jR-00087p-N2 for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Jun 2022 18:13:01 +0200 Original-Received: from localhost ([::1]:47782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o03jP-00068G-0n for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Jun 2022 12:13:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o03iZ-0005Aw-Sq for emacs-devel@gnu.org; Sat, 11 Jun 2022 12:12:07 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:35834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o03iY-0000DI-CX for emacs-devel@gnu.org; Sat, 11 Jun 2022 12:12:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jacFp+FwkjarKWZCNHJHjplZDOEn4raiU4Y7DS7RRY4=; b=C0NCeAHd6ghOCB9RYTTXzr2Ntr Vqz3xNC4w9D067mf0JNN0DdHkCq2R4rgaH4PS31p35XBq9DWWVlZeaDR+i4jpwv6JAcBPlzFEDM7h hPswXGR24aclFA72egLG5p6DrOJOkAj1jODarus1JtBxPr7N/c3Lx13TOU42XPrjNzSk=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o03iS-0002n8-DG; Sat, 11 Jun 2022 18:12:02 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEW/q6Ll3NpmV1OV cFvGlWhMOzb///8hgvjEAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+YGCw8lOegiP0wAAAGtSURBVDjL fdJBl6MgDADgUNy77MzeXSh3K/aua+Y+Lzb//69sAjjVaTu8p6KfSSAKxuVhWp1AuXFyAxWE5PAb uG8Q3NcAtx/313ZgSu7nEe4lXO7Fj/D3WYSm6Z6tY7dD8wDmMaLdR7xMdQDzY/FgXsH8BHQ0l0do tTD2j9BMgjgeQV5u+2Tc+4QHaOX8ux8uDmeszS0Acj711jucFl3eBgC9cdehiTfExdTtZ7A9OA79 sC5o55IpgxV4IwpNTOMd5GpTB3+YyXzQ2OwiBAL8YubR+jHvZoNUIQwBM5gKg/dwlVT0sSJ+gz5K BKc1TftUfgNag/akdAkyBM4j0FezKvgCJNAegeSxppub+mNXiBRLzK0xFYzJsCWLOMMeqByR/p1h i4BcQ+srWIKp1gArq40aImVo4RGn8vHgFDsnz3wssI6oHYYkr8qH5bJcf+V4XqZWAiT3pwEYfN5f iuxXnCQPyL3XKww6Q+Y1IhYg7opEJlG6jgIWcot6mSVZhdZZ+QyYEuicvMakzpJpbYw3aCSIpUtr /ARtWt70iWkCKS8lFPRff8u/eksc5Pl/vByDkiLkOvgAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjIt MDYtMTFUMTU6Mzc6NTcrMDA6MDDgh+FEAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA2LTExVDE1 OjM3OjU3KzAwOjAwkdpZ+AAAAABJRU5ErkJggg== X-Now-Playing: Drew McDowall's _Agalma_: "Agalma I (Folding)" In-Reply-To: (Stefan Monnier's message of "Sat, 11 Jun 2022 11:03:24 -0400") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291039 Archived-At: Stefan Monnier writes: >>> I see that the `minibuffer-completion-confirm` function completely >>> replaces the usual handling of require-match (i.e. the attempt to fix >>> the case and the prompting for confirmation). >> (You probably noticed it, but in case not -- I didn't change that code, >> I just changed the indentation.) > > What I meant was that the branch you added to the `cond` overrides the > rest of the `cond` (the part you reindented). Ah, yes, that's true. But REQUIRE-MATCH can't both be a function and `confirm' at the same time, and adding a new parameter for this use case seemed a bit overboard. (And the function can implement its own confirm-ish action if it wants that.) > Understanding the subtleties can be difficult, but a good general rule > I try to follow in such cases is to provide a function that the new > function-hook can use to get back the old behavior. > > IOW, arrange your code such that the user can provide a function > `mimic-t` where the resulting behavior is identical to providing `t` > (and same thing for the other supported values). > AFAICT it's currently virtually impossible (at least not without inside > knowledge of how the minibuffer.el code is written). But is that useful? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no