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: Fri, 27 Jan 2023 22:35:52 +0100 Message-ID: <86h6wboe2v.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22972"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , "60587@debbugs.gnu.org" <60587@debbugs.gnu.org>, "monnier@iro.umontreal.ca" To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 27 22:37:17 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 1pLWPN-0005iE-CC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Jan 2023 22:37:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLWPA-0002nl-Qn; Fri, 27 Jan 2023 16:37: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 1pLWP8-0002nO-MF for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 16:37: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 1pLWP8-0002fj-EQ for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 16:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLWP8-00085D-8A for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 16:37:02 -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: Fri, 27 Jan 2023 21:37: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.167485537131011 (code B ref 60587); Fri, 27 Jan 2023 21:37:02 +0000 Original-Received: (at 60587) by debbugs.gnu.org; 27 Jan 2023 21:36:11 +0000 Original-Received: from localhost ([127.0.0.1]:38781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLWOJ-000847-1f for submit@debbugs.gnu.org; Fri, 27 Jan 2023 16:36:11 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.134]:36045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLWOE-00083a-V0 for 60587@debbugs.gnu.org; Fri, 27 Jan 2023 16:36:09 -0500 Original-Received: from ping ([109.250.147.186]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N9L64-1oY9HR3z4W-015FFF; Fri, 27 Jan 2023 22:35:54 +0100 In-Reply-To: (Drew Adams's message of "Wed, 25 Jan 2023 22:24:24 +0000") X-Provags-ID: V03:K1:0NDkRelIT8zLMM+aJOVXy7lEbk+A0osZymdlYX1X0kQCWY5FJ8h zu54korAa8WoIUM2ZKwlGYq6qPucb+PEU2rRtgbee9/PV5vdBMgIgWGNR/o4MFMj3j4UCBu 8wviyyr6FHJUELGEG3cjxz3M2NIAEXXp2ax9Ek/UQp59MxOcNCwOgsAbgJKqY5LsKwrnFwe uJRD8/Wlq6+6224HFBwkQ== UI-OutboundReport: notjunk:1;M01:P0:ZMYsa6MBIZQ=;e2lT1EAbn7qSBxSK5X5nM7mhLbt rSOFAsH93u5nsD1WLPLxbiPTk4AMlHUywWHkkwqFeDjaHyqTSBEjfiVv/tKU568bI+sGZolVS QoyKHsSiuZTBEwKCeGWmSrTnrATnBKzFkC2gVTus7gT+L5+b5uPlrP0RATmfeNTXorrbZjfWp HatHdqeHtQPEuAHkOrlBYzMtkLIyN3x766jUTFBOiWfnfLnbpqcHG5a4VTJ1CFadsXwPF9G4B iX+dlB2DBqFeaSOO4wfhqbDT1ivKJwSQj0SutXdPQa8OU8C2l+dUk+fPiRFbTZsul912v1UAr OriMDi0+MRxlyW9J67Sapz8Kg3e5ijs7ir/oeJEFy+JlfzHRduKZl1f7qsyhqv6khnA3hRnWd FeK0XgZIBKkvETgMxXotKB+/Ug0QWUU7hP74l5WTw8sj3SzZQHg0TlCRIh4uFhDGxIqSYbGB8 BPXfmOeL7H1u0gwLY8Ecbu2Vcno/52wq7KiThxPj2t9J8Sc58Th79NWA0ysnC+cMu4mi+cjfb rjULBzh1GKfoIDiXM+Bj0Au5T8dSig36w4fWVqhepe/CwJJEWbKbB+dUuWYqsVCsWwh3sceyo 0qCnBa57yIDkhgKokv1B/2BzyxPWfaSxJS8eZRDHlpn/WVM+3yts5BRUyCTxD86kwVag4vbDK rp9fhXK6O/fSJO2Xey8HkqfqF8FxFrbGRg9s3553iQ== 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:254277 Archived-At: Hi Drew Thank you for your ideas! Drew Adams writes: > 1. > + :type '(choice (const :tag "Create links" t) > + (const :tag "Do not link" nil)) > > is better as just :type 'boolean, and say in the > doc which Boolean value means which behavior. The doc string says now: "True (`t') means Emacs creates symbol link buttons in Info. Setting this variable to `nil' inhibits the creation of buttons on quoted symbols to their help strings. Please see the function `info-make-xrefs' for further details." > 2. > +;; Toggle on or off the linking to help documents > +(when info-make-xref-flag > + (add-hook 'Info-selection-hook 'info-make-xrefs)) Yes, the above is rather crude. > Instead of putting it on the hook when loading the > code, add/remove it in a :set function. E.g. > (untested): > > :set (lambda (sym defs) > (custom-set-default sym defs) > (let ((fun (if info-make-xref-flag > #'add-hook > #'remove-hook))) > (funcall fun 'Info-selection-hook > 'info-make-xrefs))) It works nicely and I put this setter in `info-make-xref-flag'. :-) > 3. Maybe add a toggle command for the option, so users can switch the > behavior anytime, on the fly. Like this? ;; TODO: add this toggle in info documentation and NEWS ;; TODO: remove and create buttons in current info buffer (defun info-toggle-make-xrefs () "Toggle creating Info buttons." (interactive) (if (memq 'info-make-xrefs Info-selection-hook) (remove-hook 'Info-selection-hook 'info-make-xrefs) (add-hook 'Info-selection-hook 'info-make-xrefs) (message "Create Info link buttons to symbol names."))) > 4. Or instead of having an option, maybe just have > a minor mode. That's also a nice idea. (Maybe for later.) > 5. Face `info-color' should be named something like > `info-symbol-help-link'. You're right, `info-color' is too minimalist and not describing what the object represents. (I dropped it completely because I realised an additional face is redundant since Info distinguishes (slightly) quoted symbols from the text, anyway.) > 6. "clicking @kbd{mouse-2} or @kbd{mouse-1} on it" > can't be right, I think. At least that doesn't > express what `mouse-1-follows-link' does/means. Do you mean that I should just say mouse-2, because `mouse-1-click-follows-link' regulates it anyhow? (E.g. I realised that Emacs changes my documentation string for the tooltips 'help-echo (purecopy "mouse-2, RET: describe this variable")) from mouse-2 to mouse-1!) > 7. Again, I think it's unhelpful to call these > links "buttons". Especially since Info docs call > Info links "links". That these links show their > destination in another window isn't a reason to > call them something different (and with no > definition of the additional term "button"). To make the confusion complete: Info documentations calls (Info) links also cross-references. ;-) (info "(info)Help-Xref") Thanks again Dieter -- Best wishes H. Dieter Wilhelm Zwingenberg, Germany