unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "J.P." <jp@neverwas.me>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 55540@debbugs.gnu.org, 51753@debbugs.gnu.org, emacs-erc@gnu.org,
	Pankaj Jangid <pankaj@codeisgreat.org>
Subject: bug#51753: bug#55540: 29.0.50; ERC launches autojoin-channels in current frame instead of original frame
Date: Tue, 06 Sep 2022 20:10:23 -0700	[thread overview]
Message-ID: <874jxj282o.fsf__25231.0992962279$1662520281$gmane$org@neverwas.me> (raw)
In-Reply-To: <87y1uwr47b.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 06 Sep 2022 16:02:32 +0200")

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "J.P." <jp@neverwas.me> writes:
>
>> Really, the only safe option is `bury' (well, maybe also the proposed
>> frame stuff in Pankaj's patch, but only when an extra, ERC-specific
>> frame already exists, which we can't count on). That said, there's no
>> reason we'd have to stick with existing options/behavior when choosing a
>> new default. I guess it just comes down to what users want to happen.
>
> I think the default action should be to do nothing to the window setup
> at all, and just add the notification to the mode line.

I believe changing the default for `erc-join-buffer' (alone) to `bury'
is the easiest way to achieve that.

Thus, if no one objects within the next week or so, I will add the patch
below or similar to trunk (and what will become ERC 5.5), along with a
related NEWS entry. Thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Bury-new-ERC-buffers-by-default.patch --]
[-- Type: text/x-patch, Size: 5189 bytes --]

From 8b4edbca2771227d4e6ee464ddd210080339f63b Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@neverwas.me>
Date: Tue, 6 Sep 2022 19:09:54 -0700
Subject: [PATCH] Bury new ERC buffers by default

* lisp/erc/erc.el (erc-join-buffer): Change default value to `bury'.
* test/lisp/erc/erc-scenarios-base-reconnect.el
(erc-scenarios-common-base-reconnect-options): Update helper to handle
new default value for option `erc-join-buffer'.
(erc-scenarios-base-reconnect-options--buffer): Update and rename
function `erc-scenarios-base-reconnect-options--default'.
(erc-scenarios-base-reconnect-options--default): Update and rename
function `erc-scenarios-base-reconnect-options--bury'.
---
 lisp/erc/erc.el                               |  3 +-
 test/lisp/erc/erc-scenarios-base-reconnect.el | 45 ++++++++++---------
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 151d75e7ce..657ef8cdb3 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1651,7 +1651,7 @@ erc-default-port-tls
   "IRC port to use for encrypted connections if it cannot be \
 detected otherwise.")
 
-(defcustom erc-join-buffer 'buffer
+(defcustom erc-join-buffer 'bury
   "Determines how to display a newly created IRC buffer.
 
 The available choices are:
@@ -1662,6 +1662,7 @@ erc-join-buffer
   `bury'            - bury it in a new buffer,
   `buffer'          - in place of the current buffer,
   any other value  - in place of the current buffer."
+  :package-version '(ERC . "5.4.1") ; FIXME increment upon publishing to ELPA
   :group 'erc-buffers
   :type '(choice (const :tag "Split window and select" window)
                  (const :tag "Split window, don't select" window-noselect)
diff --git a/test/lisp/erc/erc-scenarios-base-reconnect.el b/test/lisp/erc/erc-scenarios-base-reconnect.el
index 30d692058d..49298dc594 100644
--- a/test/lisp/erc/erc-scenarios-base-reconnect.el
+++ b/test/lisp/erc/erc-scenarios-base-reconnect.el
@@ -99,10 +99,11 @@ erc-scenarios-common--base-reconnect-options
 
     (funcall test)
 
+    ;; A manual /JOIN command tells ERC we're done auto-reconnecting
     (with-current-buffer "FooNet" (erc-cmd-JOIN "#spam"))
 
-    (erc-d-t-wait-for 5 "Channel #spam shown when autojoined"
-      (eq (window-buffer) (get-buffer "#spam")))
+    (erc-d-t-ensure-for 1 "Newly joined chan ignores `erc-reconnect-display'"
+      (not (eq (window-buffer) (get-buffer "#spam"))))
 
     (ert-info ("Wait for auto reconnect")
       (with-current-buffer erc-server-buffer
@@ -114,43 +115,43 @@ erc-scenarios-common--base-reconnect-options
       (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#spam"))
         (funcall expect 10 "her elves come here anon")))))
 
-(ert-deftest erc-scenarios-base-reconnect-options--default ()
+(ert-deftest erc-scenarios-base-reconnect-options--buffer ()
   :tags '(:expensive-test)
-  (should (eq erc-join-buffer 'buffer))
+  (should (eq erc-join-buffer 'bury))
   (should-not erc-reconnect-display)
 
   ;; FooNet (the server buffer) is not switched to because it's
   ;; already current (but not shown) when `erc-open' is called.  See
   ;; related conditional guard towards the end of that function.
 
-  (erc-scenarios-common--base-reconnect-options
-   (lambda ()
-     (pop-to-buffer-same-window "*Messages*")
+  (let ((erc-reconnect-display 'buffer))
+    (erc-scenarios-common--base-reconnect-options
+     (lambda ()
+       (pop-to-buffer-same-window "*Messages*")
 
-     (erc-d-t-ensure-for 1 "Server buffer not shown"
-       (not (eq (window-buffer) (get-buffer "FooNet"))))
+       (erc-d-t-ensure-for 1 "Server buffer not shown"
+         (not (eq (window-buffer) (get-buffer "FooNet"))))
 
-     (erc-d-t-wait-for 5 "Channel #chan shown when autojoined"
-       (eq (window-buffer) (get-buffer "#chan"))))))
+       (erc-d-t-wait-for 5 "Channel #chan shown when autojoined"
+         (eq (window-buffer) (get-buffer "#chan")))))))
 
-(ert-deftest erc-scenarios-base-reconnect-options--bury ()
+(ert-deftest erc-scenarios-base-reconnect-options--default ()
   :tags '(:expensive-test)
-  (should (eq erc-join-buffer 'buffer))
+  (should (eq erc-join-buffer 'bury))
   (should-not erc-reconnect-display)
 
-  (let ((erc-reconnect-display 'bury))
-    (erc-scenarios-common--base-reconnect-options
+  (erc-scenarios-common--base-reconnect-options
 
-     (lambda ()
-       (pop-to-buffer-same-window "*Messages*")
+   (lambda ()
+     (pop-to-buffer-same-window "*Messages*")
 
-       (erc-d-t-ensure-for 1 "Server buffer not shown"
-         (not (eq (window-buffer) (get-buffer "FooNet"))))
+     (erc-d-t-ensure-for 1 "Server buffer not shown"
+       (not (eq (window-buffer) (get-buffer "FooNet"))))
 
-       (erc-d-t-ensure-for 3 "Channel #chan not shown"
-         (not (eq (window-buffer) (get-buffer "#chan"))))
+     (erc-d-t-ensure-for 3 "Channel #chan not shown"
+       (not (eq (window-buffer) (get-buffer "#chan"))))
 
-       (eq (window-buffer) (messages-buffer))))))
+     (eq (window-buffer) (messages-buffer)))))
 
 ;; Upon reconnecting, playback for channel and target buffers is
 ;; routed correctly.  Autojoin is irrelevant here, but for the
-- 
2.37.2


  parent reply	other threads:[~2022-09-07  3:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 13:06 bug#55540: 29.0.50; ERC launches autojoin-channels in current frame instead of original frame Pankaj Jangid
2022-05-20 13:10 ` Lars Ingebrigtsen
2022-05-20 13:31   ` Pankaj Jangid
2022-05-20 13:37     ` Lars Ingebrigtsen
2022-05-23  1:56 ` bug#51753: ERC switches to channel buffer on reconnect J.P.
     [not found] ` <87a6b92ers.fsf@neverwas.me>
2022-05-23  2:50   ` Pankaj Jangid
2022-05-23  7:48     ` J.P.
     [not found]     ` <87fsl0zo2e.fsf@neverwas.me>
2022-08-10 13:15       ` bug#51753: bug#55540: 29.0.50; ERC launches autojoin-channels in current frame J.P.
     [not found]       ` <87a68cnss7.fsf_-_@neverwas.me>
2022-08-11  2:55         ` Pankaj Jangid
     [not found]         ` <87sfm3tro1.fsf@codeisgreat.org>
2022-09-06 11:01           ` bug#51753: bug#55540: 29.0.50; ERC launches autojoin-channels in current frame instead of original frame Lars Ingebrigtsen
2022-09-06 11:01           ` Lars Ingebrigtsen
     [not found]           ` <87o7vsu5pc.fsf_-_@gnus.org>
2022-09-06 13:53             ` J.P.
2022-09-06 13:53             ` bug#51753: " J.P.
     [not found]             ` <87o7vs38yp.fsf@neverwas.me>
2022-09-06 14:02               ` Lars Ingebrigtsen
2022-09-07  3:10                 ` J.P.
2022-09-07  3:10                 ` J.P. [this message]
     [not found]                 ` <874jxj282o.fsf@neverwas.me>
2022-09-07 12:55                   ` Lars Ingebrigtsen
2022-09-07 12:55                   ` bug#51753: " Lars Ingebrigtsen
     [not found]                   ` <87mtbbmjho.fsf@gnus.org>
2022-09-20 13:11                     ` J.P.
2022-09-20 13:11                     ` bug#51753: " J.P.
     [not found]                     ` <87pmfq198w.fsf@neverwas.me>
2022-09-22  3:07                       ` Pankaj Jangid
2022-09-22  3:07                       ` Pankaj Jangid
     [not found]                       ` <87y1uc150p.fsf@codeisgreat.org>
2022-09-22  6:22                         ` bug#51753: " J.P.
2023-04-08 23:25                           ` J.P.
2023-04-08 23:25                           ` J.P.
     [not found]                   ` <87pmg77tpc.fsf@dataswamp.org>
2022-12-30 14:28                     ` J.P.
  -- strict thread matches above, loose matches on Subject: below --
2021-11-10 15:09 bug#51753: ERC switches to channel buffer on reconnect Stefan Kangas
2023-04-14 14:11 ` bug#51753: bug#55540: 29.0.50; ERC launches autojoin-channels in current frame instead of original frame J.P.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='874jxj282o.fsf__25231.0992962279$1662520281$gmane$org@neverwas.me' \
    --to=jp@neverwas.me \
    --cc=51753@debbugs.gnu.org \
    --cc=55540@debbugs.gnu.org \
    --cc=emacs-erc@gnu.org \
    --cc=larsi@gnus.org \
    --cc=pankaj@codeisgreat.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).