From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#50552: 28.0.50; Add context-menu-occur Date: Fri, 01 Oct 2021 16:28:02 +0000 Message-ID: <87wnmwk8vh.fsf@posteo.net> References: <87ilz5d9a1.fsf@posteo.net> <87o88xu13p.fsf@mail.linkov.net> <87a6khd316.fsf@posteo.net> <8735q8g9dj.fsf@mail.linkov.net> <874ka4v5ae.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30615"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50552@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 01 18:29:13 2021 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 1mWLPN-0007hd-Aq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Oct 2021 18:29:13 +0200 Original-Received: from localhost ([::1]:37326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWLPL-0000dV-Gy for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Oct 2021 12:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWLPC-0000dD-JU for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 12:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWLPC-0002Bz-C6 for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 12:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWLPC-0002mc-79 for bug-gnu-emacs@gnu.org; Fri, 01 Oct 2021 12:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Oct 2021 16:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50552 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50552-submit@debbugs.gnu.org id=B50552.163310569210598 (code B ref 50552); Fri, 01 Oct 2021 16:29:02 +0000 Original-Received: (at 50552) by debbugs.gnu.org; 1 Oct 2021 16:28:12 +0000 Original-Received: from localhost ([127.0.0.1]:57210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWLOO-0002kl-66 for submit@debbugs.gnu.org; Fri, 01 Oct 2021 12:28:12 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:48235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWLOM-0002kT-3j for 50552@debbugs.gnu.org; Fri, 01 Oct 2021 12:28:11 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 72B6A240101 for <50552@debbugs.gnu.org>; Fri, 1 Oct 2021 18:28:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1633105683; bh=k9Y20NAkqR4794uXEHwVoK6MC+fz6cuYK+SNmeqw6Rc=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=XmHsoEeOhahoR5pw62qKWbdtJBIfJ8e2LR/+aBRxZEwjUK13rH0sZAQ3DWH5ZLl2n KXHdfAYA4nqw/yF0Es71hnpdvs2Dw13kgczL2C/pi5phaRupKFSNGkWkkLDZ7duA0O lUKGho3xUt9KTjjo33SdsC/WX2LWqooV4CZ+M3TaY0UM1YqfgoiFWZKqbJhyH6mbN6 hGWkgD6VP5B2K4IiNTC31dau6haBAunZ3+EAaft5c9rkpLuJnhUv8gGXKnAo7aCjso luHwqf7q5aXI/6v2B2nsGZa1WzG+0mx4qO4Iri5uB3stA9JgwFd4U4Ne4479vbtZiI ooskqSmzNXSqA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HLbBV5GqGz9rxQ; Fri, 1 Oct 2021 18:28:02 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <874ka4v5ae.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 28 Sep 2021 22:00:57 +0200") 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:216065 Archived-At: --=-=-= Content-Type: text/plain Philip Kaludercic writes: > Juri Linkov writes: > >>> I see, but I wonder why dictionary.el directly manipulates >>> context-menu-functions with add-hook. >> >> The reasoning was the following: by default, dictionary.el is not loaded, >> so its context menu item is not used. But when the user wants to use >> dictionary.el and explicitly loads it, then automatically provide also >> its context menu item. > > On this topic, I am not sure how good it is to do this > automatically. One effect seems to be that context-menu-dictionary > inserts itself at an unintended place in the menu (in my case as the > first item, even though I'd prefer it to be further down). It turns out the issue here is that context-menu-dictionary uses define-key instead of define-key-after. Here is a patch to fix it: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Insert-dictionary-context-menu-at-right-position.patch >From 375390ff1e8e6fff4a9675f7430721025b31cffe Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 1 Oct 2021 18:27:37 +0200 Subject: [PATCH] Insert dictionary context menu at right position * dictionary.el (context-menu-dictionary): Use define-key-after instead of define-key (bug#50552) --- lisp/net/dictionary.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 86447c2c35..258025fc51 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1382,8 +1382,8 @@ context-menu-dictionary the context menu will contain an item that searches the word at mouse click." (when (thing-at-mouse click 'word) - (define-key menu [dictionary-separator] menu-bar-separator) - (define-key menu [dictionary-search-word-at-mouse] + (define-key-after menu [dictionary-separator] menu-bar-separator) + (define-key-after menu [dictionary-search-word-at-mouse] '(menu-item "Dictionary Search" dictionary-search-word-at-mouse :help "Search the word at mouse click in dictionary"))) menu) -- 2.30.2 --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=--