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 14:04:09 +0300 Message-ID: <83pm4cjo0m.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13814"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, 64911@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 28 13:16:11 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 1qPLS6-0003O9-M0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jul 2023 13:16:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPLGO-0007di-JE; Fri, 28 Jul 2023 07:04:04 -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 1qPLGM-0007cn-De for bug-gnu-emacs@gnu.org; Fri, 28 Jul 2023 07:04:02 -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 1qPLGM-0002Iu-4c for bug-gnu-emacs@gnu.org; Fri, 28 Jul 2023 07:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPLGM-0008NI-0N for bug-gnu-emacs@gnu.org; Fri, 28 Jul 2023 07:04: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 11:04:01 +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.169054222932165 (code B ref 64911); Fri, 28 Jul 2023 11:04:01 +0000 Original-Received: (at 64911) by debbugs.gnu.org; 28 Jul 2023 11:03:49 +0000 Original-Received: from localhost ([127.0.0.1]:43816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPLG8-0008Mj-H6 for submit@debbugs.gnu.org; Fri, 28 Jul 2023 07:03:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPLG6-0008MT-1G for 64911@debbugs.gnu.org; Fri, 28 Jul 2023 07:03:46 -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 1qPLFz-00029u-Tq; Fri, 28 Jul 2023 07:03:39 -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=+K0sHJNkSy4oeJgSFMYKr6DjeQt3mF3xyKEUlRbPvZI=; b=iB+fTBB+Sdfs fk4pYYSHckQbH0xtk9/cuGLEDLCUOzssUSuzwUvvhTTMbsQX9Ci154/luwLw0vY1LlbQvqjUNSoPX VF8Lm7U6c0Y8o0OxN3sD+/ZB/8gOcf7ou9KdBL486xBqze9FM0wGnkZxGFW5Ka7pnoT5wMpXq+vl7 OApH/itRT8Bg6OqWjXoCvehRm9B9n7EHqFAEATzmvn6IvPqEuJma34mP/MX/faIzio2leoNNGre76 RYNHS1LwQkX0cq8U7/+bpfVuPRXIhhN0ba/eoYzLuIN4bzuBB/yAyxVh9La7F0jCPP69XEe23yulT UuuIDSF0fjavtoEG/byFEA==; 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 1qPLFc-0004HG-Ga; Fri, 28 Jul 2023 07:03:39 -0400 In-Reply-To: (message from Phil Sainty on Fri, 28 Jul 2023 19:11:07 +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:266256 Archived-At: > Cc: Adam Porter > Date: Fri, 28 Jul 2023 19:11:07 +1200 > From: Phil Sainty > > Tangentially, I can't see any function for obtaining all the > markers for a given buffer. I see that this has been raised > before as https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35536 > > There's clearly resistance to implementing that, but... it > would be very useful for cases like the one I'm looking at. > > Specifically, the code which is erasing the buffer and then > rebuilding it could firstly loop over the buffer markers, store > some kind of relevant context for each one and then, after > rebuilding the buffer, it could locate the equivalent context > in the new buffer text and update each of those markers > accordingly. Why cannot you use replace-buffer-contents instead of erasing the buffer and rebuilding it? That function attempts to preserve the markers. > Without a way of querying the buffer's markers it's necessary > to just *know* about them and how to access them; and there's > no guarantee that new markers won't come into play behind the > scenes in future, so it would be useful to be able to access > the list without having to have advance information about how > and where they were being created. In general, when you rebuild the buffer's contents, there's no guarantee the old buffers will be even useful. What markers are we talking about, besides window-point?