From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64911: 30.0.50; switch-to-buffer-preserve-window-point not respected by switch-to-(next|prev)-buffer Date: Fri, 28 Jul 2023 10:21:12 +0300 Message-ID: <83sf98jyc7.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6475"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, 64911@debbugs.gnu.org To: Phil Sainty , martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 28 09:53:09 2023 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 1qPIHd-0001P7-8e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jul 2023 09:53:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPHme-0003jT-Of; Fri, 28 Jul 2023 03:21:08 -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 1qPHmZ-0003jF-G2 for bug-gnu-emacs@gnu.org; Fri, 28 Jul 2023 03:21:04 -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 1qPHmZ-0001QR-7k for bug-gnu-emacs@gnu.org; Fri, 28 Jul 2023 03:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPHmY-0007sc-Ht for bug-gnu-emacs@gnu.org; Fri, 28 Jul 2023 03:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jul 2023 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64911 X-GNU-PR-Package: emacs Original-Received: via spool by 64911-submit@debbugs.gnu.org id=B64911.169052884230256 (code B ref 64911); Fri, 28 Jul 2023 07:21:02 +0000 Original-Received: (at 64911) by debbugs.gnu.org; 28 Jul 2023 07:20:42 +0000 Original-Received: from localhost ([127.0.0.1]:43556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPHmC-0007rv-Mv for submit@debbugs.gnu.org; Fri, 28 Jul 2023 03:20:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPHm8-0007rf-W8 for 64911@debbugs.gnu.org; Fri, 28 Jul 2023 03:20:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPHm2-00014H-7h; Fri, 28 Jul 2023 03:20:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WJFFpB0r7M28/cedtpjrjVHsRooxSbpAQetNVYZ07Nk=; b=BscilQzYVpkF wHLnhGNO884GJR/WwyUPPRa+mrm6CZrgJtehqReik3bAH9KLQ+R3BAYLg/m6lpuKt992Aj7rCPT3C eE9n4pLH86ZmqqiRcjMiFlNp20xLTF3ja8jlJyRXV+qZeqTkpW0JMm2RmtnQfaesFmo+8Mwqus8kQ 7CF/eNw5qo7jQRgA0JAFx4igRofCd7mKnDSnacn51pjwWC2uJJUpOf8nMB4nV6bAJtK+zhRu7lfkx ScsGDA8cVWdHUQNgdL5tHiHyso9XNV3WydkEGp8N3NktI3r85MqIRPtzL4WI7MFR6g3/GshqEXd/K zeBRjQH+kQMcaj4nu/A9nw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPHlr-0002iv-Oy; Fri, 28 Jul 2023 03:20:30 -0400 In-Reply-To: (message from Phil Sainty on Fri, 28 Jul 2023 17:24:36 +1200) 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:266239 Archived-At: > Cc: Adam Porter > Date: Fri, 28 Jul 2023 17:24:36 +1200 > From: Phil Sainty > > The `switch-to-buffer-preserve-window-point' variable determines > whether the (BUFFER WINDOW-START POS) data returned by > `window-prev-buffers' will be used by `switch-to-buffer' to set > the window's start and point positions. > > I think this variable should additionally be respected by both: > > - `switch-to-prev-buffer' > - `switch-to-next-buffer' > > (If not others? These are the cases I'm presently aware of.) Please provide a significant rationale for this change in behavior. This option has proved problematic in quite a few cases since it was introduced: see its uses in the Emacs tree as the evidence of the subtle issues it introduces. So I'm not excited with making it affect even more use cases. We need a sound rationale for such a change (and no, "consistency" is not a sound rationale in my book), and we need to try to audit all the calls to these functions in the tree to understand and anticipate the impacts. > In practice this is a problem because the position stored in the > `window-prev-buffers' data is a marker (or at least that is the case > in the scenario I am dealing with), and the buffer in question is > periodically erased and regenerated. Erasing the buffer causes all > its markers to be moved to position 1, so the end result is that the > user loses their place. (The buffer contents are rebuilt, but the > new content is typically similar if not identical to the old content, > and so maintaining the original position is desirable). This sounds like quite a unique use case to justify a global behavior change of 2 commands. Can't you achieve what you need by other means? Stashing the value of point or window-point somewhere and then restoring it doesn't sound too complicated to me. Adding martin, in case he has comments and suggestions.