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.bugs Subject: bug#24237: 24.5; (elisp)`Extended Menu Items', :filter warning Date: Sat, 12 Dec 2020 21:24:53 +0100 Message-ID: <87v9d67ox6.fsf@gnus.org> References: <6c4f5089-43fa-4ca1-a656-1ec1684df960@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26147"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 24237@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 12 22:31:01 2020 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 1koCTl-0006i5-ND for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Dec 2020 22:31:01 +0100 Original-Received: from localhost ([::1]:32994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koCTk-0003lC-PJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Dec 2020 16:31:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koBSs-0007pw-At for bug-gnu-emacs@gnu.org; Sat, 12 Dec 2020 15:26:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1koBSs-0005yF-3k for bug-gnu-emacs@gnu.org; Sat, 12 Dec 2020 15:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1koBSs-0001dB-0Y for bug-gnu-emacs@gnu.org; Sat, 12 Dec 2020 15:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Dec 2020 20:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24237 X-GNU-PR-Package: emacs Original-Received: via spool by 24237-submit@debbugs.gnu.org id=B24237.16078047066166 (code B ref 24237); Sat, 12 Dec 2020 20:26:01 +0000 Original-Received: (at 24237) by debbugs.gnu.org; 12 Dec 2020 20:25:06 +0000 Original-Received: from localhost ([127.0.0.1]:46794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koBRy-0001bL-56 for submit@debbugs.gnu.org; Sat, 12 Dec 2020 15:25:06 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:50858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koBRw-0001ah-NN for 24237@debbugs.gnu.org; Sat, 12 Dec 2020 15:25:05 -0500 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=wRrjsvDyGzIJaKooGaCMjH8GtwznnKf6gbKCFpeFXWY=; b=YaJ2EVeFe6/GH7yO1qyBYXoSWo 1auGNR8jpffNnB1qC85DZYK8GwkITYwHUI12+QsRH7j29S7bmEdqx2GQwkIyesS2TzrpRellHxZ+X sw3bngyHL2lgZU9AHt973sULDAFJ1v3+ytIFe1oLuh6RcuNaKYTg3T/je6DNk3EByQr0=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koBRm-0002Ig-9f; Sat, 12 Dec 2020 21:24:56 +0100 X-Now-Playing: Kiko Dinucci's _Rastilho_: "Febre do Rato" In-Reply-To: <6c4f5089-43fa-4ca1-a656-1ec1684df960@default> (Drew Adams's message of "Mon, 15 Aug 2016 11:06:31 -0700 (PDT)") 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" Xref: news.gmane.io gmane.emacs.bugs:195910 Archived-At: Drew Adams writes: > The doc for :filter says this about the FILTER-FN: > > Emacs can call this function at any time that it does redisplay or > operates on menu data structures, so you should write it so it can > safely be called at any time. > > Is this true in general, or only when the extended menu item is put on a > menu? > > A common idiom is to make use of a `menu-item' construct with a :filter > to create a conditional _keyboard_ key binding. In such a case, the > `menu-item' construct is not a real menu item - it is not placed on any > menu. > > I'm guessing that in such a case this doc paragraph does not apply. If > this guess is correct then please correct the paragraph, so that it says > something like "If an extended menu item that uses :filter is placed on > a menu then Emacs can call FILTER-FN when...". I think making the documentation more specific here serves no purpose. The statement as is should be true: You should always write these filter functions as if they are called at any time. > Also, is it really the case that FILTER-FN can be called anytime Emacs > does redisplay? Shouldn't the doc say only that it can be called > anytime Emacs "operates on menu data structures"? Does it get called by > redisplay other than when redisplay operates on menu data structures? > In the case mentioned above (binding to a keyboard key), would FILTER-FN > ever be called during redisplay? I'm guessing that it would not. I don't see why we should specify that at all. Closing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no