Tags: patch In the early days of IRC, parsing a "MODE" command from the server was comparatively straightforward. There were a few well known letters, some taking a single argument, and a standard set of status prefixes. But somewhere along the line, things got more complicated, and it seems ERC never got the memo. While it may appear obvious that sticking to a hard-coded, heuristics based approach doesn't really accommodate ERC's core tenet of extensibility, the risk of shifting toward something more parameter driven was probably never justifiable without a vocal demand. Or an obvious bug. From emacs -Q: 1. Connect to Libera.Chat 2. Create ##mychan 3. /mode ##mychan +Qu debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil) erc-downcase(nil) erc-update-current-channel-member(nil nil nil nil nil nil nil on ...) erc-update-channel-member("#libera" nil nil nil nil nil nil nil on) erc-update-modes("##mychan" "+Qu" "mynick" "user/foo" "Hi!") The issue here is that ERC doesn't account for ISUPPORT parameters when parsing MODE commands and dispatching handlers. Instead, it simply assumes that +q (or +Q) means someone has just been promoted to a channel owner. I'll admit that although I've been aware of this basic issue for quite some time, I've been hesitant to cross this bridge until 5.7+ because of the potential pitfalls involved. In any case, with a concrete bug having surfaced (courtesy of Corwin), the issue has been forced, and it's one that can't really be papered over responsibly just to avoid holding up the current release. My proposed means of addressing this is mainly contained in the last of the attached patches. The approach comes down to rewriting the most important bits and providing adapters to reroute the rest accordingly. Comments welcome, as always. Thanks. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.6) of 2023-11-15 built on localhost Repository revision: ff1f82cbe3fa9aee354581f2798faaae7163ea44 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 minibuffer-regexp-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 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 derived auth-source eieio eieio-core password-cache json map format-spec erc-backend erc-networks easy-mmode byte-opt bytecomp byte-compile erc-common inline erc-compat cl-seq cl-macs gv pcase rx subr-x cl-loaddefs cl-lib 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 touch-screen 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 gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 123590 9232) (symbols 48 10137 0) (strings 32 24791 2241) (string-bytes 1 837965) (vectors 16 14517) (vector-slots 8 204449 15354) (floats 8 24 31) (intervals 56 245 0) (buffers 984 10))