GNU bug report logs - #63595
30.0.50; ERC 5.6: Add buffer-list and nick-list modules

Previous Next

Package: emacs;

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

Date: Fri, 19 May 2023 19:26:01 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Done: "J.P." <jp <at> neverwas.me>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63595 in the body.
You can then email your comments to 63595 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to emacs-erc <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Fri, 19 May 2023 19:26:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "J.P." <jp <at> neverwas.me>:
New bug report received and forwarded. Copy sent to emacs-erc <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Fri, 19 May 2023 19:26:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Fri, 19 May 2023 12:25:29 -0700
[Message part 1 (text/plain, inline)]
Tags: patch
Severity: wishlist

(This bug could just as well be titled "Make ERC look more like
standalone clients," although that's perhaps a bit clickbaity.)


Hi,

Newcomers to ERC are occasionally dumbfounded by the absence of a
certain pair of IRC essentials, namely, a "window list" and a "nicknames
list." But what even existing users may not know is that ERC already has
both; they just don't quite work the way folks coming from other clients
might expect. This patch aims to address that as if it were a problem.

What's being proposed here is the addition of two new modules built
entirely on functionality already offered by their host libraries,
erc-status-sidebar.el and erc-speedbar.el. What's different is these
additions flirt with something somewhat verboten in ERC, and that's
changing existing defaults for non-security reasons (in this case,
chiefly for unifying UX [1]). Beyond that, these changes also hard-wire
potentially offensive choices into some of these defaults while trying
in earnest to ensure old behavior remains accessible. For example, one
module assumes no one with a non-nil `erc-header-line-format' has any
use for modes and topics in a side window. Other baked in preferences
include the nixing of all throwback icons [2] and the showing of
disconnected buffers in a muted face. The list goes on but is open for
discussion, as always.

Another consideration here is of course naming [3]. I've gone ahead and
dubbed the speedbar module 'nickbar' as a bit of an homage to its roots.
`nicklist' wasn't available because a popular module of that name was
once part of ERC, and people still use it today. For status-sidebar, I
went with `bufbar', in part for consistency but also because the
would-be canonical "status-sidebar" is already taken by the side
window's buffer for its major mode. We might also consider going with
the slightly pedestrian `buflist', which is already used by at least one
other IRC client for referring to this feature.

Lastly, I'd like to stress that these modules (thankfully) won't be
loaded by default, which means you'll need to add `bufbar' and `nickbar'
to `erc-modules' when trying them out. Note that this patch set
currently depends on bug#63569 [3], whose changes need applying
beforehand.

Thanks!


[1] My justifications for taking such liberties are at best anecdotal,
    based mostly on personal impressions of prevailing usage patterns
    and the perceived motivations behind them. A few examples:

    a. The relative newness of erc-status-sidebar.el, its lack of an
       associated module, and its absence from ERC's Custom menu all
       point to its defaults being somewhat more free for the changing.
       The speedbar integration likewise lacks a module, and its
       graphical-only nature means its set of users currently excludes
       anyone using ERC from a terminal. (Less expected fallout from the
       proposed churn, IOW.)

    b. Both libraries provide an always-open side window (or, in
       speedbar's case, frame), which imposes a specific layout on the
       user, something that's relatively rare in Emacs outside of
       IDE-style modes. Compare this to something like ibuffer for
       listing buffers or a hypothetical /NAMES buffer, which, if based
       on `tabulated-list-mode', would make for a more familiar means of
       reviewing channel members. The point here is that devoted users
       likely aren't messing with erc-status-sidebar or erc-speedbar in
       droves, preferring more Emacsy alternatives instead.

    c. Newcomers can't be bothered with an overly involved setup if it
       requires carefully exploring options before trying. But they're
       perfectly willing to copy/paste gobs of configuration or even
       mindlessly follow a minutes long Customize itinerary, so long as
       the promise of emerging with something resembling their present
       idea of what makes an IRC client remains within reach. By
       introducing these modules "preconfigured," I'm positing that
       these preconceived notions typically include a reactive window
       list and/or nick list. That said, my hope is that these users
       will eventually gravitate toward the more Emacs-native way of
       doing things, at which point these modules will have served their
       primary purpose (of acting as bait).

[2] My reason for 86'ing the icons outright in the speedbar's new
    "window mode" is consistency. I figure anyone who wants the vanilla
    experience wants it in full and thus also wants a separate frame.
    That said, I suppose we could add a knob for tweaking this (or any
    of the other hard-coded choices mentioned), but IMO doing that
    unprovoked just contributes to "options sprawl."

[3] FWIW, all module names in contention flout our supposed policy of
    preferring those that align with host libraries and the features
    they `provide'.


In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.17.6) of 2023-05-13 built on localhost
Repository revision: 867b104010760c4b7cd700078884cc774a01860a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 37 (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 time-date 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 auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map format-spec
cl-loaddefs cl-lib erc-backend 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 64236 9476)
 (symbols 48 8573 0)
 (strings 32 23246 1709)
 (string-bytes 1 674076)
 (vectors 16 15015)
 (vector-slots 8 207266 8159)
 (floats 8 24 33)
 (intervals 56 229 0)
 (buffers 976 10))
[0001-5.6-Fix-buffer-mismatch-bug-in-erc-scroll-to-bottom.patch (text/x-patch, attachment)]
[0002-5.6-Allow-ERC-s-module-toggles-access-to-the-prefix-.patch (text/x-patch, attachment)]
[0003-5.6-Add-preset-styles-to-erc-status-sidebar.patch (text/x-patch, attachment)]
[0004-5.6-Add-erc-status-sidebar-integration-to-erc-speedb.patch (text/x-patch, attachment)]
[0005-5.6-Add-new-ERC-modules-bufbar-and-nickbar.patch (text/x-patch, attachment)]

Message #6 received at 63595-quiet <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595-quiet <at> debbugs.gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Fri, 19 May 2023 13:44:01 -0700
[Message part 1 (text/plain, inline)]
Screenshot storage:

[erc-sidebar-graphical.png (image/png, attachment)]
[erc-sidebar-terminal.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Fri, 19 May 2023 20:49:01 GMT) Full text and rfc822 format available.

Message #9 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Fri, 19 May 2023 13:47:59 -0700
Screenshots (modus themed but otherwise vanilla):

graphical:

  https://debbugs.gnu.org/cgi/bugreport.cgi?filename=erc-sidebar-graphical.png;bug=63595;att=1;msg=6

terminal:

  https://debbugs.gnu.org/cgi/bugreport.cgi?msg=6;att=2;filename=erc-sidebar-terminal.png;bug=63595




Reply sent to "J.P." <jp <at> neverwas.me>:
You have taken responsibility. (Fri, 14 Jul 2023 02:08:02 GMT) Full text and rfc822 format available.

Notification sent to "J.P." <jp <at> neverwas.me>:
bug acknowledged by developer. (Fri, 14 Jul 2023 02:08:02 GMT) Full text and rfc822 format available.

Message #14 received at 63595-done <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595-done <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Thu, 13 Jul 2023 19:07:46 -0700
A more refined version of these changes has been installed [1]. However,
they're more likely than most to be imperfect due to their relative
complexity and the lack of effective tests, not to mention the kludgy
nature of the new speedbar module (whose frame we're hiding in favor of
showing its buffer in a side window). Hopefully, these new features will
lead to increased use, which should help exorcise the worst of their
demons.

Closing (for now).

[1] https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ded35c2d
    https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3c70e85d




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Tue, 25 Jul 2023 13:33:01 GMT) Full text and rfc822 format available.

Message #17 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Tue, 25 Jul 2023 06:32:36 -0700
[Message part 1 (text/plain, inline)]
This may come as a shock, but problems exist in the `bufbar' changes
recently introduced (by me) to erc-status-sidebar.el.

The first involves the new boolean option `erc-status-sidebar-singular'.
No matter what its doc string says, the purpose of this option remains
difficult to describe and its behavior hard to predict. This makes it
only really practical as an internal flag, which is what it should have
been from the get-go and how it's been repurposed in the attached patch.
Initially, this option was intended to alter the behavior of the
minor-mode toggle `erc-bufbar-mode' so that when the option is nil,
toggling the mode in a frame where the sidebar is hidden would summon
it, regardless of the value of the mode's variable. This kind of extreme
DWIM'ness may suit normal, standalone minor modes, but users likely
expect mode toggles for global ERC modules to work more or less
traditionally.

A somewhat related problem stems from my altering the original behavior
of existing status-sidebar commands, like `erc-status-sidebar-open', to
accommodate and promote `erc-bufbar-mode' as a unified entry point. In
retrospect, that probably threatens to anger the rare person who's
become accustomed to those commands over the past couple years and who
may not be interested in the new module at all (for whatever reason).
I've attempted to rectify this in the attached patch so that the newer
behavior only takes effect when `erc-bufbar-mode' is active. This means
users of the module must now issue an M-x erc-status-sidebar-open RET to
see the sidebar in (additional) frames that don't yet have one, but
non-module users will still only ever encounter a single sidebar
instance in an Emacs session.

The last issue involves the sidebar intermittently clobbering the
window's scroll position. I've tried to eradicate this while also
improving the overall responsiveness by having it refresh when users
select another window. Basically, updates were initially tethered to
mode-line changes, which often left users with the wrong buffer
highlighted whenever updates were few and far between. Although this is
now much improved, the change likely adds some overhead, so I've
included an escape hatch while we investigate further.

[0001-5.6-Simplify-multi-frame-behavior-of-erc-bufbar-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Sat, 29 Jul 2023 00:01:02 GMT) Full text and rfc822 format available.

Message #20 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Fri, 28 Jul 2023 17:00:01 -0700
"J.P." <jp <at> neverwas.me> writes:

> This may come as a shock, but problems exist in the `bufbar' changes
> recently introduced (by me) to erc-status-sidebar.el.

I've attempted to address these issues in

  deb74de4 Simplify multi-frame behavior in erc-bufbar-mode

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Wed, 16 Aug 2023 14:05:02 GMT) Full text and rfc822 format available.

Message #23 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Wed, 16 Aug 2023 07:04:26 -0700
[Message part 1 (text/plain, inline)]
Some issues with the `nickbar' module have surfaced that may be related
to another issue involving unexpected connection loss. Thanks to Corwin
for reporting this.

It appears that the teardown logic in `erc-nickbar-disable' was calling
`dframe-close-frame', `speedbar-set-timer', and `speedbar-timer-fn'
repeatedly and unnecessarily, which resulted in redundant scheduling of
the same update timer (there should only be one per speedbar instance).
Other problems involving the variable `speedbar-update-flag' were also
discovered, as well as a possible bug in `dframe-set-timer', which I'll
leave for future people familiar with dframe to deal with if necessary.

[0001-5.6-Prevent-unwanted-recursion-in-erc-nickbar-disabl.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Sun, 20 Aug 2023 17:24:01 GMT) Full text and rfc822 format available.

Message #26 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: Corwin Brust <corwin <at> bru.st>
To: "J.P." <jp <at> neverwas.me>
Cc: 63595 <at> debbugs.gnu.org, emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Sun, 20 Aug 2023 12:23:30 -0500
TL;DR: Couldn't apply; can you double check?

detail below and thanks for the insta-response!

On Wed, Aug 16, 2023 at 9:04 AM J.P. <jp <at> neverwas.me> wrote:
>
> Some issues with the `nickbar' module have surfaced that may be related
> to another issue involving unexpected connection loss. Thanks to Corwin
> for reporting this.
>

corwi <at> Avalon MINGW64 /h/emacs-dev/emacs-nt
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

corwi <at> Avalon MINGW64 /h/emacs-dev/emacs-nt
$ git apply /c/Users/corwi/Downloads/0001-5.6-Prevent-unwanted-recursion-in-erc-nickbar-disabl.patch
error: patch failed: lisp/erc/erc-speedbar.el:439
error: lisp/erc/erc-speedbar.el: patch does not apply
error: patch failed: test/lisp/erc/erc-scenarios-status-sidebar.el:94
error: test/lisp/erc/erc-scenarios-status-sidebar.el: patch does not apply
error: patch failed: test/lisp/erc/resources/erc-scenarios-common.el:122
error: test/lisp/erc/resources/erc-scenarios-common.el: patch does not apply

corwi <at> Avalon MINGW64 /h/emacs-dev/emacs-nt
$




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Sun, 20 Aug 2023 19:57:01 GMT) Full text and rfc822 format available.

Message #29 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: Corwin Brust <corwin <at> bru.st>
Cc: 63595 <at> debbugs.gnu.org, emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Sun, 20 Aug 2023 12:56:30 -0700
Corwin Brust <corwin <at> bru.st> writes:

> TL;DR: Couldn't apply; can you double check?

Hm, I'm able to apply that patch atop a563ea8 [1].

  $ cd /tmp
  $ git clone --depth 1 https://git.savannah.gnu.org/git/emacs.git
  $ cd emacs
  $ curl -L "$url [2]" | git am

  Applying: Prevent unwanted recursion in erc-nickbar-disable

  $ git status

  On branch master
  Your branch is ahead of 'origin/master' by 1 commit.
    (use "git push" to publish your local commits)
  
  nothing to commit, working tree clean

  $ git log -n2 --oneline

  5104bc0 Prevent unwanted recursion in erc-nickbar-disable
  a563ea8 * lisp/isearch.el (isearch-resume): Add isearch-push-state (bug#65379).

However, as I type this, I'm thinking I should have also tried it with a
minimal ~/.gitconfig as well as after running ./autogen.sh. That said, I
do both in CI (with a slightly updated patch), and it works fine.

> detail below and thanks for the insta-response!
>
> corwi <at> Avalon MINGW64 /h/emacs-dev/emacs-nt
> $ git status
> On branch master
> Your branch is up to date with 'origin/master'.
>
> nothing to commit, working tree clean
>
> corwi <at> Avalon MINGW64 /h/emacs-dev/emacs-nt
> $ git apply /c/Users/corwi/Downloads/0001-5.6-Prevent-unwanted-recursion-in-erc-nickbar-disabl.patch
> error: patch failed: lisp/erc/erc-speedbar.el:439
> error: lisp/erc/erc-speedbar.el: patch does not apply
> error: patch failed: test/lisp/erc/erc-scenarios-status-sidebar.el:94
> error: test/lisp/erc/erc-scenarios-status-sidebar.el: patch does not apply
> error: patch failed: test/lisp/erc/resources/erc-scenarios-common.el:122
> error: test/lisp/erc/resources/erc-scenarios-common.el: patch does not apply
>
> corwi <at> Avalon MINGW64 /h/emacs-dev/emacs-nt
> $

I find it unlikely that none of the hunks apply cleanly. Perhaps this
has something to do with white space/line endings? Maybe you need to
change core.autocrlf or similar?

[1] https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a563ea89633963fb20c4159bd5e8da825ffc2248
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?filename=0001-5.6-Prevent-unwanted-recursion-in-erc-nickbar-disabl.patch;msg=23;bug=63595;att=1




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Mon, 21 Aug 2023 13:57:02 GMT) Full text and rfc822 format available.

Message #32 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: Corwin Brust <corwin <at> bru.st>
To: "J.P." <jp <at> neverwas.me>
Cc: emacs-erc <at> gnu.org, 63595 <at> debbugs.gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Mon, 21 Aug 2023 08:55:45 -0500
Thank you; I think this fixes things and should be applied.

On Sun, Aug 20, 2023 at 2:56 PM J.P. <jp <at> neverwas.me> wrote:
>
> Corwin Brust <corwin <at> bru.st> writes:
>
> > TL;DR: Couldn't apply; can you double check?
>
>   $ curl -L "$url [2]" | git am
>
> I find it unlikely that none of the hunks apply cleanly. Perhaps this
>
> [2] https://debbugs.gnu.org/cgi/bugreport.cgi?filename=0001-5.6-Prevent-unwanted-recursion-in-erc-nickbar-disabl.patch;msg=23;bug=63595;att=1
>

Quite right; thanks for pointing out the improbability of no hunks
applying; the command you suggested worked fine.

Moreover, I believe this patch solves the issue (or helps enough I
can't notice it).  Since applying I see no difference in how often I'm
disconnected between patched ERC, ERC without nickbar, and hexchat,
all running on the same system connected to the same bouncer.  (Prior
to the patch ERC with nickbar running was disconnected much more often
than hexchat).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Thu, 31 Aug 2023 13:32:02 GMT) Full text and rfc822 format available.

Message #35 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Thu, 31 Aug 2023 06:30:43 -0700
This feature introduced a couple auxiliary modules to serve as higher
level wrappers around newer functionality that was awkwardly bolted onto
the existing libraries erc-status-sidebar and erc-speedbar. One of the
stated aims of this bug's initial proposal was to unify the UI for this
flavor of transitory, command-focused module [1]. However, anyone paying
close enough attention will have noticed I've already faltered in this
regard.

Look at the minor-mode toggle `erc-bufbar-mode' and notice that, when
disabling, it tears down the mode completely, destroying all assets. To
make it easy to show and hide its window without alternately shutting
down and starting anew with every other toggle, I turned to contextually
overloading the existing commands `erc-status-sidebar-toggle' and
friends to behave specially when `erc-bufbar-mode' is active [2].

Contrast this with the approach taken for `erc-nickbar-mode', whose
namesake command is of the all-in-one, kitchen-sink variety. Toggling
off merely hides its window and preserves the speedbar session (its
hidden frame, buffer, etc.). To actually kill it off completely, you
invoke the toggle with a negative prefix argument.

Obviously, these must be reconciled somehow, or one must be made to
mimic the other. I'm leaning toward changing `nickbar' by adding a
second command to toggle it without shutting it down, and then having
the main minor-mode toggle always do a full shutdown. This probably
aligns more with prevailing expectations and traditional Emacs semantics
that assume a nil `erc-nickbar-mode' variable indicates not only a
logical disabled activation state but that the mode is completely
destroyed.

Therefore, unless anyone has any better ideas, I'll provide a patch
shortly that does something to this effect.

Thanks.


[1] To recap, the trend in recent years has been to downplay the use of
    a module's minor-mode toggle as a viable entry point for enabling
    its functionality. Rather, there's been a focus on emphasizing
    membership in `erc-modules' as the preferred means of doing so. The
    reasons are manifold but ultimately rooted in attaining more
    predictable behavior and tighter inter-module interop across the
    board. However, this paradigm necessarily couples a module's
    activation state to the lifetime of an IRC session, which doesn't
    always make sense. Some modules, by their very nature, are
    intrinsically interactive and ephemeral. IOW, they're minor-modes
    first and modules second.

[2] Note the traditional library namespace prefix, which probably
    hampers discoverability for users of the module. We could alias the
    transitory toggles (at least) to reflect the new module names, but
    that may just confuse things further because the new options would
    all continue to sport library prefixes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Thu, 31 Aug 2023 13:34:01 GMT) Full text and rfc822 format available.

Message #38 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: Corwin Brust <corwin <at> bru.st>, emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Thu, 31 Aug 2023 06:33:02 -0700
Corwin Brust <corwin <at> bru.st> writes:

> Moreover, I believe this patch solves the issue (or helps enough I
> can't notice it).  Since applying I see no difference in how often I'm
> disconnected between patched ERC, ERC without nickbar, and hexchat,
> all running on the same system connected to the same bouncer.  (Prior
> to the patch ERC with nickbar running was disconnected much more often
> than hexchat).

FTR, this was applied as:

  commit f8b710e54fb8b29f39bf021ccfb993f881b0134a
  Author: F. Jason Park <jp <at> neverwas.me>
  Date:   Tue Aug 15 21:14:07 2023 -0700
  
      Prevent unwanted recursion in erc-nickbar-disable
      
   lisp/erc/erc-speedbar.el                        | 112 +++++++++++++++---------
   test/lisp/erc/erc-scenarios-status-sidebar.el   |  13 ++-
   test/lisp/erc/resources/erc-scenarios-common.el |   1 +
   3 files changed, 79 insertions(+), 47 deletions(-)

Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 29 Sep 2023 11:24:10 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Thu, 07 Dec 2023 04:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Thu, 07 Dec 2023 07:27:02 GMT) Full text and rfc822 format available.

Message #45 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Wed, 06 Dec 2023 23:26:07 -0800
[Message part 1 (text/plain, inline)]
One thing this feature left unaddressed was the inclusion of all
available channel-membership prefixes in the "nickbar" (speedbar).
Currently, only members with a "+" or "@" have their nicks augmented.
Given the recent improvements to channel-mode parsing, it's now easier
to offer the full slate of prefixes. See attached.

[0009-5.6-Make-erc-get-user-mode-prefix-more-flexible.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Jan 2024 12:24:11 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Fri, 19 Jan 2024 02:34:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Fri, 19 Jan 2024 02:44:02 GMT) Full text and rfc822 format available.

Message #52 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Thu, 18 Jan 2024 18:42:55 -0800
I'm unsure whether there's a regression present on HEAD affecting
erc-speedbar (now the `nickbar' module). I've been noticing the idle
timer only seems to run after user input has been received and dealt
with. IOW, updates don't occur if simply leaving the window open and
otherwise not interacting with Emacs. I suppose we could run the timer
function manually, like on `erc-post-insert-hook' (perhaps guarded by
some debouncing logic), but I'd only want to do so if we can confirm
this isn't a regression.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Thu, 25 Jan 2024 21:43:02 GMT) Full text and rfc822 format available.

Message #55 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Thu, 25 Jan 2024 13:41:52 -0800
"J.P." <jp <at> neverwas.me> writes:

> I'm unsure whether there's a regression present on HEAD affecting
> erc-speedbar (now the `nickbar' module). I've been noticing the idle
> timer only seems to run after user input has been received and dealt
> with. IOW, updates don't occur if simply leaving the window open and
> otherwise not interacting with Emacs. I suppose we could run the timer
> function manually, like on `erc-post-insert-hook' (perhaps guarded by
> some debouncing logic), but I'd only want to do so if we can confirm
> this isn't a regression.

This wasn't a regression but rather a faulty observation on account of
my ignorance regarding how idle timers work. In essence: no input, no
reset (no next run). To address this, I've implemented something like
the more robust manual trigger approach mentioned above:

  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=aae131b8

This bug is already closed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Feb 2024 12:24:16 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Sun, 31 Mar 2024 23:50:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Mon, 01 Apr 2024 01:43:02 GMT) Full text and rfc822 format available.

Message #62 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Sun, 31 Mar 2024 18:42:15 -0700
[Message part 1 (text/plain, inline)]
It's been reported that the nickbar (speedbar) window doesn't display
the cursor on at least one user's setup. I've found this to be true by
default on non-graphic displays. The attached patch should fix the
latter regression. As to whether it also fixes the reporter's issue is
TBD.

It's also been reported that the dframe timer can signal a

  (wrong-type-argument window-live-p nil)

which then gets trapped by the

  (with-demoted-errors "DFRAME TIMER ERROR: %S"...)

in `dframe-timer-fn'. Unfortunately, remediation is trickier here
because we've got to inspect calls to `window-live-p' stemming from
`speedbar-timer-fn', possibly via `erc-speedbar-insert-user'. (What we
really need is a backtrace from the bug reporter.)

[0001-5.6-Fix-invisible-erc-speedbar-cursor-in-text-termin.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Mon, 01 Apr 2024 05:59:02 GMT) Full text and rfc822 format available.

Message #65 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Sun, 31 Mar 2024 22:58:37 -0700
"J.P." <jp <at> neverwas.me> writes:

> It's also been reported that the dframe timer can signal a
>
>   (wrong-type-argument window-live-p nil)
>
> which then gets trapped by the
>
>   (with-demoted-errors "DFRAME TIMER ERROR: %S"...)
>
> in `dframe-timer-fn'. Unfortunately, remediation is trickier here
> because we've got to inspect calls to `window-live-p' stemming from
> `speedbar-timer-fn', possibly via `erc-speedbar-insert-user'. (What we
> really need is a backtrace from the bug reporter.)

Actually, I think my initial "analysis" is flawed. Of the two obvious
paths to `window-live-p' from `speedbar-timer-fn', namely

  internal--after-save-selected-window
  save-selected-window
  speedbar-center-buffer-smartly
  erc-speedbar-expand-channel
  erc-speedbar-buttons
  speedbar-update-special-contents
  speedbar-timer-fn
  dframe-timer-fn
  timer-event-handler

and

  window-normalize-window
  unrecord-window-buffer
  replace-buffer-in-windows
  kill-buffer
  format-spec
  erc-nicks--gen-key-from-format-spec and let*
  erc-nicks--highlight save-current-buffer and let* let
  erc-speedbar--compose-nicks-face apply
  speedbar-make-tag-line
  erc-speedbar-insert-user
  erc-speedbar-expand-channel
  erc-speedbar-buttons
  speedbar-update-special-contents
  speedbar-timer-fn
  dframe-timer-fn
  timer-event-handler

neither seems capable of producing a `wrong-type-argument' error for
`window-live-p' (especially not directly, since that function appears to
accept any lisp object without protest).

Rather, I think the error may originate from some other function that
tests for `window-live-p' and signals a `wrong-type-argument' somehow,
possibly via something like CHECK_LIVE_WINDOW, which appears in a
handful of related definitions, such as `set-frame-selected-window'. In
any case, because this line of reasoning may also be nonsense, I think
we need a reliable repro recipe before proceeding further.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63595; Package emacs. (Tue, 09 Apr 2024 18:18:01 GMT) Full text and rfc822 format available.

Message #68 received at 63595 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 63595 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#63595: 30.0.50; ERC 5.6: Add buffer-list and nick-list modules
Date: Tue, 09 Apr 2024 11:17:42 -0700
"J.P." <jp <at> neverwas.me> writes:

> It's been reported that the nickbar (speedbar) window doesn't display
> the cursor on at least one user's setup. I've found this to be true by
> default on non-graphic displays. The attached patch should fix the
> latter regression. As to whether it also fixes the reporter's issue is
> TBD.

This has been installed as

  ee377aaddf9 * Fix invisible erc-speedbar cursor in text terminals

This bug is already closed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 08 May 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 8 days ago.

Previous Next


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