From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rahul Martim Juliato Newsgroups: gmane.emacs.bugs Subject: bug#73545: 30.0.91; Strange behaviour on switch-to-next-buffer Date: Thu, 3 Oct 2024 18:19:23 -0300 Message-ID: <20241003211923.yablw6b4bwdydcxk@debian> References: <20240929042521.cgiwkts2ot6ms2tx@debian> <86y13b3too.fsf@gnu.org> <20240929122956.y5hptf3yolu4jmpy@debian> <86jzeu4o8p.fsf@gnu.org> <8cfbc823-ad1a-4ad6-90a6-fdf18baac037@gmx.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zimhclzppwgtk73s" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73545@debbugs.gnu.org, Eli Zaretskii , Rahul Martim Juliato To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 03 23:21:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1swTGA-0002Iy-TX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Oct 2024 23:21:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swTFt-0003gq-Jc; Thu, 03 Oct 2024 17:21:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swTFs-0003gh-PL for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 17:21:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swTFs-0003Mh-H6 for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 17:21:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:Date:From:To:Subject; bh=Z+Hp2Wc8ZdnoqMXdfR+0XwzdiTfUNEPQmLRvNNqjLqw=; b=AbQPZp1L/haTWKJpU6bQHVrCEWR7FLAz/mvXCLJl8WkXF8c32jeDPt/NXf2gYP4x3/ySM/ep6yWL3oayNRaUjlNPEyF7Rhy8S/gjvqsW1wCHjeg2xMNJHORvJFSKhB7AZ24jAsm9Y2bYro48jbrnAkeWOuTseOChxkH4m2VoIUaRj/EP2yEzk8CWKusHR1gV4z2iF9iyOfI+uZa10F71LbCqLoPwnjYTKwFspiW+Cf2CFjk8PiyxwD/vvsFbqgDFvKrv9SVO+slDyNUMMMu4Mbjnc/eIFQicnReRVtUaO7rxaxvp8gEXntA7GpUxlHAVNm9kqGwpt42Hmev0qkg93Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swTFu-0004SL-Ml for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 17:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rahul Martim Juliato Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Oct 2024 21:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73545 X-GNU-PR-Package: emacs Original-Received: via spool by 73545-submit@debbugs.gnu.org id=B73545.172799043517084 (code B ref 73545); Thu, 03 Oct 2024 21:21:02 +0000 Original-Received: (at 73545) by debbugs.gnu.org; 3 Oct 2024 21:20:35 +0000 Original-Received: from localhost ([127.0.0.1]:33987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swTFT-0004RT-0B for submit@debbugs.gnu.org; Thu, 03 Oct 2024 17:20:35 -0400 Original-Received: from mail-pl1-f176.google.com ([209.85.214.176]:44257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swTFQ-0004RL-R4 for 73545@debbugs.gnu.org; Thu, 03 Oct 2024 17:20:33 -0400 Original-Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-20b6c311f62so13481965ad.0 for <73545@debbugs.gnu.org>; Thu, 03 Oct 2024 14:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727990369; x=1728595169; darn=debbugs.gnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=Z+Hp2Wc8ZdnoqMXdfR+0XwzdiTfUNEPQmLRvNNqjLqw=; b=f8nfaOnfD+Fn+Qckk4IpLwzt5NA/WdociMf+0gvgOpmgQfOLOAdLVO46zSZcWkSGXV pYgyv+PqGqdn0eh3q3ejFdnsemLM+KvV2dutLTs9Uu9tXXacEvLCdWhOFqprFWZpBwj6 OdgDOCdS5Iomf+/UtqO5cM5IyYIKybRfQ92Ck4MjEhh8yVVEnRHQ7pqiSHPBs15Iy2xy RKUZ3+uGAGU5YC3Mo9Sja/lqfRqMV/ZJ3ho2kq+WOKxkfblWc2Z6MT0v9t7tMG13mdrr xL8L368LCEnBGiPmlIal4WH7HTp4yZiFWv+s7cpG8diuCc3yiNl7kqaejriyX4d7dapd +YDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727990369; x=1728595169; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Z+Hp2Wc8ZdnoqMXdfR+0XwzdiTfUNEPQmLRvNNqjLqw=; b=Z6hAHFNcfRibbYemWnW40e5DOB+1dvp1Ky7FgjDWvJXabj+HP2lhYH2QHTdQ8o7Ydo Sa8ebtW7KQkH7F4bjpT2323M2evQI7r/htOImmjc8zAvAV2KbwZNr86cQc1IYhGN03XA 4ay1hl99BTFZOJe6hIl6Minsv0rBrCTpWTGiNHomKmSNZV8xV8WH3VbZb3DOEASYpgcZ qq6uqumI+O6pOGhD8HcO/3ws1iEdJVRLMl66ZSbFC5oRguolaHQvfVsludF5ltEFUHKM s82korx2Zy0S6JIQ1N1Z8dhnAqsiNL1FMr+qngPqZmk/5bkGti1RQv93LX7R1ObTXvmi /+lw== X-Forwarded-Encrypted: i=1; AJvYcCUSgyNsJhE8bzl/I7iwqriwfnqigD86d7rTh8fQAfUBbAI0m99VujITjPu0IC7WfXX9h3VbYg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz6NKbhEzwDWb6FUvqXDn+/Qo66NFH5pBMD/ll8+aiMDAstRC5o F11Z2kjmSfReL2HE9tKaHXni3xoUdG/SyXiD9Q2cPj7sSFkvYruf X-Google-Smtp-Source: AGHT+IHF0jc5lUzj2WVecgBTElcEyY/4QROoWGamCOs4qq3h1a0/yAn2dRs/IWmvDcKwM/zYkc5mbQ== X-Received: by 2002:a17:903:32c4:b0:20b:c258:73af with SMTP id d9443c01a7336-20bff1cd62bmr7082735ad.51.1727990369388; Thu, 03 Oct 2024 14:19:29 -0700 (PDT) Original-Received: from debian ([2804:7f0:9183:8430:461d:9f8f:6ad:6e06]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20bef707154sm12906865ad.280.2024.10.03.14.19.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 14:19:28 -0700 (PDT) X-Google-Original-From: Rahul Martim Juliato X-PGP-Key: https://www.rahuljuliato.com/rahul_pub_key.asc Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292927 Archived-At: --zimhclzppwgtk73s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 29, 2024 at 05:49:35PM +0200, martin rudalics wrote: > > What > > is the value of that variable? >=20 > Found as: >=20 > (setq switch-to-prev-buffer-skip-regexp "\\*[^*]+\\*") >=20 > And the explanation is this snippet from 'switch-to-prev-buffer': >=20 > (when (and skipped (not (functionp switch-to-prev-buffer-skip))) > ;; Show first skipped buffer, unless skip was a function. > (setq new-buffer skipped) > (set-window-buffer-start-and-point window new-buffer))) >=20 > That is, if the regexp excludes a specific buffer but > 'switch-to-prev-buffer' didn't find another suitable buffer, it switches > to the first excluded buffer. The Elisp manual is clear about this: >=20 > This user option should be either a regular expression or a list of > regular expressions. Buffers whose names match one of those > regular expressions will be ignored by =E2=80=98switch-to-prev-buffe= r=E2=80=99 and > =E2=80=98switch-to-next-buffer=E2=80=99 (except when there=E2=80=99s= no other buffer to > switch to). >=20 > So if you want to make sure that *Messages* gets always excluded, you > have to specify a function based on that regexp like >=20 > (defun skip-these-buffers (_window buffer _bury-or-kill) > "Function for `switch-to-prev-buffer-skip'." > (string-match "\\*[^*]+\\*" (buffer-name buffer))) >=20 > (setq switch-to-prev-buffer-skip 'skip-these-buffers) >=20 > martin Thanks a lot for the clarification! I just found a bit strange the default behaviour (I guess I am biased by my use case) being this way. The snippet you provided is exactly what I was looking for. I think this is all for this thread :) --=20 Rahul Martim Juliato https://www.rahuljuliato.com PGP Fingerprint: 6B68 4353 84E2 2C7E 5A26 B79A C666 FC94 BD7E A483 PGP Public Key : https://www.rahuljuliato.com/rahul_pub_key.asc --zimhclzppwgtk73s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEa2hDU4TiLH5aJreaxmb8lL1+pIMFAmb/ClsACgkQxmb8lL1+ pINVYQ//TW5ghSdWysuGlNxe40xu4SbBWs7pJwkwbWZF0wM+BYMW6yhsbUYy07Ww LnhJrPfeAWyD1smSXIcNtzeKr9Bmhbxmlv0CbCS+UP/LUy/TxWPx6P8w111wv8HA Dni+LXTiTxHW+rbzjhbPyf9VQcX5mMo/cT7oWmNfpytbYRA4oEZGo5U9SD9JFR+N M0ywcy5QcusXDd8MS4ghBtSIiodxYntFZMF09h+QQhAHMIhszoQXe5+JV6GsfyXN URx24mGHnAmY6SxizLFzrd4d5SEfL3oOIRcG7d5oQ1UE8uLV8VeWLYKQLTJZP4iC LP/bQFPC4ahR5pDaYhUikdydRxL0GVZ/b8+Ry/iSBSHTLhcS2CE1JRu4OJ1EgkZo WQ9D3b/NlxPYgqpG8r07MXzFPwWwF5nUCdPKe9kextQFg9H4G+lpJKA8otspGytj vZxzUKRnkvE7JHOyG2+neG3L+FoU1s1aO0PLPgNcIZ3Fo6w4I+MyV9IFEhzIuC2m WjbmxM0zfzR//mw0J5BZF21UWQu+rWREgiiIOHHOfxfntMUs/Mfv8+5fZfsvYk3S sxIbH/wWVrddWi/Q2gVO46Krb1rCI8m3Px/pzt9YbmPjs/onQpGTKJhsr2XTeOEY RRJlQJd1OQEaIWnCDr5Fmd4EGY+crKfXbHQ6lCA3CnoN4eu0uIc= =7qUJ -----END PGP SIGNATURE----- --zimhclzppwgtk73s--