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.bugs Subject: bug#52973: Adding a few context-menu-mode commands Date: Sat, 08 Jan 2022 21:10:41 +0200 Message-ID: <83r19i2gcu.fsf@gnu.org> References: <87o84tp69h.fsf@posteo.net> <868rvwsezi.fsf@mail.linkov.net> <87czl75lyz.fsf@posteo.net> <86czl6au29.fsf@mail.linkov.net> <874k6idjod.fsf@posteo.net> <86o84pthgp.fsf@mail.linkov.net> <87pmp4lmfz.fsf@posteo.net> <86pmp41vby.fsf@mail.linkov.net> <83czl47ghd.fsf@gnu.org> <86ee5kzjo2.fsf@mail.linkov.net> <83bl0o6oei.fsf@gnu.org> <87iluwkkyn.fsf@posteo.net> <83k0fc54bd.fsf@gnu.org> <86bl0m13o1.fsf@mail.linkov.net> <83v8yu2hkq.fsf@gnu.org> <875yqu59wl.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27322"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 52973@debbugs.gnu.org, juri@linkov.net To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 08 20:12:19 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 1n6H8U-0006uH-8i for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jan 2022 20:12:18 +0100 Original-Received: from localhost ([::1]:37036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6H8T-0006A2-6z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jan 2022 14:12:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6H8D-00067r-U7 for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 14:12:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6H8D-0004DM-LT for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 14:12:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n6H8D-0002lb-Gi for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 14:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jan 2022 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52973 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52973-submit@debbugs.gnu.org id=B52973.164166906910553 (code B ref 52973); Sat, 08 Jan 2022 19:12:01 +0000 Original-Received: (at 52973) by debbugs.gnu.org; 8 Jan 2022 19:11:09 +0000 Original-Received: from localhost ([127.0.0.1]:48727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6H7J-0002k6-My for submit@debbugs.gnu.org; Sat, 08 Jan 2022 14:11:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6H7F-0002jR-SZ for 52973@debbugs.gnu.org; Sat, 08 Jan 2022 14:11:05 -0500 Original-Received: from [2001:470:142:3::e] (port=37480 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6H7A-00046s-I8; Sat, 08 Jan 2022 14:10:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=abCp7nzV9nxpm7gMDbBYM3QNUc2+cFp4f6XjQpySxgI=; b=I0Stn5HmKaHJ BkU/LfdYOZ+KvOGBdRL8NiiiSv8Os+07Hn+VkWcnhj3HR4SwJhOri4HB/wjyCus6+RKjJZhRVT6/y PHh+bPHP70OJsjtmhlKgcwhLbq86Ka8/nofU9LdcWABnRRbPBep/gdrHYatz9Uj/2K/dBxlD2ZcBl YxT4aTvloH2kWmQReYwzxO6GDRsZ7ldkZjX9IgJMLEDubvfm7PY1Q3Oo7zdQk4QZ/lD9QnwS74oDa L+w0Le6Qowng8qXwJU8gtzZ9reLS9Ak7VTWQxEE8iqlFdZzqQYEkjv947o5Lko6PoOKRNlRuo3Nhh Pt9A2dcIBCV9NTDTo3kKwQ==; Original-Received: from [87.69.77.57] (port=2583 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 1n6H7A-0007qT-Gx; Sat, 08 Jan 2022 14:10:56 -0500 In-Reply-To: <875yqu59wl.fsf@posteo.net> (message from Philip Kaludercic on Sat, 08 Jan 2022 19:01:46 +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:223823 Archived-At: > From: Philip Kaludercic > Cc: Juri Linkov , larsi@gnus.org, 52973@debbugs.gnu.org > Date: Sat, 08 Jan 2022 19:01:46 +0000 > > > The way I see it, the functions in man.el are for Man-mode, and those > > in hi-lock.el are for hi-lock-mode. > > No, the Man functions can be used anywhere you want to read a man page. > It checks if the user clicked on something like "emacs(1)", then inserts > a entry into the context menu to open the man page at point. So it will suggest to show a man page when text like this one from the ELisp manual is displayed: To conserve memory, Emacs does not hold fixed-length 22-bit numbers that are codepoints of text characters within buffers and strings. Rather, Emacs uses a variable-length internal representation of characters, that stores each character as a sequence of 1 to 5 8-bit bytes, depending on the magnitude of its codepoint(1). When the user displays a man page, the probability that "foo(1)" references a man page is very high. In any other major mode, it is likely to be a false positive. For example, it could be an array reference in Fortran or Matlab, or a function call in C or C++. I fail to see how this kind of guesswork can be a good idea if it mostly fails. > The hi-lock functions can be used to highlight a symbol, just like with > `M-s h .'. Requiring hi-lock-mode to be enabled beforehand would be > counterproductive. Why is it counterproductive, if you are going to activate it anyway, the first time the user clicks? > >> When the global value of context-menu-functions > >> contains one of the proposed functions, right-clicking anywhere > >> will autoload every package where such context functions are defined. > > > > This is over-engineered, IMO. There should be no need for such > > complexity. > > What would you suggest to simplify this? See above.