From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#36767: 26.1; request: add more quick keys to the *Help* buffer Date: Thu, 23 Sep 2021 22:52:59 +0200 Message-ID: <87wnn7xbdg.fsf@gnus.org> References: <87mtrrq7t7.fsf@gnus.org> <87pmt0qomh.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22627"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 36767@debbugs.gnu.org, ndame To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 23 22:54:21 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 1mTVjZ-0005hF-1R for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Sep 2021 22:54:21 +0200 Original-Received: from localhost ([::1]:55036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTVjX-0008EC-KM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Sep 2021 16:54:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTVjG-0008CD-LW for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2021 16:54:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTVjG-0002mq-9C for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2021 16:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mTVjF-0001Ys-UM for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2021 16:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Sep 2021 20:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36767 X-GNU-PR-Package: emacs Original-Received: via spool by 36767-submit@debbugs.gnu.org id=B36767.16324303965941 (code B ref 36767); Thu, 23 Sep 2021 20:54:01 +0000 Original-Received: (at 36767) by debbugs.gnu.org; 23 Sep 2021 20:53:16 +0000 Original-Received: from localhost ([127.0.0.1]:55981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTViW-0001Xl-0T for submit@debbugs.gnu.org; Thu, 23 Sep 2021 16:53:16 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:47628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mTViR-0001XR-0e for 36767@debbugs.gnu.org; Thu, 23 Sep 2021 16:53:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nKTUvNg3FsORrNJ1NeocnwxcDMxN6SI2wfxG7rm+sxk=; b=nFH8VYn3yXZ7y/wwW1n/xK1ux5 0z4wMlu5MLC64HFcJNrvigAIMLiNscLL96iC7zX7sb91iTiX+WkDZw5PjYvllWWJj8HPdYAqvuHoH EUYizkbiOoifttUfSF1CQ8cRX0f3ajQT3YzFJ+yqBQsItDemArbugu3riLwZxNzf/ITo=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mTViG-0006j4-3l; Thu, 23 Sep 2021 22:53:03 +0200 X-Now-Playing: Magnus Granberg & Skogen's _Let Pass My Weary Guiltless Ghost_: "Let Pass My Weary Guiltless Ghost" In-Reply-To: (Arthur Miller's message of "Thu, 23 Sep 2021 02:23:03 +0200") 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:215227 Archived-At: Arthur Miller writes: > You can see how it looks like. I have attached a small screenshot too, > so you don't need to apply it just to see how it looks like. The file > name at the end of the header is probably clear on it's own; the > symbol link is as clear/unclear as rest of the links in the buffer. (You're doing all these mails in a bug report that has been archived, so the only other people who's reading them are the ones in the CCs. If you wish to discuss things publicly, either do so in emacs-devel or open a new bug report.) I fixed up your patch so that it works more reliably, but then I remembered why I didn't add the link: We don't know at this point whether the symbol in question is documented in the manual. Adding a link to something that fails is bad UI. And we can't check whether the symbol exists in the manual when generating the *Help* buffer, because it's slow, and the trade-off (making the command slow versus an extra link) is not a good one. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 551cf7e1a3..4d6d13ea42 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -367,6 +367,11 @@ 'help-news (view-buffer-other-window (find-file-noselect file)) (goto-char pos)) 'help-echo (purecopy "mouse-2, RET: show corresponding NEWS announcement")) + +(define-button-type 'help-symbol-info + :supertype 'help-xref + 'help-function #'help-goto-info + 'help-echo (purecopy "mouse-2, RET: read this info node")) (defvar bookmark-make-record-function) (defvar help-mode--current-data nil) @@ -538,6 +543,15 @@ help-make-xrefs ;; The following should probably be abstracted out. (unwind-protect (progn + ;; Make a button of the first time the symbol appears + ;; in the buffer. + (save-excursion + (when-let ((symbol (plist-get help-mode--current-data + :symbol))) + (when (or (symbolp symbol) (fboundp symbol)) + (goto-char (point-min)) + (when (search-forward (symbol-name symbol) nil t) + (help-xref-button 0 'help-symbol-info))))) ;; Info references (save-excursion (while (re-search-forward help-xref-info-regexp nil t)