From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60587: Patch for adding links to symbols' help documentation Date: Tue, 14 Feb 2023 15:56:37 -0500 Message-ID: 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> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13263"; 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: "H. Dieter Wilhelm" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 14 21:57:23 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 1pS2Mb-0003Fn-OT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Feb 2023 21:57:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS2ML-00088n-7I; Tue, 14 Feb 2023 15:57:05 -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 1pS2MJ-00088M-Ay for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 15:57:03 -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 1pS2MJ-0001UB-2J for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 15:57:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pS2MI-0003cI-HB for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 15:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2023 20:57:02 +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.167640820713881 (code B ref 60587); Tue, 14 Feb 2023 20:57:02 +0000 Original-Received: (at 60587) by debbugs.gnu.org; 14 Feb 2023 20:56:47 +0000 Original-Received: from localhost ([127.0.0.1]:57143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS2M3-0003bp-CR for submit@debbugs.gnu.org; Tue, 14 Feb 2023 15:56:47 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS2M1-0003bZ-P4 for 60587@debbugs.gnu.org; Tue, 14 Feb 2023 15:56:46 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2B26E442720; Tue, 14 Feb 2023 15:56:40 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AC25C44271E; Tue, 14 Feb 2023 15:56:38 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1676408198; bh=E42AfksQsW57tRtOctcnQ8OMObS9IZMnzQMtHWSZdJk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=E8sHRAJ+jo7YwsoAXk/k8YHpQ9X8i3315c4Od9dQhJXqeK+7oJFMNWzyhYkl1CAMb 2q8KPpnJt6TsDLwEOo6qSprFXxT0ExBRHjyVy5ArWRjsforNPSqiTzfJdanqZN0zan 6vqCRpE8Q7cqN2rgEraATVVG7w1ZW0+kBp7jIr8r8ejqLALRs6+YiDXcgDZcXLicPE T/qDiZvn7XbOuN1DhhEi9MdDSh0W3yw5QHIna5ZYD/8Nr2GAokc4mPHPHus1mhXKsm Mv+pYAo0IlJkrxy2sZH35d25RyX9F0i4TUqmlWI5c+7kuba7bk4sskUaH/RDdPx2ZO AmIwrGjt7Nmkg== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 87FAB12312E; Tue, 14 Feb 2023 15:56:38 -0500 (EST) In-Reply-To: <86mt5j87qz.fsf@duenenhof-wilhelm.de> (H. Dieter Wilhelm's message of "Sun, 12 Feb 2023 12:04:36 +0100") 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:255634 Archived-At: > +(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 (eq major-mode 'Info-mode) > + (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 whereas the above `add-hook` is still global and hence affects all buffers. 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`. Stefan