From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Context menus and mouse-3 Date: Mon, 12 Jul 2021 14:55:48 +0300 Message-ID: <83zguragqj.fsf@gnu.org> References: <20200914061111.3trmuzhdvv7nwdcc@Ergus> <87y2acv2tw.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39080"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, rms@gnu.org, spacibba@aol.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, arthur.miller@live.com, dgutov@yandex.ru, ghe@sdf.org, drew.adams@oracle.com To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 12 14:01:33 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 1m2uct-0009zH-GJ for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Jul 2021 14:01:31 +0200 Original-Received: from localhost ([::1]:56754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2ucs-0004b3-H9 for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Jul 2021 08:01:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2uXl-0004Kw-2y for emacs-devel@gnu.org; Mon, 12 Jul 2021 07:56:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48086) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2uXi-0006qA-0S; Mon, 12 Jul 2021 07:56:10 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4764 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2uXW-0008Q9-C8; Mon, 12 Jul 2021 07:55:58 -0400 In-Reply-To: <87y2acv2tw.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 12 Jul 2021 02:38:19 +0300) 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:271184 Archived-At: > From: Juri Linkov > Date: Mon, 12 Jul 2021 02:38:19 +0300 > Cc: philipk@posteo.net, Richard Stallman , spacibba@aol.com, > emacs-devel@gnu.org, arthur.miller@live.com, dgutov@yandex.ru, ghe@sdf.org, > drew.adams@oracle.com > > >> > We don't need to choose, since we can get a context menu on > >> > `down-mouse-3` and 'mouse-save-then-kill' on `mouse-3`. > > > > (defun mouse-maybe-context-menu (event) > > "Bring up a context menu for a long click. > > See `mouse-long-click-time' and `mouse-context-menu-function'." > > (interactive "@e") > > (if (let ((track-mouse t)) (sit-for (/ mouse-long-click-time 1000.0))) > > (push (cons 'context-menu (cdr event)) unread-command-events))) > > > > It's not good enough for `master` (IIRC the sit-for tends to return nil > > immediately in some circumstances), but I didn't pursue this any further > > given the lack of interest at the time. I can't think of any reason why > > it should be hard to fix. > > This is a much needed feature and it would nice to finish it one way or another. > I tried to use timers, and the result works well in all test cases: Could you please remind us the problem you are trying to solve here? Thanks.