From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "H. Dieter Wilhelm" Newsgroups: gmane.emacs.bugs Subject: bug#60587: Patch for adding links to symbols' help documentation Date: Wed, 15 Feb 2023 23:18:17 +0100 Message-ID: <86leky609i.fsf@duenenhof-wilhelm.de> References: <86y1qgr1bf.fsf@duenenhof-wilhelm.de> <86tu13qydg.fsf@duenenhof-wilhelm.de> <83h6x2u74b.fsf@gnu.org> <863588rfos.fsf@duenenhof-wilhelm.de> <83o7qw0yjy.fsf@gnu.org> <864jskx6a8.fsf@duenenhof-wilhelm.de> <831qnomh6l.fsf@gnu.org> <86wn5anw04.fsf@duenenhof-wilhelm.de> <86h6wboe2v.fsf@duenenhof-wilhelm.de> <86edr59bua.fsf@duenenhof-wilhelm.de> <86mt5j87qz.fsf@duenenhof-wilhelm.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22479"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Juri Linkov , Eli Zaretskii , "60587@debbugs.gnu.org" <60587@debbugs.gnu.org>, Drew Adams To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 23:19:50 2023 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 1pSQ7y-0005eg-LB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 23:19:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSQ7E-0000iV-P0; Wed, 15 Feb 2023 17:19:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSQ7C-0000i8-Ox for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 17:19:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSQ7C-0002qq-Fr for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 17:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSQ7B-0007Uz-Vu for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 17:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "H. Dieter Wilhelm" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 22:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60587 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60587-submit@debbugs.gnu.org id=B60587.167649951728788 (code B ref 60587); Wed, 15 Feb 2023 22:19:01 +0000 Original-Received: (at 60587) by debbugs.gnu.org; 15 Feb 2023 22:18:37 +0000 Original-Received: from localhost ([127.0.0.1]:34351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSQ6m-0007UG-QG for submit@debbugs.gnu.org; Wed, 15 Feb 2023 17:18:37 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.130]:38513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSQ6j-0007U0-6H for 60587@debbugs.gnu.org; Wed, 15 Feb 2023 17:18:35 -0500 Original-Received: from ping ([109.250.145.221]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N1wdd-1oQRfu1dM1-012EoM; Wed, 15 Feb 2023 23:18:19 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 14 Feb 2023 15:56:37 -0500") X-Provags-ID: V03:K1:LJo2extrvY89DRjL0cN3OYBMqv5SRNke/RrWzzyfFwg8xxCoKJE uh5ikhBwkrbKoSoqTHyptTAlhKR7FH+UM2mk6wG4iqWcRdXdaYN46HoEd5fWh+vw3XKtgFH hHghLBXd1QGx2EPW1CcnUR7lx/M46Od3l7iwjk0Vaod+UZOrFl+RB44QzACZ5CyVHrvpnvu yo47kO6ReAauEo0MRsreQ== UI-OutboundReport: notjunk:1;M01:P0:lzJYcbpT6BQ=;jxABFcFsF0+/ot+aeCI1SN7dP17 P5rTFCbeaUW8HVAGiHHtZgIP5c4Z3E3NJQjZgaZKLV53o6/NL8yD6bhz07HAq0Sr4K7ucnRem UWy1beCXjCKKaCXSuzY43uCN5PiKMQafy2jk71W1cjbeCOjI9xvf1LOfFOD8FsN68sZTb6hZ5 WnmNISu+ZE45x6mqfntlkgknPlCEdN7bLUM1nggxmLdTAQlneiTz2RomBBGRQyR8DucQXZnJ5 CaTHfODpL+JrJy8kgZbyXzVo8esNlWiS6RkNN/PCEelhYpxj5JCt+G+EqLyr3hVru8c34FF5L QH/W0G0FaBKsD9Isrl3Lk69qTyE8HaceXRJqA94vQMnjQrZUU/nNLwfYboaej7ENbCD7Y8qnf x6pOEHLrueML2YEOqOBu//DAtipthnGdPfG5XCdbFCZR3nV7GXw6Jl4004osEUSDYFDg5MvGn 1m543Hs1tgjsOlh1chMYTEQfdyEodDiAogqvnnVaCupmSuVvHe65dUdzCFPEU7gDIUHmeKS6k CM6qQmybxMvawl/Zpk30cWKUX7K6fk8XoJb7jc+nAGCx74jkt8WGcfS/FXp7NTLFIF3GV6CkK 26ut6jRYdH2xdfWJQ0jbThiT/8gJkX1vYGd6POUhsy38xp2sKtL8m44EqAwkDtqVw4LVhLOrD Zuq8XILs3fBC5BJCQh2NumxRlvaSALhZ/vvzY/leKQ== 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255775 Archived-At: Stefan Monnier writes: >> +(define-minor-mode info-links-to-help-mode >> + "The mode creates buttons on symbols linking to their documentation string. >> +It shows their documentation in a *Help* buffers (in another >> +window) when typing or clicking `mouse-2' on the buttons. >> +These can be followed, as the regular Info manual references, >> +with \\[Info-next-reference] and \\[Info-prev-reference]. >> + >> +For details about which symbols are considered and the linking >> +process itself please see the function `info-make-links-to-help'." >> + :init-value nil >> + :lighter " Hlp" >> + :group 'info >> + :version "30.1" >> + (if info-links-to-help-mode >> + (progn >> + (if (eq major-mode 'Info-mode) >> + ;; we need this under Info-mode because of the narrowed >> + ;; Info file >> + (add-hook 'Info-selection-hook 'info-make-links-to-help)) >> + (info-make-links-to-help)) ;for the current buffer > > The above `define-minor-mode` still defines a buffer-local minor mode I thought a minor mode is necessary when 'info-make-links-to-help' is supposed to work for arbitrary major modes and buffers besides Info. > whereas the above `add-hook` is still global and hence affects all > buffers. I'm not sure I understand, it affects only Info buffers globally (eq major-mode 'Info-mode). Do you think it is better to use a global minor mode for all Info buffers and a separate buffer local mode for other buffers (and major modes)? > This is a recipe for inconsistent behavior. >> +;; Activate the mode for all Info buffers >> +(add-hook 'Info-mode-hook 'info-links-to-help-mode) > > Better add a call to `info-links-to-help-mode` directly inside > `Info-mode`. (Please tell me why are you quoting with two grave accents and not with apostrophes?) Do you think setting (defcustom Info-mode-hook '(turn-on-font-lock info-links-to-help-mode) "Hook run when activating Info Mode." :type 'hook :version "29.1") is a possible alternative to call it into 'Info-mode'? -- Thank you Dieter Best wishes H. Dieter Wilhelm Zwingenberg, Germany