From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#73686: 31.0.50; ERC 5.6.1-git: back button gone from describe-face via erc-nicks-list-faces Date: Tue, 08 Oct 2024 17:59:54 -0700 Message-ID: <8734l6xf91.fsf__13820.799141989$1728435707$gmane$org@neverwas.me> References: <875xq38g4y.fsf__36834.6894437977$1728355711$gmane$org@neverwas.me> <87ttdn5dsz.fsf@neverwas.me> <87y12y1exp.fsf@neverwas.me> <87o73uyxgv.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7379"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-erc@gnu.org To: 73686@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 09 03:01:39 2024 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 1syL58-0001lP-1N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Oct 2024 03:01:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syL4d-0000AW-9v; Tue, 08 Oct 2024 21:01:07 -0400 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 1syL4P-00009v-7k for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2024 21:00:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syL4O-0007qO-Rb for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2024 21:00:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=xHBQOjXLu26AHrXc77hKwpZFw2xdTL82n+2FbpJApiY=; b=o2Qi6VTwMvuART9KJ5towF5vwpeny+2OpFA5KT2YTTJLIHbkDgIUf/wU6XqtkiBahUPVAyg7guTFTkF/a7mecQhYGC8dKcZet1GxM7nUxabxEvKQm1DKBgVLpvDO7qH3BUhCi57HiTRaf9Ft49RfIkH0s4EhXmSXOM1IKC4vHUZghD4XZRm0jCV1257V1lfj2nO+lMmcQrQjf4wEu7/h99xN669nW24+VL4Z6ErIXFndMbiFLAJ5uXMqmarvpYSxd7ARIKM8fC/nW3lYTlgCRdYpT1L5Nl1PZYvIbOQo3o10B4fEsR4HD/MIribAzPQq5LEWPRI4pNjOVXg/4Pnfcg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1syL4Y-0002AE-35 for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2024 21:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2024 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73686 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73686-submit@debbugs.gnu.org id=B73686.17284356167877 (code B ref 73686); Wed, 09 Oct 2024 01:01:02 +0000 Original-Received: (at 73686) by debbugs.gnu.org; 9 Oct 2024 01:00:16 +0000 Original-Received: from localhost ([127.0.0.1]:54964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syL3n-00022N-B2 for submit@debbugs.gnu.org; Tue, 08 Oct 2024 21:00:16 -0400 Original-Received: from mail-108-mta191.mxroute.com ([136.175.108.191]:45369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syL3k-00020g-N7 for 73686@debbugs.gnu.org; Tue, 08 Oct 2024 21:00:14 -0400 Original-Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta191.mxroute.com (ZoneMTA) with ESMTPSA id 1926eca322d0003e01.001 for <73686@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 09 Oct 2024 00:59:57 +0000 X-Zone-Loop: b24b071228a5456a83812a50800e79ce6c4a1ec6312c X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: 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=xHBQOjXLu26AHrXc77hKwpZFw2xdTL82n+2FbpJApiY=; b=ec+4OVqvNwDxgWsgDt+sVKh0f0 I5L9cI1S6RH6hi6ZyCENW4VQC92Ni3Rj7wz2/Tj7BIx8NRCO28p4J7DlCE6rvOHKUIjO6TeHBOXF8 WtAy2ZiYnLH/Zjmn8eLPtfipmQN6ldfUsp14JKQVhhg8/p/yB/loh3uW7GPHMQpg9eCMHw9iEs8Or qtTRdUsBN30hN3NmxDrRhoaxqckvvmrZUNzv+CMDzL4cWq7/JOmmPsuHr4pEtEz7QAvEtv97D/T6W RjVSa55FZkfUNsehVc/aPkRHM8tnQLUh9X5PDQ1ByeneTC420NgDd6TSinEopSO4chcT9aW6cckJr ORY+ULwQ==; In-Reply-To: <87o73uyxgv.fsf@neverwas.me> (J. P.'s message of "Tue, 08 Oct 2024 16:41:04 -0700") X-Authenticated-Id: masked@neverwas.me 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:293179 Archived-At: --=-=-= Content-Type: text/plain Actually, we can't count on `help-buffer-under-preparation' being non-nil in `describe-*' commands (unless we're willing to modify all the ones in which it isn't, which sounds rather dubious). Patch updated. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0000-v1-v2.diff >From 0e19883da585b0105f2340ac7c23764b3ea939c9 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Tue, 8 Oct 2024 17:33:11 -0700 Subject: [PATCH 0/1] *** NOT A PATCH *** *** BLURB HERE *** F. Jason Park (1): [POC] Overload help-xref-following for non-default help buffers lisp/help-mode.el | 21 +++++++++++++-------- test/lisp/emacs-lisp/package-tests.el | 2 +- test/lisp/help-mode-tests.el | 14 +++++++++++++- 3 files changed, 27 insertions(+), 10 deletions(-) Interdiff: diff --git a/lisp/help-mode.el b/lisp/help-mode.el index f704098b2dc..77473125694 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -524,16 +524,14 @@ help-buffer "Return the name of a buffer for inserting help. If `help-xref-following' is t and the current buffer is derived from `help-mode', return the current buffer's name. As a special case, also -do so if these three conditions are met: `help-xref-following' is the -symbol of a major mode deriving from `help-mode', the current buffer is -in `fundamental-mode', and `help-buffer-under-preparation' is non-nil. +do so if `help-xref-following' is the symbol of a major mode deriving +from `help-mode' and the current buffer is in `fundamental-mode'. Otherwise, return \"*Help*\", creating a buffer with that name if it does not already exist." (buffer-name ;for with-output-to-temp-buffer (if (and help-xref-following (if (or (eq help-xref-following t) - (not (and help-buffer-under-preparation - (eq major-mode 'fundamental-mode)))) + (not (eq major-mode 'fundamental-mode))) (derived-mode-p 'help-mode) ; current buffer (provided-mode-derived-p help-xref-following '(help-mode)))) (current-buffer) diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 692d6550250..8236f834b02 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -172,7 +172,7 @@ with-fake-help-buffer `(with-temp-buffer (help-mode) ;; Trick `help-buffer' into using the temp buffer. - (let ((help-xref-following t)) + (let ((help-xref-following major-mode)) ,@body))) (defun package-test-strip-version (dir) -- 2.46.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-POC-Overload-help-xref-following-for-non-default-hel.patch >From 0e19883da585b0105f2340ac7c23764b3ea939c9 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Tue, 8 Oct 2024 15:58:49 -0700 Subject: [PATCH 1/1] [POC] Overload help-xref-following for non-default help buffers * lisp/help-mode.el (help-xref-following): Mention in doc that value may be the symbol of a major mode. (help-buffer): When the current buffer is in `fundamental-mode', check to see if the value of `help-xref-following' is the symbol of a major mode deriving from `help-mode' before returning the current buffer. This should also probably check whether `help-buffer-under-preparation' is non-nil, but many `describe-*' functions do not bind it. (help-xref-go-back, help-xref-go-forward): Use `help-do-xref' instead of `apply' to call methods. (help-do-xref): Bind `help-xref-following' to the value of `major-mode' instead of t. * test/lisp/emacs-lisp/package-tests.el (with-fake-help-buffer): Use value of `major-mode' instead of t for `help-xref-following'. * test/lisp/help-mode-tests.el (help-mode-tests-help-buffer-current-buffer): Add case for `help-xref-following' being a major-mode rather than t. (Bug#73686) (See also: bug#73637.) --- lisp/help-mode.el | 21 +++++++++++++-------- test/lisp/emacs-lisp/package-tests.el | 2 +- test/lisp/help-mode-tests.el | 14 +++++++++++++- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 4ee4f4156a1..77473125694 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -516,19 +516,24 @@ help-setup-xref (setq help-xref-stack-item item))) (defvar help-xref-following nil - "Non-nil when following a help cross-reference.") + "Non-nil when following a help cross-reference. +May be the value of `major-mode' when an instigating button was clicked.") ;;;###autoload (defun help-buffer () "Return the name of a buffer for inserting help. -If `help-xref-following' is non-nil and the current buffer is -derived from `help-mode', this is the name of the current buffer. - +If `help-xref-following' is t and the current buffer is derived from +`help-mode', return the current buffer's name. As a special case, also +do so if `help-xref-following' is the symbol of a major mode deriving +from `help-mode' and the current buffer is in `fundamental-mode'. Otherwise, return \"*Help*\", creating a buffer with that name if it does not already exist." (buffer-name ;for with-output-to-temp-buffer (if (and help-xref-following - (derived-mode-p 'help-mode)) + (if (or (eq help-xref-following t) + (not (eq major-mode 'fundamental-mode))) + (derived-mode-p 'help-mode) ; current buffer + (provided-mode-derived-p help-xref-following '(help-mode)))) (current-buffer) (get-buffer-create "*Help*")))) @@ -792,7 +797,7 @@ help-xref-go-back position (car item) method (cadr item) args (cddr item)))) - (apply method args) + (help-do-xref nil method args) (with-current-buffer buffer (if (get-buffer-window buffer) (set-window-point (get-buffer-window buffer) position) @@ -812,7 +817,7 @@ help-xref-go-forward position (car item) method (cadr item) args (cddr item)))) - (apply method args) + (help-do-xref nil method args) (with-current-buffer buffer (if (get-buffer-window buffer) (set-window-point (get-buffer-window buffer) position) @@ -894,7 +899,7 @@ help-do-xref Things are set up properly so that the resulting help buffer has a proper [back] button." ;; There is a reference at point. Follow it. - (let ((help-xref-following t)) + (let ((help-xref-following major-mode)) (apply function (if (eq function 'info) (append args (list (generate-new-buffer-name "*info*"))) args)))) diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 692d6550250..8236f834b02 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -172,7 +172,7 @@ with-fake-help-buffer `(with-temp-buffer (help-mode) ;; Trick `help-buffer' into using the temp buffer. - (let ((help-xref-following t)) + (let ((help-xref-following major-mode)) ,@body))) (defun package-test-strip-version (dir) diff --git a/test/lisp/help-mode-tests.el b/test/lisp/help-mode-tests.el index 2e64b12732e..968ed7da72e 100644 --- a/test/lisp/help-mode-tests.el +++ b/test/lisp/help-mode-tests.el @@ -39,7 +39,19 @@ help-mode-tests-help-buffer-current-buffer (help-mode) (let ((help-xref-following t)) (should (equal (buffer-name (current-buffer)) - (help-buffer)))))) + (help-buffer))))) + + ;; Returns the current `fundamental-mode' buffer when an xref button + ;; is clicked and the resulting action function, such as the various + ;; `describe-*' commands, binds `help-buffer-under-preparation' to + ;; something non-nil. + (should (eq major-mode 'fundamental-mode)) + (let ((help-xref-following 'help-mode) + (help-buffer-under-preparation t)) + (should (equal (buffer-name (current-buffer)) + (help-buffer))) + (with-current-buffer "*scratch*" + (should (equal "*Help*" (help-buffer)))))) (ert-deftest help-mode-tests-make-xrefs () (with-temp-buffer -- 2.46.2 --=-=-=--