From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50552: 28.0.50; Add context-menu-occur Date: Wed, 29 Sep 2021 10:19:29 +0300 Organization: LINKOV.NET Message-ID: <875yujc2kq.fsf@mail.linkov.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: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14473"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 50552@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 29 09:22:01 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 1mVTuj-0003Yj-Lg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 09:22:01 +0200 Original-Received: from localhost ([::1]:42366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVTuh-0007Um-Nh for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 03:21:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVTtt-0007MG-UO for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 03:21:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVTtm-0007Jp-7M for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 03:21:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVTtm-0000sy-3z for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 03:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Sep 2021 07:21: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.16329000313335 (code B ref 50552); Wed, 29 Sep 2021 07:21:02 +0000 Original-Received: (at 50552) by debbugs.gnu.org; 29 Sep 2021 07:20:31 +0000 Original-Received: from localhost ([127.0.0.1]:47664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVTtG-0000rj-MO for submit@debbugs.gnu.org; Wed, 29 Sep 2021 03:20:30 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:49097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVTtB-0000rD-FM for 50552@debbugs.gnu.org; Wed, 29 Sep 2021 03:20:26 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 8B9E8C000B; Wed, 29 Sep 2021 07:20:18 +0000 (UTC) In-Reply-To: <874ka4v5ae.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 28 Sep 2021 20:00:57 +0000") 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:215818 Archived-At: >>> 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). Might it make > more sense to autoload context-menu-dictionary and let the user manually > add it to context-menu-functions? Then we need to decide what is the preferred way for the users to add the dictionary menu item to the context menu. 1. One possible way is allow the user to customize context-menu-functions, and manually paste context-menu-dictionary to the entry field: INS DEL Choice: Value Menu Custom function: context-menu-dictionary 2. To allow using 'add-hook' in the user's init file with e.g. (add-hook 'context-menu-functions 'context-menu-dictionary 1) In either case, 'context-menu-dictionary' should be autoloaded like you suggested. So now I've changed dictionary.el according to this, thanks for the suggestion.