From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Context menus and mouse-3 Date: Mon, 19 Jul 2021 21:59:43 +0200 Message-ID: References: <20200914061111.3trmuzhdvv7nwdcc@Ergus> <87y2acv2tw.fsf@mail.linkov.net> <83zguragqj.fsf@gnu.org> <87pmvnuyug.fsf@mail.linkov.net> <83zguq8n5o.fsf@gnu.org> <87im1dydhx.fsf@mail.linkov.net> <874kcw28zk.fsf@mail.linkov.net> <83lf686qqv.fsf@gnu.org> <87lf67fcvu.fsf@mail.linkov.net> <83lf6669dg.fsf@gnu.org> <87o8b2nkys.fsf@mail.linkov.net> <87zguii9gy.fsf@mail.linkov.net> Reply-To: Ergus Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----N07Y7XFU9EBOBTKL9D30SHJRX72MPH" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="885"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android Cc: philipk@posteo.net, rms@gnu.org, Tak Kunihiro , tkk@misasa.okayama-u.ac.jp, arthur.miller@live.com, dgutov@yandex.ru, ghe@sdf.org, Eli Zaretskii , drew.adams@oracle.com To: emacs-devel@gnu.org, Juri Linkov , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 19 22:01:43 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 1m5ZSR-000Ab3-HQ for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Jul 2021 22:01:43 +0200 Original-Received: from localhost ([::1]:58712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5ZSQ-0007EQ-EG for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Jul 2021 16:01:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5ZQl-00058Y-J0 for emacs-devel@gnu.org; Mon, 19 Jul 2021 15:59:59 -0400 Original-Received: from sonic308-2.consmr.mail.bf2.yahoo.com ([74.6.130.41]:33032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5ZQj-000514-N5 for emacs-devel@gnu.org; Mon, 19 Jul 2021 15:59:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1626724794; bh=+9kFNUFCiRpOPoVWHbuGqxVnP4oANM3o180r7Yd0Q9Q=; h=Date:In-Reply-To:References:Subject:To:CC:From:From:Subject:Reply-To; b=VyfuyC27Md9HOcse15On33w0RYcL/n43tXWt/uwBCRaIwBXR38k1s79qMe2i/FUNUolrz5INn18O81upO1xj1DaHKuNIdFhnLruWY8SA2zKs92VfrqPm0RnRgUsI8GlwJguAab6Ttl4A4pPpkYN8qvuWAaFbKG5HCvcolcZBkEnXXrM9mnEkFhdCDuq/ZBAsMMuPXTS5VAhEkQueEJUSVJTElFn6O/A0rQtiRijAebhf7VxPhKmZ0KnrvAU6xB7Ms8ZXVwBEdM14LBVKPKfH1JSLCqbnWtqn0KNbYVjUiudbAcUqDhMVKLhE/BbnwXIgh8ugIoY0pFy+cE7HdNqXQw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626724794; bh=7fltWDyF4BzQPQ8vaQAFzXAYvuQdr3i9fwe8TsPa5nY=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=ZGgLxavladV35/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P9K4 p_PcFniMJlzMXl.866qd8Rf2Zxm.yK7Y86rz9ijyXUNCdETgQp506mshWCmhmmFif1_MuvGaRSca mDZWVIOsJ8cjj3..GUIvokCKdl1Hh4Mhqe3x9rNwDT X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.bf2.yahoo.com with HTTP; Mon, 19 Jul 2021 19:59:54 +0000 Original-Received: by kubenode550.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID d73fcde042699ab648ce3c54f34cdabc; Mon, 19 Jul 2021 19:59:49 +0000 (UTC) In-Reply-To: <87zguii9gy.fsf@mail.linkov.net> X-Mailer: WebService/1.1.18469 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.130.41; envelope-from=spacibba@aol.com; helo=sonic308-2.consmr.mail.bf2.yahoo.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:271367 Archived-At: ------N07Y7XFU9EBOBTKL9D30SHJRX72MPH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Juri: is there anything to test, a scratch o feature branch? I am very intereste= d in this feature=2E On July 19, 2021 5:55:57 PM GMT+02:00, Juri Linkov wro= te: >>> The idea is to define a variable (something like below; >>> poplife-menu-candidates) with list of functions that returns nil or >>> keymap (something like below; poplife-mouse-word-menu)=2E A function >>> (something like below; poplife-context-menu) will test each of them >>> until it gets keymap=2E >> >> Note: such a variable should have a name that ends in `-hook` or >> `-functions` and should be manipulated with the usual hook functions, >> e=2Eg=2E `run-hook-wrapped`=2E >> >> Note also that the `context-menu-function` already mentioned offers >the >> same kind of functionality (except you need to use `add-function` >> instead of `add-hook` and it offers a bit more flexibility at the >cost >> of extra work)=2E > >For easier customization, 'context-menu-functions' could be more >hook-like, >so e=2Eg=2E when the default value will be defined as > > (defcustom context-menu-functions '(context-menu-region) > >then users could easily customize the default value=2E >More minor modes could add own functions to the global value, e=2Eg=2E > > (add-hook 'context-menu-functions 'bug-reference-context-menu -5) > (add-hook 'context-menu-functions 'goto-address-context-menu -10) > >Major modes could modify buffer-local values: > > (add-hook 'context-menu-functions 'dired-context-menu nil t) > (add-hook 'context-menu-functions 'info-context-menu -5 t) > (add-hook 'context-menu-functions 'dictionary-context-menu -10 t) > >Then the user could have the final say by using another option, e=2Eg=2E > > (defcustom context-menu-filter nil > >where a user-defined function (that can be extended using >`add-function`) >will accept a menu constructed by context-menu-functions >and return the modified menu with reordered/removed/added items >to user's liking=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E ------N07Y7XFU9EBOBTKL9D30SHJRX72MPH Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Juri:

is there anything to test, a scrat= ch o feature branch? I am very interested in this feature=2E

On July 19, 2021 5:55:57 PM GMT+02:00, Juri Linkov <= juri@linkov=2Enet> wrote:
The idea is to define a varia= ble (something like below;
poplife-menu-candidates) with list of functio= ns that returns nil or
keymap (something like below; poplife-mouse-word-= menu)=2E A function
(something like below; poplife-context-menu) will t= est each of them
until it gets keymap=2E

Note: such= a variable should have a name that ends in `-hook` or
`-functions` and= should be manipulated with the usual hook functions,
e=2Eg=2E `run-hoo= k-wrapped`=2E

Note also that the `context-menu-function` already me= ntioned offers the
same kind of functionality (except you need to use `= add-function`
instead of `add-hook` and it offers a bit more flexibilit= y at the cost
of extra work)=2E

For easier customiz= ation, 'context-menu-functions' could be more hook-like,
so e=2Eg=2E whe= n the default value will be defined as

(defcustom context-menu-fun= ctions '(context-menu-region)

then users could easily customize the = default value=2E
More minor modes could add own functions to the global = value, e=2Eg=2E

(add-hook 'context-menu-functions 'bug-reference-c= ontext-menu -5)
(add-hook 'context-menu-functions 'goto-address-contex= t-menu -10)

Major modes could modify buffer-local values:

(= add-hook 'context-menu-functions 'dired-context-menu nil t)
(add-hook = 'context-menu-functions 'info-context-menu -5 t)
(add-hook 'context-me= nu-functions 'dictionary-context-menu -10 t)

Then the user could hav= e the final say by using another option, e=2Eg=2E

(defcustom conte= xt-menu-filter nil

where a user-defined function (that can be extend= ed using `add-function`)
will accept a menu constructed by context-menu-= functions
and return the modified menu with reordered/removed/added item= s
to user's liking=2E


--
Sent fr= om my Android device with K-9 Mail=2E Please excuse my brevity=2E ------N07Y7XFU9EBOBTKL9D30SHJRX72MPH--