From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window Date: Sun, 18 Nov 2018 00:18:17 +0200 Organization: LINKOV.NET Message-ID: <878t1ruz4m.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <87muqsh11q.fsf@mail.linkov.net> <5BDC0E81.1050806@gmx.at> <87tvkwh4bp.fsf@mail.linkov.net> <5BE00F12.5000703@gmx.at> <87d0rjuq8c.fsf@mail.linkov.net> <5BE15552.4040507@gmx.at> <87y3a5rgm2.fsf@mail.linkov.net> <5BE2AF28.2020505@gmx.at> <87bm6zme24.fsf@mail.linkov.net> <5BE54FA1.2030004@gmx.at> <87k1lkllud.fsf@mail.linkov.net> <5BE7EDAD.9040808@gmx.at> <87tvklx4je.fsf@mail.linkov.net> <5BEA94A7.20809@gmx.at> <87r2foa8gq.fsf@mail.linkov.net> <5BEBDDCB.6090608@gmx.at> <87va4zfapq.fsf@mail.linkov.net> <5BED38A6.6020206@gmx.at> <87ftw2q74g.fsf@mail.linkov.net> <5BEE85A5.2070309@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542494057 21385 195.159.176.226 (17 Nov 2018 22:34:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2018 22:34:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32790@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 17 23:34:13 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gO9AK-0005S3-TG for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Nov 2018 23:34:13 +0100 Original-Received: from localhost ([::1]:50628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO9CR-0007xV-Ft for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Nov 2018 17:36:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gO9CD-0007ww-NC for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2018 17:36:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gO9C7-0001u9-4E for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2018 17:36:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gO9C6-0001tx-TN for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2018 17:36:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gO9C6-0008Ni-Jy for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2018 17:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Nov 2018 22:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32790-submit@debbugs.gnu.org id=B32790.154249412232157 (code B ref 32790); Sat, 17 Nov 2018 22:36:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 17 Nov 2018 22:35:22 +0000 Original-Received: from localhost ([127.0.0.1]:58211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gO9BS-0008Mb-DJ for submit@debbugs.gnu.org; Sat, 17 Nov 2018 17:35:22 -0500 Original-Received: from indri.birch.relay.mailchannels.net ([23.83.209.92]:27181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gO9BR-0008MT-1I for 32790@debbugs.gnu.org; Sat, 17 Nov 2018 17:35:21 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C7001502201; Sat, 17 Nov 2018 22:35:19 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a77.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 93D5C50231C; Sat, 17 Nov 2018 22:35:19 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a77.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sat, 17 Nov 2018 22:35:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Decisive-Befitting: 34f32cb50845f40c_1542494119689_1536428301 X-MC-Loop-Signature: 1542494119688:1433220042 X-MC-Ingress-Time: 1542494119688 Original-Received: from pdx1-sub0-mail-a77.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a77.g.dreamhost.com (Postfix) with ESMTP id 5C214804CD; Sat, 17 Nov 2018 14:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=MbR0dYHJHvAJ1JyleSRZOSVF604=; b= CrqjW159k6RywZ2XCPYgnXfz760bzWoMtTCaHsquaV2GbohHqRBrDEdnLVR5TMAd nAsUWKbdPcahrC9YLgJa5o1IAZjSp8j7rTBRFaqbDCj1fEqfWplTu31B3DKH/oq/ 6CyGT8JzUYzUGpVd8SdxbEfS+Lxq8xJ+wKV6HoD5Svs= Original-Received: from mail.jurta.org (m91-129-107-244.cust.tele2.ee [91.129.107.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a77.g.dreamhost.com (Postfix) with ESMTPSA id 4AC07804C8; Sat, 17 Nov 2018 14:35:16 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a77 In-Reply-To: <5BEE85A5.2070309@gmx.at> (martin rudalics's message of "Fri, 16 Nov 2018 09:53:57 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrleelgdduieeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgeegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdeggedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152487 Archived-At: >> Whereas I meant mostly switch-to-buffer as a command bound to 'C-x b', >> non-interactive calls of 'switch-to-buffer' have the same problem, and >> maybe some of them could be replaced with 'pop-to-buffer-same-window' >> without side effects. One example is 'C-h C-n' (view-emacs-news) that >> uses switch-to-buffer, and can't be forced into another window. >> >> I solved this general problem for myself with such advice: >> >> (advice-add 'switch-to-buffer :around >> (lambda (orig-fun &rest args) >> (let ((buffer (apply orig-fun args)) >> (window (selected-window))) >> (switch-to-prev-buffer window) >> (pop-to-buffer-same-window buffer)))) >> >> Then 'S-M-right C-h C-n' shows it in the right window. > > I don't grok it yet. What's the 'switch-to-prev-buffer' call for? switch-to-buffer switches the buffer in the selected window. switch-to-prev-buffer undoes this, and displays the same buffer in another window instead. >> Do you think it's possible to add a corresponding customizable option >> that would provide the same behavior? > > I would have to understand the "behavior" first. One approach would > be to move the user-error and 'switch-to-buffer-preserve-window-point' > handling into the interactive specification handling and for the rest > do what 'pop-to-buffer-same-window' does. Or maybe to add a new option that will allow switch-to-buffer to use pop-to-buffer-same-window.