GNU bug report logs - #57955
29.0.50; Allow session-local ERC modules

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Tue, 20 Sep 2022 13:06:02 UTC

Severity: wishlist

Tags: patch

Found in version 29.0.50

Full log


View this message in rfc822 format

From: "J.P." <jp <at> neverwas.me>
To: 57955 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: bug#57955: 29.0.50; Allow session-local ERC modules
Date: Sun, 08 Oct 2023 21:02:02 -0700
[Message part 1 (text/plain, inline)]
It turns out these changes removed some behavior involving the loading
of modules that's long been part of ERC's implicit interface. Basically,
when encountering a third-party module `mymod', ERC has always attempted
to `require' the (possibly nonexistent) feature `erc-mymod', and to do
so unconditionally. However, this bug changed that policy to instead
only attempt such loading if the corresponding command `erc-mymod-mode'
is undefined. That was likely unwise because some packages do
questionable things like

  ;;;###autoload
  (eval-after-load 'erc
    '(define-erc-module mymod nil "Doc" () ()))

which fails to provide the vital `symbol-file' association between the
minor-mode command and the library (because the command itself isn't
autoloaded). Such uses ignore the decades-old example in the doc string
of `define-erc-module', which clearly recommends

  ;;;###autoload(autoload 'erc-mymode-mode "erc-mymode")
  (define-erc-module mymod nil "Doc" () ())

as the surefire approach. That said, in cases where the library's name
matches the (prefixed) module name, no autoload cookie is necessary.
Unfortunately, many of these packages are in maintenance mode, with
authors unwilling to respond to suggestions to update such aberrant
uses. Thus, I think it's in ERC's best interest to accommodate them as
it always has. Please see the second patch below. Thanks.

[0001-5.6-Honor-nil-values-in-erc-restore-initialize-prior.patch (text/x-patch, attachment)]
[0002-5.6-Sort-and-dedupe-when-loading-modules-in-erc-open.patch (text/x-patch, attachment)]

This bug report was last modified 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.