GNU bug report logs - #54824
29.0.50; Add 'user' parameter to ERC entry-point commands

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "J.P." <jp@HIDDEN>; Keywords: patch; dated Sat, 9 Apr 2022 20:28:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 54824 <at> debbugs.gnu.org:


Received: (at 54824) by debbugs.gnu.org; 10 Apr 2022 12:40:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 10 08:40:46 2022
Received: from localhost ([127.0.0.1]:39712 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ndWs2-0005dj-0m
	for submit <at> debbugs.gnu.org; Sun, 10 Apr 2022 08:40:46 -0400
Received: from quimby.gnus.org ([95.216.78.240]:52540)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1ndWs0-0005dU-1D
 for 54824 <at> debbugs.gnu.org; Sun, 10 Apr 2022 08:40:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References: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=RvnJxuNDn29LgfETCAS/XnZn5ndAYWNDr18kRrljOZY=; b=dElo1fQ+YIG6dGZ6jiwNH2d5v/
 31/Gf4ICZ28Z+UqHRWM+0WD0lmeq+B2aYcLYTL8ojzKnyvHeGba6/TJ5vb59jhtzVKXwFfKH0UJIB
 ezY7P4CXh1q4ceqKwpvIfeV6/qyk80SwLjo9Db5ofNetquqvvIYZrU7aMSmN4+NFicUE=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1ndWrr-0006aa-KE; Sun, 10 Apr 2022 14:40:37 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: "J.P." <jp@HIDDEN>
Subject: Re: bug#54824: 29.0.50; Add 'user' parameter to ERC entry-point
 commands
References: <87sfqmgfyn.fsf@HIDDEN>
X-Now-Playing: Arto Lindsay's _Cuidado Madame_: =?utf-8?Q?=22V=C3=A3o?=
 queimar ou botando pra =?utf-8?Q?dan=C3=A7ar=22?=
Date: Sun, 10 Apr 2022 14:40:33 +0200
In-Reply-To: <87sfqmgfyn.fsf@HIDDEN> (J. P.'s message of "Sat, 09 Apr
 2022 13:27:28 -0700")
Message-ID: <87tub1p0vy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: "J.P." <jp@HIDDEN> writes: > This patch aims to change
 that. See #48598 for accompanying tweaks to > doc/misc/erc.texi. Thanks.
 Skimming the patch, it looks OK to me. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54824
Cc: 54824 <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 (---)

"J.P." <jp@HIDDEN> writes:

> This patch aims to change that. See #48598 for accompanying tweaks to
> doc/misc/erc.texi. Thanks.

Skimming the patch, it looks OK to me.

> P.S. Bonus question: should the username be configurable when invoking
> an entry point interactively? Or would that just be excess noise?

I don't think that would be useful in general.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54824; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Apr 2022 20:27:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 09 16:27:45 2022
Received: from localhost ([127.0.0.1]:38756 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ndHgO-0002tU-7o
	for submit <at> debbugs.gnu.org; Sat, 09 Apr 2022 16:27:44 -0400
Received: from lists.gnu.org ([209.51.188.17]:33738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1ndHgM-0002tM-49
 for submit <at> debbugs.gnu.org; Sat, 09 Apr 2022 16:27:42 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33642)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1ndHgL-0000We-VG
 for bug-gnu-emacs@HIDDEN; Sat, 09 Apr 2022 16:27:41 -0400
Received: from mail-108-mta62.mxroute.com ([136.175.108.62]:40199)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1ndHgJ-0001o0-6q
 for bug-gnu-emacs@HIDDEN; Sat, 09 Apr 2022 16:27:41 -0400
Received: from filter006.mxroute.com ([140.82.40.27]
 140.82.40.27.vultrusercontent.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta62.mxroute.com (ZoneMTA) with ESMTPSA id 1801002a9a1000fe85.001
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Sat, 09 Apr 2022 20:27:31 +0000
X-Zone-Loop: b7cd949443f4bedc263f4e1013de615df44bae153ffb
X-Originating-IP: [140.82.40.27]
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=tl9bdRsD1sgUVBkWspmZeauCpcg9y9unMBPuuWo4JkU=; b=YLcdaqsIPx4sShFSOl/5B6f/ji
 65NaLZblw3KB2y/aKsMOUA+CfE7Fgs6zBN2YkAyFfRIhQCIBGoba9zeZE6ax4m6f0hWIhFcE+4/3F
 fIUIjcHAHJXrGTrWK/fPJ9fJ5rvnxmikDk3XtLDnNa21+lP8oRgeOw9HkkecsO6jR04dfDsf3JgFk
 aCQTRXM0N9WQFX3j9p0KGVpT/7OFF6oZSZ0EYTHAKAOhSc2KMwBVXDWR3EVRZ5hzEZXzMdrLBHJFY
 HpVfsQrph3hqhZwqgebQZx66MHlCO8MaKoi22SonK0O7++tbNeY2T60irdfxfa8bHdLv8NSyD1Gm5
 1dKRRANg==;
From: "J.P." <jp@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; Add 'user' parameter to ERC entry-point commands
X-Debbugs-CC: emacs-erc@HIDDEN
Date: Sat, 09 Apr 2022 13:27:28 -0700
Message-ID: <87sfqmgfyn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
Received-SPF: pass client-ip=136.175.108.62; envelope-from=jp@HIDDEN;
 helo=mail-108-mta62.mxroute.com
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,
 DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_FILL_THIS_FORM_FRAUD_PHISH=0.01, T_FILL_THIS_FORM_SHORT=0.01,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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

One of the first messages emitted in a traditional IRC exchange is the
USER command [1]. Its first parameter is referred to variously as
username, login, and user ID. Historically, IRCds would sometimes derive
the user portion of a message's "source" field, from this parameter,
yielding something like :nick!~user@hostname for messages relayed on a
client's behalf. But that spot was long ago usurped by the account
services username, and over time, the role of the plain username has
diminished to the point where some progressives now consider it
essentially meaningless. ERC was perhaps ahead of its time in this
regard, having only ever afforded it second-class status.

However. This perceived irrelevance hasn't stopped various IRCds and
bouncers from requisitioning the field for their own devices. One
example is the quasi convention of

  <bouncer-account>@<client-id>/<configured-network-id>

popularized by BNCs like ZNC. A common source of frustration for new ERC
users relying on such endpoints is finding a way to specify a value for
this temporarily, for a single entry-point invocation. Central to this
issue is the fact that by default, ERC connections are "asynchronous."
Indeed, let-binding this variable while invoking an entry point often
fails because its extent evaporates before it can exert any influence.
As such, users are tripped up when wanting to fire off multiple
entry-point commands at once or in rapid succession.

This patch aims to change that. See #48598 for accompanying tweaks to
doc/misc/erc.texi. Thanks.

P.S. Bonus question: should the username be configurable when invoking
an entry point interactively? Or would that just be excess noise?


[1] https://modern.ircdocs.horse/#user-message


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.31, cairo version 1.17.4)
 of 2022-04-05 built on localhost
Repository revision: e2fb5ecaea67497224455fdbfe4850a5a74c9d00
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 35 (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 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 rmc puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search time-date seq gv
subr-x byte-opt bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip 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
simple cl-generic 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 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 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 43818 5691)
 (symbols 48 5713 1)
 (strings 32 15808 1645)
 (string-bytes 1 527821)
 (vectors 16 12098)
 (vector-slots 8 168912 12189)
 (floats 8 20 34)
 (intervals 56 221 0)
 (buffers 992 10))

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Accept-user-keyword-arg-in-ERC-entry-point-commands.patch

From 273bd46760fbe01b57874d7e74e5ff41ee1817c4 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Sun, 3 Apr 2022 14:24:24 -0700
Subject: [PATCH] Accept user keyword arg in ERC entry-point commands

* lisp/erc/erc-backend.el (erc-server-reconnect): Reuse the username
argument from the previous session's USER command when reconnecting.
Also pass the existing client certificate, fixing an issue related to
bug#47788.
(erc-session-user-full-name): Move variable here from erc.el.
(erc-session-username): Add new local variable to store entry point
parameter.

* lisp/erc/erc.el (erc-session-user-full-name): Move variable to
erc-backend.
(erc-open, erc-determine-parameters, erc, erc-tls): Accept new
optional user parameter.
(erc-query): Preserve current `erc-session-username' when calling
`erc-open'.
(erc-login): Use `erc-session-username' instead of deriving it.
(erc-compute-user): Add new function to determine user name from
explicit argument or user options.
---
 lisp/erc/erc-backend.el | 12 +++++++++++-
 lisp/erc/erc.el         | 32 ++++++++++++++++++++------------
 2 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 398fe6cc9e..101c9e199d 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -124,6 +124,14 @@ erc-server-current-nick
   "Nickname on the current server.
 Use `erc-current-nick' to access this.")
 
+(defvar-local erc-session-user-full-name nil
+  "Real name used for the current session.
+Sent as the last argument to the USER command.")
+
+(defvar-local erc-session-username nil
+  "Username used for the current session.
+Sent as the first argument of the USER command.")
+
 ;;; Server attributes
 
 (defvar-local erc-server-process nil
@@ -585,7 +593,9 @@ erc-server-reconnect
       (let ((erc-server-connect-function (or erc-session-connector
                                              #'erc-open-network-stream)))
         (erc-open erc-session-server erc-session-port erc-server-current-nick
-                  erc-session-user-full-name t erc-session-password)))))
+                  erc-session-user-full-name t erc-session-password
+                  nil nil nil erc-session-client-certificate
+                  erc-session-username)))))
 
 (defun erc-server-delayed-reconnect (buffer)
   (if (buffer-live-p buffer)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 52fe106f2d..f2106db5f3 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1802,9 +1802,6 @@ erc-buffer-list-with-nick
 (defvar-local erc-default-recipients nil
   "List of default recipients of the current buffer.")
 
-(defvar-local erc-session-user-full-name nil
-  "Full name of the user on the current server.")
-
 (defvar-local erc-channel-user-limit nil
   "Limit of users per channel.")
 
@@ -1971,8 +1968,8 @@ erc-setup-buffer
 
 (defun erc-open (&optional server port nick full-name
                            connect passwd tgt-list channel process
-                           client-certificate)
-  "Connect to SERVER on PORT as NICK with FULL-NAME.
+                           client-certificate user)
+  "Connect to SERVER on PORT as NICK with USER and FULL-NAME.
 
 If CONNECT is non-nil, connect to the server.  Otherwise assume
 already connected and just create a separate buffer for the new
@@ -2079,7 +2076,7 @@ erc-open
       (erc-display-prompt)
       (goto-char (point-max)))
 
-    (erc-determine-parameters server port nick full-name)
+    (erc-determine-parameters server port nick full-name user)
 
     ;; Saving log file on exit
     (run-hook-with-args 'erc-connect-pre-hook buffer)
@@ -2200,6 +2197,7 @@ erc-select-read-args
 (cl-defun erc (&key (server (erc-compute-server))
                     (port   (erc-compute-port))
                     (nick   (erc-compute-nick))
+                    (user   (erc-compute-user))
                     password
                     (full-name (erc-compute-full-name)))
   "ERC is a powerful, modular, and extensible IRC client.
@@ -2211,6 +2209,7 @@ erc
    (server (erc-compute-server))
    (port   (erc-compute-port))
    (nick   (erc-compute-nick))
+   (user   (erc-compute-user))
    password
    (full-name (erc-compute-full-name))
 
@@ -2222,7 +2221,7 @@ erc
 whereas `erc-compute-port' and `erc-compute-nick' will be invoked
 for the values of the other parameters."
   (interactive (erc-select-read-args))
-  (erc-open server port nick full-name t password))
+  (erc-open server port nick full-name t password nil nil nil nil user))
 
 ;;;###autoload
 (defalias 'erc-select #'erc)
@@ -2232,6 +2231,7 @@ 'erc-ssl
 (cl-defun erc-tls (&key (server (erc-compute-server))
                         (port   (erc-compute-port))
                         (nick   (erc-compute-nick))
+                        (user   (erc-compute-user))
                         password
                         (full-name (erc-compute-full-name))
                         client-certificate)
@@ -2275,7 +2275,7 @@ erc-tls
 		 (erc-select-read-args)))
   (let ((erc-server-connect-function 'erc-open-tls-stream))
     (erc-open server port nick full-name t password
-              nil nil nil client-certificate)))
+              nil nil nil client-certificate user)))
 
 (defun erc-open-tls-stream (name buffer host port &rest parameters)
   "Open an TLS stream to an IRC server.
@@ -4305,7 +4305,8 @@ erc-query
                        nil
                        (list target)
                        target
-                       erc-server-process)))
+                       erc-server-process
+                       erc-session-username)))
     (unless buf
       (error "Couldn't open query window"))
     (erc-update-mode-line)
@@ -6147,14 +6148,14 @@ erc-login
   (erc-server-send
    (format "USER %s %s %s :%s"
            ;; hacked - S.B.
-           (if erc-anonymous-login erc-email-userid (user-login-name))
+           erc-session-username
            "0" "*"
            erc-session-user-full-name))
   (erc-update-mode-line))
 
 ;; connection properties' heuristics
 
-(defun erc-determine-parameters (&optional server port nick name)
+(defun erc-determine-parameters (&optional server port nick name user)
   "Determine the connection and authentication parameters.
 Sets the buffer local variables:
 
@@ -6162,11 +6163,13 @@ erc-determine-parameters
 - `erc-session-server'
 - `erc-session-port'
 - `erc-session-user-full-name'
+- `erc-session-username'
 - `erc-server-current-nick'"
   (setq erc-session-connector erc-server-connect-function
         erc-session-server (erc-compute-server server)
         erc-session-port (or port erc-default-port)
-        erc-session-user-full-name (erc-compute-full-name name))
+        erc-session-user-full-name (erc-compute-full-name name)
+        erc-session-username (erc-compute-user user))
   (erc-set-current-nick (erc-compute-nick nick)))
 
 (defun erc-compute-server (&optional server)
@@ -6184,6 +6187,10 @@ erc-compute-server
       (getenv "IRCSERVER")
       erc-default-server))
 
+(defun erc-compute-user (&optional user)
+  "Return a suitable value for the session user name."
+  (or user (if erc-anonymous-login erc-email-userid (user-login-name))))
+
 (defun erc-compute-nick (&optional nick)
   "Return user's IRC nick.
 
@@ -7012,6 +7019,7 @@ erc-get-parsed-vector-type
 ;; Teach url.el how to open irc:// URLs with ERC.
 ;; To activate, customize `url-irc-function' to `url-irc-erc'.
 
+;; FIXME change user to nick, and use API to find server buffer
 ;;;###autoload
 (defun erc-handle-irc-url (host port channel user password)
   "Use ERC to IRC on HOST:PORT in CHANNEL as USER with PASSWORD.
-- 
2.35.1


--=-=-=--




Acknowledgement sent to "J.P." <jp@HIDDEN>:
New bug report received and forwarded. Copy sent to emacs-erc@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to emacs-erc@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#54824; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 10 Apr 2022 12:45:01 UTC

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