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: Current mode command discovery Date: Wed, 17 Feb 2021 12:30:20 +0100 Message-ID: <87eehfnd83.fsf@gnus.org> References: <87v9aubm96.fsf@gnus.org> <87czwzfn9p.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12894"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 17 12:33:16 2021 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 1lCL52-0003FM-H7 for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 12:33:16 +0100 Original-Received: from localhost ([::1]:36860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCL51-0004Ry-HP for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 06:33:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCL2X-0002R8-8U for emacs-devel@gnu.org; Wed, 17 Feb 2021 06:30:44 -0500 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:53002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCL2R-0002mp-6X for emacs-devel@gnu.org; Wed, 17 Feb 2021 06:30:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=UkuA8eVZLSXOWW1n1hW/72hCQpfWlKZ1hNnn+npIldo=; b=p4JCLSvVtS1hN+NJ/sWMmgIMp0 ChunnM4EWbImXzOBwuEL3ZI8eHEqwonpqjjSCw+KAkI3chsBYMbsBAiiYatYpduOr4QTfMIcsgptq sPUGMgwqxofBiJDni+BHD2sVg09JJTpKjA0xvVz8ZjkClrTOIvaxfS8clrMvwk1gGog0=; 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 1lCL2D-00080b-Rv; Wed, 17 Feb 2021 12:30:31 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXnMS/ezMskIyL/ //9xWUGBAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+UCEQsBIUEfjfUAAAF3SURBVCjPVZI9btwwFISH gN7WMrBS4QOkyCnowoU7BRAFmHVsxDxKqi2WKtQFEBfgnNLD3TXgsBDwke9v3ggADmQJ7eB/OMIJ zI5ugLcrwAYMmByQYkFn/YAzJqRN0PWGgh6PygmzPaP6rkGwsWRwMhz+lt6G9wLuzh9Y+s7eX8CK 3jE/wNZXrPRHl4PhWVB46lybZRk/0LoPiYJFBdbqQ2TWm0pX/irxNrbCYma6fMF6Ud4XlI15266Q yC298QaB/EhVpRq4IGBezoBkuhB39dyvAFtWvv24AxYycR/8HdbE2TVwk4qtnFuYDT6WPyzzPSfm 3xp0usGDomrMcwM1etXskiQIktOKM0Oay0+ypqg9mT66LbEIFl6qwuaRsTaluyK96bLt4OTC8iSV gpq8S5wwNmB9ko+n3hpsVaamc4dUUdPeHZh2h7HiH0/HBrK94kLfj0xFPsuF6qdHVdHPMUCOoIF8 NnkqdZraN6U8oa1YXQXh2/kE/iLNvgC4UGcAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDItMTdU MTE6MDE6MzMrMDA6MDAFY3lGAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTAyLTE3VDExOjAxOjMz KzAwOjAwdD7B+gAAAABJRU5ErkJggg== X-Now-Playing: 11-Sivuca's _Brazil USA 70_: "Ain't No Sunshine.flac" In-Reply-To: <87czwzfn9p.fsf@telefonica.net> (=?utf-8?Q?=22=C3=93scar?= Fuentes"'s message of "Wed, 17 Feb 2021 03:20:34 +0100") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:264992 Archived-At: Note: THIS IS NOT A DISCUSSION ABOUT M-X. =C3=93scar Fuentes writes: > That would be very interesting, but AFAIU with the current > implementation it has some problems. > > It would miss some candidates which belong to the current mode although > they are not marked as mode-specific because they are also applicable to > other contexts. This would be confusing for the user. > > So we need a mechanism for saying `foo-bar-command' belongs to > `foo-mode', but it is not specific of that mode. Yes, that's a problem. Hm... there's two obvious sources if information about what commands "belong" to a mode: There's the key bindings, and then there's the new mode tagging. We could perhaps use both in this new command? I.e., if somebody has gone to the trouble to add a command to the keymap of the mode, then it's probably pretty useful for that mode? A more serious problem that this brings up is the problem with non-mode-specific predicates: They don't convey any information about why the predicate is t/nil. Say you have (defun foo-spiffy-command () (declare (predicate my-clever-predicate-p)) (interactive)) When listing mode-specific commands, and this predicate returns t, should it be included? Yes? No? There's no way of saying, really... So: Tagging by mode conveys more information to the system than just having predicates, and we can use that. This also means that (declare (modes ...)) should be implemented differently than it is today (which is just slapping a predicate onto the symbol-plist). --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no