"J.P." <jp@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 60954) by debbugs.gnu.org; 20 Jan 2023 14:15:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 09:15:43 2023 Received: from localhost ([127.0.0.1]:45969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pIsBD-0001Qq-6R for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:15:43 -0500 Received: from mail-108-mta91.mxroute.com ([136.175.108.91]:43739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jp@HIDDEN>) id 1pIsBB-0001Qc-Co for 60954 <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:15:42 -0500 Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta91.mxroute.com (ZoneMTA) with ESMTPSA id 185cf88e1c9000011e.001 for <60954 <at> debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 20 Jan 2023 14:15:32 +0000 X-Zone-Loop: 9069294e83579e1c475c6c88a424c82b9d8079ca8477 X-Originating-IP: [136.175.111.2] 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=D8o6Qb1ueuIOEqE2b11XIcaEXtGir3gI4PhmDDRDUxM=; b=Hhl8eAwGwwNkw9aNQ16qGRG6F8 XJX/r7Y2N/5+EDARFd+iLZceL8yabd1oCVtdqPNtylWc+aezdfd0cz6LC80+OWCXeoZH7jMWpd/ox ndybO1+yznI1oW3T54NJxNRwb8wGUM5XgsEyJQmCL1B2BPKOBVv9dNtltM5Pn27+o23+kvmT0omau FqEyPVBZWyZAjMvw6Ae36SmpbEQSv+YfZ06sAVee1q3q5559JXQSEiNEhF1UYj44NHmlmlwZIxUQv YzWq6xXFnhldM5CmH/JO1lK6VrpA53ykr2aEKx6rp94Wmgb9S2aAUvnwpoQ9UAIWL4WUiXYut/taT wq+YHJow==; From: "J.P." <jp@HIDDEN> To: 60954 <at> debbugs.gnu.org Subject: Re: bug#60954: 29.0.60; ERC 5.4.1: loading ERC clobbers customizations to erc-mode-hook In-Reply-To: <87pmb9wyz6.fsf@HIDDEN> (J. P.'s message of "Thu, 19 Jan 2023 21:34:37 -0800") References: <87pmb9wyz6.fsf@HIDDEN> Date: Fri, 20 Jan 2023 06:15:29 -0800 Message-ID: <874jsluwam.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Authenticated-Id: masked@HIDDEN X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60954 Cc: emacs-erc@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain "J.P." <jp@HIDDEN> writes: > I see two basic avenues of attack here. The first is a pretty safe > stopgap and the second a slightly riskier comprehensive approach that > should have been on the books the moment that bug was closed: > > hack: partially revert a tiny hunk from the commit above > > fix: don't require goodies at all and instead update the module > mapping data and add all necessary autoloads and forward > declarations Under "fix," I forgot to mention also couching any top-level `add-hook' calls in module-setup and teardown functions. Of particular concern are those that mutate user options. Attached is an addition to the (5.6 portion of the) patch set that does this for the Imenu integration. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0004-5.6-Convert-ERC-s-Imenu-integration-into-proper-modu.patch From e7507ed0777a1b346e0161399b077bc0904f1c80 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" <jp@HIDDEN> Date: Thu, 19 Jan 2023 21:07:27 -0800 Subject: [PATCH 4/4] [5.6] Convert ERC's Imenu integration into proper module TODO: add news item once a section for 5.6 has been added. * lisp/erc/erc-goodies.el: Don't add Imenu hooks to `erc-mode-hook' at top level. Remove autoload for `erc-create-imenu-index' because it already exists in the `erc-imenu' library. (erc-imenu-setup) Move to erc-imenu. * lisp/erc/erc-imenu.el (erc-imenu-setup): Move here from goodies. (erc-imenu-mode, erc-imenu-enable, erc-imenu-disable): Create new ERC module for Imenu. * lisp/erc/erc.el (erc-modules): Add `imenu' to default value and create menu item. Update package-version. --- lisp/erc/erc-goodies.el | 8 -------- lisp/erc/erc-imenu.el | 19 +++++++++++++++++++ lisp/erc/erc.el | 4 +++- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 0bf4bb9537c..f6c1376bb58 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -29,8 +29,6 @@ ;;; Code: -;;; Imenu support - (eval-when-compile (require 'cl-lib)) (require 'erc-common) @@ -48,12 +46,6 @@ erc-server-process (declare-function erc-extract-command-from-line "erc" (line)) (declare-function erc-beg-of-input-line "erc" nil) -(defun erc-imenu-setup () - "Setup Imenu support in an ERC buffer." - (setq-local imenu-create-index-function #'erc-create-imenu-index)) - -(add-hook 'erc-mode-hook #'erc-imenu-setup) -(autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function") ;;; Automatically scroll to bottom (defcustom erc-input-line-position nil diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index 6223cd3d06f..2514ffcc4d3 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -124,6 +124,25 @@ erc-create-imenu-index index-alist)) index-alist)) +(defvar-local erc-imenu--create-index-function nil + "Previous local value of `imenu-create-index-function', if any.") + +(defun erc-imenu-setup () + "Wire up support for Imenu in an ERC buffer." + (when (and (local-variable-p 'imenu-create-index-function) + imenu-create-index-function) + (setq erc-imenu--create-index-function imenu-create-index-function)) + (setq-local imenu-create-index-function #'erc-create-imenu-index)) + +(define-erc-module imenu nil + "Simple Imenu integration for ERC." + ((add-hook 'erc-mode-hook #'erc-imenu-setup)) + ((remove-hook 'erc-mode-hook #'erc-imenu-setup) + (erc-with-all-buffers-of-server erc-server-process nil + (when erc-imenu--create-index-function + (setq imenu-create-index-function erc-imenu--create-index-function) + (kill-local-variable 'erc-imenu--create-index-function))))) + (provide 'erc-imenu) ;;; erc-imenu.el ends here diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 007f70b8671..0d6634d38a9 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1819,7 +1819,7 @@ erc-migrate-modules (defcustom erc-modules '(netsplit fill button match track completion readonly networks ring autojoin noncommands irccontrols - move-to-prompt stamp menu list) + move-to-prompt stamp menu list imenu) "A list of modules which ERC should enable. If you set the value of this without using `customize' remember to call \(erc-update-modules) after you change it. When using `customize', modules @@ -1864,6 +1864,7 @@ erc-modules (const :tag "identd: Launch an identd server on port 8113" identd) (const :tag "irccontrols: Highlight or remove IRC control characters" irccontrols) + (const :tag "imenu: A simple Imenu integration" imenu) (const :tag "keep-place: Leave point above un-viewed text" keep-place) (const :tag "list: List channels in a separate buffer" list) (const :tag "log: Save buffers in logs" log) @@ -1899,6 +1900,7 @@ erc-modules (const :tag "unmorse: Translate morse code in messages" unmorse) (const :tag "xdcc: Act as an XDCC file-server" xdcc) (repeat :tag "Others" :inline t symbol)) + :package-version '(ERC . "5.5") ; FIXME sync on release :group 'erc) (defun erc-update-modules () -- 2.38.1 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#60954
; Package emacs
.
Full text available.Received: (at 60954) by debbugs.gnu.org; 20 Jan 2023 14:14:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 09:14:32 2023 Received: from localhost ([127.0.0.1]:45962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pIsA3-0001OG-KK for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:14:32 -0500 Received: from mail-108-mta96.mxroute.com ([136.175.108.96]:45711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jp@HIDDEN>) id 1pIsA2-0001O3-9Y for 60954 <at> debbugs.gnu.org; Fri, 20 Jan 2023 09:14:30 -0500 Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta96.mxroute.com (ZoneMTA) with ESMTPSA id 185cf87c847000011e.001 for <60954 <at> debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 20 Jan 2023 14:14:20 +0000 X-Zone-Loop: eca4dccf981ca6d73044ba996dec105a810d9253a004 X-Originating-IP: [136.175.111.2] 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=XkNOmfrQktLKK7vbalxpmIqV7habNzPYDcyuZBAhalA=; b=hs07lU3Sgm2FsRrnJmoJNFjT7a 7Msn7UzKD6JGSO9jHc5TEtOvvIo0xxZm6xII1xLMt+Bg7qQC0P5312CfLSopMTGkCsg48AVVl8/lO TwTZz67YWPnK0WsdzsnqJl1GAVobxPUQETfI49NE32oB2S04JBqXYt7fRZF0bcu1Y1MFu/4C41NGn 0JcGot/jJ1bGgrVFjtKNxfBqlslpOqe9VztpnJLkHRTmGWL1lcQ4bQ/5ecdv4gA0FVOApSY5k1lZu kumDtV3yynWIHdqZoxuOzJA1SPA57lBbARNjc1BFQb0HKJCNgRmjIE9WLyaKXT5xzF26tB8LCjcof brjx0vsQ==; From: "J.P." <jp@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#60954: 29.0.60; ERC 5.4.1: loading ERC clobbers customizations to erc-mode-hook In-Reply-To: <83cz79oeu7.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 20 Jan 2023 09:16:48 +0200") References: <87pmb9wyz6.fsf@HIDDEN> <83cz79oeu7.fsf@HIDDEN> Date: Fri, 20 Jan 2023 06:14:17 -0800 Message-ID: <875yd1uwcm.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@HIDDEN X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60954 Cc: 60954 <at> debbugs.gnu.org, emacs-erc@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> I see two basic avenues of attack here. The first is a pretty safe >> stopgap and the second a slightly riskier comprehensive approach that >> should have been on the books the moment that bug was closed: >> >> hack: partially revert a tiny hunk from the commit above >> >> fix: don't require goodies at all and instead update the module >> mapping data and add all necessary autoloads and forward >> declarations >> >> Implementations of both are attached. (I didn't bother updating the >> required Compat version in the second patch, but that'd also need to >> accompany the change set.) For now, I propose we take the shorter route >> but with an eye toward revisiting the issue soon after the next (ERC) >> release. If anyone has an opinion here, now would be the time to speak >> up. > > Your proposal is fine with me, thanks. Great, thanks. I went ahead and added the lighter change to the release branch. Leaving this open until the rest is settled (whenever that may be).
bug-gnu-emacs@HIDDEN
:bug#60954
; Package emacs
.
Full text available.Received: (at 60954) by debbugs.gnu.org; 20 Jan 2023 07:16:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 02:16:57 2023 Received: from localhost ([127.0.0.1]:45335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pIldx-0008Gi-3F for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 02:16:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1pIldw-0008GU-3a for 60954 <at> debbugs.gnu.org; Fri, 20 Jan 2023 02:16:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1pIldp-0008OR-0t; Fri, 20 Jan 2023 02:16:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RxHgT7S/QC2SaJKt0QSQ/B4bRYEYCUTDlTkEx96077E=; b=Oko2ALZOhWcl ko99uSe5Obu9sqz7/92yMRVFbGbv+o0C9vBuJJ0vbSJLdhe7EvNovjQDfzxocNOvVXZhD0TnxY9s+ PVXJPVha1iE10gmxPFHqPPcvdTuKmZ6lqomGvHOPl7F07ifAwZDHmgnyTzymkAD74gqAz5diNjI0q VfBScUKqvmuA/9wImcL5kp+GmAdce4fauk3oRqrjYnAdIEj/l8UXcIBhYU/ekGuU618Bh3DMTy13y bSeVSoodnC6D3MWq/iFFwpJAwgrAVY630vU95Z9zdSgylVlDSAb7V/k75zsiuhxHvM0rmsi4s3nwM lLmGSr8nJlhfk5lNLxswyg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1pIldo-0000mQ-Fg; Fri, 20 Jan 2023 02:16:48 -0500 Date: Fri, 20 Jan 2023 09:16:48 +0200 Message-Id: <83cz79oeu7.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: "J.P." <jp@HIDDEN> In-Reply-To: <87pmb9wyz6.fsf@HIDDEN> (jp@HIDDEN) Subject: Re: bug#60954: 29.0.60; ERC 5.4.1: loading ERC clobbers customizations to erc-mode-hook References: <87pmb9wyz6.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60954 Cc: 60954 <at> debbugs.gnu.org, emacs-erc@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Cc: emacs-erc@HIDDEN > From: "J.P." <jp@HIDDEN> > Date: Thu, 19 Jan 2023 21:34:37 -0800 > > I see two basic avenues of attack here. The first is a pretty safe > stopgap and the second a slightly riskier comprehensive approach that > should have been on the books the moment that bug was closed: > > hack: partially revert a tiny hunk from the commit above > > fix: don't require goodies at all and instead update the module > mapping data and add all necessary autoloads and forward > declarations > > Implementations of both are attached. (I didn't bother updating the > required Compat version in the second patch, but that'd also need to > accompany the change set.) For now, I propose we take the shorter route > but with an eye toward revisiting the issue soon after the next (ERC) > release. If anyone has an opinion here, now would be the time to speak > up. Your proposal is fine with me, thanks.
bug-gnu-emacs@HIDDEN
:bug#60954
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 20 Jan 2023 05:34:58 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 20 00:34:58 2023 Received: from localhost ([127.0.0.1]:45222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pIk3F-00055V-2T for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 00:34:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:54156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jp@HIDDEN>) id 1pIk3A-00055L-FH for submit <at> debbugs.gnu.org; Fri, 20 Jan 2023 00:34:55 -0500 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 <jp@HIDDEN>) id 1pIk3A-00069n-3E for bug-gnu-emacs@HIDDEN; Fri, 20 Jan 2023 00:34:52 -0500 Received: from mail-108-mta56.mxroute.com ([136.175.108.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1pIk36-0004YG-TR for bug-gnu-emacs@HIDDEN; Fri, 20 Jan 2023 00:34:51 -0500 Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta56.mxroute.com (ZoneMTA) with ESMTPSA id 185cdac07a6000011e.001 for <bug-gnu-emacs@HIDDEN> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 20 Jan 2023 05:34:41 +0000 X-Zone-Loop: 335efcd3a76f31f1fee43643d51a95f29837b23db762 X-Originating-IP: [136.175.111.2] 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:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=EZ1fSFiJ26kGhP0nCkoJlzezxHo80RcE/tfPgjoibXY=; b=k2HHKlS7CG12Nhd1qxBZoQ3MkU xfCynmGuMO2mTq8c4gVJRv/YzY4VDQ7jT9rk5myevvuIqTQDQbK+DYkPRcYooRoJcCwq6WnZ1x5oZ S3Om8SgFN6QLe0dUiaNG9OMF1N/G58RCv4/fHif+UHjnmTSlX2KbYiY8gE9vjkCjmgmPnAVOC6HYm i1+K2B9FxpFYRi2CDuE5sUYmJs4zbc+G2AfvMEB6F608WQl0wQvamuS74s2Qp6Onq8EmCwJv14tEr HpRtwYOiAaz2oMlmawnS/nqZiPPY4hdAuobE1TaCe8XjpTnNUrG0lB6JxiByUChoxFGQsfcLoSaTK RfWTKeLQ==; From: "J.P." <jp@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 29.0.60; ERC 5.4.1: loading ERC clobbers customizations to erc-mode-hook X-Debbugs-CC: emacs-erc@HIDDEN Date: Thu, 19 Jan 2023 21:34:37 -0800 Message-ID: <87pmb9wyz6.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Authenticated-Id: masked@HIDDEN Received-SPF: pass client-ip=136.175.108.56; envelope-from=jp@HIDDEN; helo=mail-108-mta56.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch To reproduce: 1. Put the following in /tmp/test/init.el (custom-set-variables '(erc-mode-hook '(erc-imenu-setup visual-line-mode))) which is exactly what you'd get by doing M-x customize-group RET erc-hooks RET and adding a `visual-line-mode' item to `erc-mode-hook'. 2. Run emacs --no-site-file --init-directory=/tmp/test 3. If you do a C-h v erc-mode-hook RET which loads `erc' behind the scenes, the hook's value will be (erc-imenu-setup) Note the missing `visual-line-mode'. Superficially, this is a regression stemming from bug#56340: 29.0.50; [PATCH] Don't ask people to order requires. which became commit c2d657e7c4fd9685591f2120007eabf78745919d Author: Dick R. Chiang <dick.r.chiang@HIDDEN> Date: Fri Jul 1 11:06:51 2022 -0400 Move ERC's core dependencies to separate file But amid all that rearranging, a subtle and pernicious headache long ago swept under the rug happened to resurface [1]. I see two basic avenues of attack here. The first is a pretty safe stopgap and the second a slightly riskier comprehensive approach that should have been on the books the moment that bug was closed: hack: partially revert a tiny hunk from the commit above fix: don't require goodies at all and instead update the module mapping data and add all necessary autoloads and forward declarations Implementations of both are attached. (I didn't bother updating the required Compat version in the second patch, but that'd also need to accompany the change set.) For now, I propose we take the shorter route but with an eye toward revisiting the issue soon after the next (ERC) release. If anyone has an opinion here, now would be the time to speak up. Thanks. P.S. This bug owes its existence to Libera user jrm, who kindly brought it to our attention earlier today. [1] Some related background. For ages, `erc-goodies' was `require'd by erc.el at the very end of that file, likely in order to sidestep the manual module-to-feature mapping needed by `erc-update-modules' for outliers whose names don't match their features (arguably justified for smaller, miscellaneous modules). A secondary benefit and possible motivating factor was that various commands from goodies could feature in `erc-mode-map' without being autoloaded. However, additional liberties were eventually taken until erc-goodies.el became a de facto addendum to erc.el. In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2023-01-19 built on localhost Repository revision: 7b7b2b95138e691f1b155060b91a8998e3905651 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 36 (Workstation Edition) Configured using: 'configure --enable-check-lisp-object-type --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3' PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils erc iso8601 time-date auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map thingatpt pp format-spec cl-loaddefs cl-lib erc-backend erc-goodies erc-networks byte-opt gv bytecomp byte-compile erc-common erc-compat erc-loaddefs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 64464 6515) (symbols 48 8616 0) (strings 32 23657 2042) (string-bytes 1 685680) (vectors 16 15232) (vector-slots 8 209553 7914) (floats 8 24 23) (intervals 56 228 0) (buffers 976 10)) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Don-t-load-erc-goodies-atop-erc.el.patch From a20ae7ac78abbb1d200a6e264dbc0ede39d56dd1 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" <jp@HIDDEN> Date: Thu, 19 Jan 2023 20:19:40 -0800 Subject: [PATCH 1/3] Don't load erc-goodies atop erc.el * lisp/erc/erc.el: Commit c2d657e7c4fd9685591f2120007eabf78745919d "Move ERC's core dependencies to a separate file" ironed out ERC's interwoven dependencies for the better but didn't cleanly sidestep the goodies interdependency, specifically with regard to custom options. This reverts the tiny portion impacting this aspect by once again requiring `erc-goodies' at the very end of ERC's main library. Special thanks to Libera.Chat user jrm for reporting this bug. --- lisp/erc/erc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7f51b7bfb2e..ff1820cfaf2 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -61,7 +61,6 @@ (load "erc-loaddefs" 'noerror 'nomessage) (require 'erc-networks) -(require 'erc-goodies) (require 'erc-backend) (require 'cl-lib) (require 'format-spec) @@ -7386,4 +7385,6 @@ erc-handle-irc-url (provide 'erc) +;; FIXME this is a temporary stopgap for Emacs 29. +(require 'erc-goodies) ;;; erc.el ends here -- 2.38.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-5.6-Copy-over-upstream-Compat-macros-to-erc-compat.patch From 9604e304bb025a620abdec86c75d2c4074b87d88 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" <jp@HIDDEN> Date: Thu, 19 Jan 2023 20:52:47 -0800 Subject: [PATCH 2/3] [5.6] Copy over upstream Compat macros to erc-compat * lisp/erc/erc-backend: (erc--get-isupport-entry): Replace call to `erc-compat--with-memoization' with the built-in `with-memoization'. * lisp/erc/erc-compat.el: (erc-compat-function, erc-compat-call): Add new macros from Compat 29.1.2.0. (erc-compat--with-memoization): Remove because it's now provided by Compat. --- lisp/erc/erc-backend.el | 2 +- lisp/erc/erc-compat.el | 49 +++++++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 1da701aebc4..f00c8b2841a 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1878,7 +1878,7 @@ erc--get-isupport-entry primitive value." (if-let* ((table (or erc--isupport-params (erc-with-server-buffer erc--isupport-params))) - (value (erc-compat--with-memoization (gethash key table) + (value (with-memoization (gethash key table) (when-let ((v (assoc (symbol-name key) erc-server-parameters))) (if (cdr v) diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index 5601ede27a5..fb354a1d3f7 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -34,6 +34,46 @@ (require 'compat nil 'noerror) (eval-when-compile (require 'cl-lib) (require 'url-parse)) +;; Except for the "erc-" namespacing, these two definitions should be +;; continuously updated to match the latest upstream ones verbatim. +;; Although they're pretty simple, it's likely not worth checking for +;; and possibly deferring to the non-prefixed versions. +;; +;; BEGIN Compat macros + +;;;; Macros for explicit compatibility function calls + +(defmacro erc-compat-function (fun) + "Return compatibility function symbol for FUN. + +If the Emacs version provides a sufficiently recent version of +FUN, the symbol FUN is returned itself. Otherwise the macro +returns the symbol of a compatibility function which supports the +behavior and calling convention of the current stable Emacs +version. For example Compat 29.1 will provide compatibility +functions which implement the behavior and calling convention of +Emacs 29.1. + +An example is the function `plist-get' which got an additional +predicate argument in Emacs 29. The compatibility function, +which supports this additional argument can be obtained +via (compat-function plist-get) and called with the additional +predicate argument via (compat-call plist-get plist prop +predicate). It is not possible to directly call (plist-get plist +prop predicate), since the function does not yet support the +predicate argument on older Emacs versions and the Compat library +does not override existing functions." + (let ((compat (intern (format "compat--%s" fun)))) + `#',(if (fboundp compat) compat fun))) + +(defmacro erc-compat-call (fun &rest args) + "Call compatibility function or macro FUN with ARGS. +See `compat-function' for details." + (let ((compat (intern (format "compat--%s" fun)))) + `(,(if (fboundp compat) compat fun) ,@args))) + +;; END Compat macros + ;;;###autoload(autoload 'erc-define-minor-mode "erc-compat") (define-obsolete-function-alias 'erc-define-minor-mode #'define-minor-mode "28.1") @@ -368,15 +408,6 @@ erc-compat--29-sasl-scram--client-final-message ;;;; Misc 29.1 -(defmacro erc-compat--with-memoization (table &rest forms) - (declare (indent defun)) - (cond - ((fboundp 'with-memoization) - `(with-memoization ,table ,@forms)) ; 29.1 - ((fboundp 'cl--generic-with-memoization) - `(cl--generic-with-memoization ,table ,@forms)) - (t `(progn ,@forms)))) - (defvar url-irc-function) (defun erc-compat--29-browse-url-irc (string &rest _) -- 2.38.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-5.6-Don-t-require-erc-goodies-in-erc.el.patch From 8cd02bc9c0b54cb0812aebac137ed1828e395a31 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" <jp@HIDDEN> Date: Thu, 19 Jan 2023 21:07:27 -0800 Subject: [PATCH 3/3] [5.6] Don't require erc-goodies in erc.el * lisp/erc/erc-common.el: (erc--features-to-modules): Add mappings from erc-goodies. * lisp/erc/erc-goodies.el: Sort `defvar' forward declarations for maintainability. (erc-irccontrols-mode, erc-enable-irccontrols, erc-disable-irccontrols): Add and remove key for `erc-toggle-interpret-controls' to `erc-mode-map'. * lisp/erc/erc.el: Add some forward declarations from `erc-goodies' and remove the `require' call for `erc-goodies' at the end of the file. (erc-mode-map): Remove C-c C-c binding for `erc-toggle-interpret-controls'. (erc-update-mode-line-buffer): Only strip control chars when `erc-irccontrols-mode' is active. This is arguably a minor breaking change perhaps deserving of a NEWS entry. --- lisp/erc/erc-common.el | 10 +++++++++- lisp/erc/erc-goodies.el | 11 +++++++---- lisp/erc/erc.el | 10 ++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 994555acecf..e567a108191 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -96,7 +96,15 @@ erc--features-to-modules (erc-page page ctcp-page) (erc-sound sound ctcp-sound) (erc-stamp stamp timestamp) - (erc-services services nickserv)) + (erc-services services nickserv) + (erc-goodies scrolltobottom) + (erc-goodies readonly) + (erc-goodies move-to-prompt) + (erc-goodies keep-place) + (erc-goodies noncommands) + (erc-goodies irccontrols) + (erc-goodies smiley) + (erc-goodies unmorse)) "Migration alist mapping a library feature to module names. Keys need not be unique: a library may define more than one module. Sometimes a module's downcased alias will be its diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 05a21019042..0bf4bb9537c 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -38,9 +38,10 @@ erc-controls-highlight-regexp (defvar erc-controls-remove-regexp) (defvar erc-input-marker) (defvar erc-insert-marker) -(defvar erc-server-process) -(defvar erc-modules) (defvar erc-log-p) +(defvar erc-mode-map) +(defvar erc-modules) +(defvar erc-server-process) (declare-function erc-buffer-list "erc" (&optional predicate proc)) (declare-function erc-error "erc" (&rest args)) @@ -384,9 +385,11 @@ erc-get-fg-color-face (define-erc-module irccontrols nil "This mode enables the interpretation of IRC control chars." ((add-hook 'erc-insert-modify-hook #'erc-controls-highlight) - (add-hook 'erc-send-modify-hook #'erc-controls-highlight)) + (add-hook 'erc-send-modify-hook #'erc-controls-highlight) + (define-key erc-mode-map "\C-c\C-c" #'erc-toggle-interpret-controls)) ((remove-hook 'erc-insert-modify-hook #'erc-controls-highlight) - (remove-hook 'erc-send-modify-hook #'erc-controls-highlight))) + (remove-hook 'erc-send-modify-hook #'erc-controls-highlight) + (erc-compat-call define-key erc-mode-map "\C-c\C-c" nil t))) (defun erc-controls-interpret (str) "Return a copy of STR after dealing with IRC control characters. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index ff1820cfaf2..007f70b8671 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -134,11 +134,14 @@ erc-scripts ;; Forward declarations (defvar erc-message-parsed) +(defvar erc-irccontrols-mode) (defvar tabbar--local-hlf) (defvar motif-version-string) (defvar gtk-version-string) +(declare-function erc-controls-strip "erc-goodies" (str)) + ;; tunable connection and authentication parameters (defcustom erc-server nil @@ -1188,7 +1191,6 @@ erc-mode-map (define-key map [home] #'erc-bol) (define-key map "\C-c\C-a" #'erc-bol) (define-key map "\C-c\C-b" #'erc-switch-to-buffer) - (define-key map "\C-c\C-c" #'erc-toggle-interpret-controls) (define-key map "\C-c\C-d" #'erc-input-action) (define-key map "\C-c\C-e" #'erc-toggle-ctcp-autoresponse) (define-key map "\C-c\C-f" #'erc-toggle-flood-control) @@ -6847,7 +6849,9 @@ erc-update-mode-line-buffer (?m . ,(erc-format-channel-modes)) (?n . ,(or (erc-current-nick) "")) (?N . ,(erc-format-network)) - (?o . ,(or (erc-controls-strip erc-channel-topic) "")) + (?o . ,(or (and erc-irccontrols-mode + (erc-controls-strip erc-channel-topic)) + "")) (?p . ,(erc-port-to-string erc-session-port)) (?s . ,(erc-format-target-and/or-server)) (?S . ,(erc-format-target-and/or-network)) @@ -7385,6 +7389,4 @@ erc-handle-irc-url (provide 'erc) -;; FIXME this is a temporary stopgap for Emacs 29. -(require 'erc-goodies) ;;; erc.el ends here -- 2.38.1 --=-=-=--
"J.P." <jp@HIDDEN>
:emacs-erc@HIDDEN, bug-gnu-emacs@HIDDEN
.
Full text available.emacs-erc@HIDDEN, bug-gnu-emacs@HIDDEN
:bug#60954
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.