From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: Current mode command discovery Date: Sat, 20 Feb 2021 14:55:39 +0300 Message-ID: References: <87v9aubm96.fsf@gnus.org> <87czwzfn9p.fsf@telefonica.net> <87eehfnd83.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35226"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: =?utf-8?B?w5NzY2Fy?= Fuentes , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 20 13:01:09 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 1lDQwe-00095o-HD for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Feb 2021 13:01:08 +0100 Original-Received: from localhost ([::1]:52514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDQwd-0005N0-6u for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Feb 2021 07:01:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDQvv-0004rC-BY for emacs-devel@gnu.org; Sat, 20 Feb 2021 07:00:23 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:58907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDQvr-00048G-Cc for emacs-devel@gnu.org; Sat, 20 Feb 2021 07:00:22 -0500 Original-Received: from localhost ([::ffff:41.210.155.197]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E1B8.000000006030F9CF.00003A40; Sat, 20 Feb 2021 05:00:15 -0700 Mail-Followup-To: Lars Ingebrigtsen , =?utf-8?B?w5NzY2Fy?= Fuentes , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <87eehfnd83.fsf@gnus.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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:265299 Archived-At: * Lars Ingebrigtsen [2021-02-17 14:33]: > Note: THIS IS NOT A DISCUSSION ABOUT M-X. > > Óscar 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? For your consideration, many of commands I program are useful globally but bound to specific keymap and mostly useful in specific mode. It is useful in that mode, it appears in the menu, but is also useful globally. If I wish to see all SMS messages sent and received, I may invoke such command in mode, on the line specific to person with some ID number like 123 would be SMS messages related to 123, but invoked globally I could see the latest messages list and simply respond or send new messages from there. Maybe consider advising package authors how to designate commands related to specific modes. My idea about that is that you invoke new variable automatically when defining the mode and that authors or users if not authors, can add function names in a list to that variable. That way some users can extend the package and simply add new functions to the same mode, so those functions would be appearing in that mode, even if outside of scope of the mode. Jean