Subject: Re: bug#70358: ERC not changing to buffers

From: "J.P." <[email-masked]>
Date: Fri, 12 Apr 2024 19:54:44 -0700

Hi Rahul,

Rahul Martim Juliato <[email-masked]> writes:

> Hello there!
>
> I am not completely sure this is a bug, but since some versions ago (I
> am on emacs 29.3 for Linux), ERC stopped (what I use to remember) a
> behaviour.

Please see this post for context:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62833#14

> If I call ERC with  `M-x erc`, it connects, but keeps the buffer on the
> background, and I have to manually switch to it.
>
> The same with `/join #channel` and other commands.

On HEAD, a new option, `erc-interactive-display', supersedes
`erc-join-buffer' (now called `erc-buffer-display') in interactive
situations, like /JOIN and M-x erc RET. Quoting from etc/ERC-NEWS:

  ** Revised buffer-display handling.
  A point of friction for new users and one only just introduced with
  ERC 5.5 has been the lack of visual feedback when first connecting via
  M-x erc or when issuing a "/JOIN" command at the prompt.  As explained
  below, in the news for 5.5, the discovery of a security issue led to
  most new ERC buffers being "buried" on creation.  On further
  reflection, this was judged to have been an overcorrection in the case
  of interactive invocations, hence the borrowing of an old option,
  'erc-query-display', and the bestowing of a new alias,
  'erc-interactive-display', which better describes its expanded role as
  a more general buffer-display knob for interactive commands ("/QUERY"
  still among them).

> I find it confusing and non-intuitive, it makes the user believe
> something wrong happened. I come from the old school of iirc, Bitchx,
> mIrc, and so on. I can´t remember ever seen such behaviour for issuing
> IRC commands (even on ERC).
>
> Is this a bug? A feature? Is there a custom variable to keep the old
> behaviour?

On 5.5, you can customize `erc-join-buffer' to `buffer'. On 5.6, you'll
be able to do the same with `erc-interactive-display', as mentioned.

> Strangelly if someone `/query me` it pops up a buffer (for that I know
> there's a switch). So, two sides of the same coin I guess?

Right, that's controlled by the option `erc-auto-query', now called
`erc-receive-query-display'. Quoting from etc/ERC-NEWS:

  Accompanying this addition are "display"-suffixed aliases for related
  options 'erc-join-buffer' and 'erc-auto-query', which users have
  reported as being difficult to discover and remember.  When the latter
  option (now known as 'erc-receive-query-display') is nil, ERC uses
  'erc-join-buffer' in its place, much like it does for
  'erc-interactive-display'.  The old nil behavior can still be gotten
  via the new compatibility flag 'erc-receive-query-display-defer'.  The
  relatively new option 'erc-reconnect-display' has likewise been
  renamed, this time for clarity, to 'erc-auto-reconnect-display'.

> If anyone could help me, I'd be more than happy.

The next release of ERC should be out "soon" (though we've been saying
that for months). If you're both super desperate and unwilling to
customize options, there's always the devel package on GNU ELPA [1]. For
non-bug related questions, there's ERC's own mailing list (Cc'd), as
well as the #erc channel on Libera.Chat.

Thanks,
J.P.

P.S. In the future, please consider filing bugs with M-x erc-bug RET or
adding the Emacs or ERC version number to the subject line.

[1] https://emacs-erc.gitlab.io/bugs/archive/doc/erc.html#Upgrading