From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: carlmarcos--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56258: Changing major-mode with mouse event Date: Wed, 29 Jun 2022 01:17:41 +0200 (CEST) Message-ID: References: <87czetq7ef.fsf@gnus.org-N5eMbXh----2> Reply-To: carlmarcos@tutanota.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_814163_1424050223.1656458261198" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31738"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Phil Sainty , 56258@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 29 01:18:10 2022 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 1o6KTC-00085f-7f for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 01:18:10 +0200 Original-Received: from localhost ([::1]:33852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6KTB-0005LF-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 19:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6KT4-0005Ig-HV for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 19:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6KT3-0000Tm-T3 for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 19:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6KT3-000554-Mc for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 19:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: carlmarcos@tutanota.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jun 2022 23:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56258 X-GNU-PR-Package: emacs Original-Received: via spool by 56258-submit@debbugs.gnu.org id=B56258.165645827319515 (code B ref 56258); Tue, 28 Jun 2022 23:18:01 +0000 Original-Received: (at 56258) by debbugs.gnu.org; 28 Jun 2022 23:17:53 +0000 Original-Received: from localhost ([127.0.0.1]:56621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6KSr-00054d-MX for submit@debbugs.gnu.org; Tue, 28 Jun 2022 19:17:53 -0400 Original-Received: from w1.tutanota.de ([81.3.6.162]:51490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6KSo-00054Q-Tk for 56258@debbugs.gnu.org; Tue, 28 Jun 2022 19:17:47 -0400 Original-Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id 3443CFBF604; Tue, 28 Jun 2022 23:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1656458261; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=I5mrfT4/wmT4h8qzkI1+InepTfS7JD/2F+l4YDRGq4k=; b=WAiBoSiliDiIbPwQrLULtvwJUzqq+YkjAX0CXIaf1yDQJMjeib+FT5RdF5Zv0Ep5 0/h9Uql3HqgyHIZW3nYkD4mYPYNl4VSHI8CBOm5NB1o5wgXXq2UttX3wX9cj4WxHG79 bdyE1VAKeUDXbtBRqy5wwWi8AEgX+ndVeiZTlK2ToGJEkMoMP2LtDfu4s/x/KXjidD0 gMTm47201UkusMufwAEIiuXAnT7sbdej5uejFp/KN5wOodfcJqKKjP4GOxzTCNc1JQ0 tqpeYTgXD1FuY4hAkCKjw+y6G8nwSVUiQLeb/TarmHsNp1pBu+mlRPGKgrMVhh/pcWl WQj/xnpYoA== In-Reply-To: <87czetq7ef.fsf@gnus.org-N5eMbXh----2> 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:235578 Archived-At: ------=_Part_814163_1424050223.1656458261198 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Jun 28, 2022, 12:50 by larsi@gnus.org: > Phil Sainty writes: > >> Major modes would need to be identifiable as such in order to >> provide the menu you propose, and I don't believe there's a reliable >> way to do that at present for all major modes. >> >> We can identify major modes defined with `define-derived-mode' >> however, as all such modes have a `derived-mode-parent' property; >> and that does cover the majority. >> > > Yes, it should be possible to provide a command to allow you to choose > between modes. But I think having something like that callable from the > mode line would be of limited value, but perhaps not? The reason is > that we just have So Many Modes -- over 500, at least, so discovering > modes via a menu would be cumbersome. > You would know more about how best to approach this.=C2=A0 Perhaps some for= m of completion could help.=C2=A0 Have you reflected on categorising the mode= s, organised in ways that makes the process of going through them quicker? >> p.s. Tangentially, I think it would be good if all symbols for both >> major and minor modes had (or rather, were expected to have) symbol >> properties to explicitly identify which type of mode they are, >> including differentiation between the various minor mode types >> (buffer-local, global, and 'globalized' pairings), as I think there >> would be other uses for being able to query the available modes. >> > > Yes, that might be nice if you want to explore "what are the major > modes I can possibly use here?". > > We almost kinda sorta have that. All minor modes should be defined via > define-minor-mode now, and that updates the global-minor-modes and > local-minor-mode variables. So all mode functions that aren't there are > major modes, so we could use heuristics to get us pretty far (along with > `derived-mode-parent'). > > However, we do have functions that end with -mode that aren't modes. > > --=20 > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > ------=_Part_814163_1424050223.1656458261198 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Jun 28, 2022, 12:50 by larsi@gnus.org:
Phil Sainty <psainty@orcon.net.n= z> writes:
Major modes would need to be identi= fiable as such in order to
provide the menu you propose, and = I don't believe there's a reliable
way to do that at present = for all major modes.

We can identify major mod= es defined with `define-derived-mode'
however, as all such mo= des have a `derived-mode-parent' property;
and that does cove= r the majority.

Yes, it should be= possible to provide a command to allow you to choose
between= modes. But I think having something like that callable from the
=
mode line would be of limited value, but perhaps not? The reason is
that we just have So Many Modes -- over 500, at least, so disc= overing
modes via a menu would be cumbersome.
You would know more about how best to approach thi= s.  Perhaps some form
of completion could h= elp.  Have you reflected on categorising the modes,
organised in ways that makes the process of going through them qu= icker?
= p.s. Tangentially, I think it would be good if all symbols for both
major and minor modes had (or rather, were expected to have) symbol<= br>
properties to explicitly identify which type of mode they are= ,
including differentiation between the various minor mode ty= pes
(buffer-local, global, and 'globalized' pairings), as I t= hink there
would be other uses for being able to query the av= ailable modes.

Yes, that might be= nice if you want to explore "what are the major
modes I can = possibly use here?".

We almost kinda sorta hav= e that. All minor modes should be defined via
define-minor-m= ode now, and that updates the global-minor-modes and
local-mi= nor-mode variables. So all mode functions that aren't there are
<= div>major modes, so we could use heuristics to get us pretty far (along wit= h
`derived-mode-parent').

Howeve= r, we do have functions that end with -mode that aren't modes.

--
(domestic pets only, the antidote for ov= erdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
<= /div>

------=_Part_814163_1424050223.1656458261198--