From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window Date: Fri, 16 Nov 2018 09:53:57 +0100 Message-ID: <5BEE85A5.2070309@gmx.at> References: <87efdnsp2k.fsf@mail.linkov.net> <87h8h195ki.fsf@mail.linkov.net> <5BDAC159.1060008@gmx.at> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1542358391 15629 195.159.176.226 (16 Nov 2018 08:53:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 08:53:11 +0000 (UTC) Cc: 32790@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 16 09:53:07 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 1gNZs8-0003st-OH for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 09:53:04 +0100 Original-Received: from localhost ([::1]:43040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNZuF-0005rZ-4i for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 03:55:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNZu6-0005qZ-TR for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:55:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNZu2-0003zM-8t for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:55:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNZu2-0003z2-4W for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNZu2-0008Mt-2P for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Nov 2018 08:55: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.154235845632099 (code B ref 32790); Fri, 16 Nov 2018 08:55:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 16 Nov 2018 08:54:16 +0000 Original-Received: from localhost ([127.0.0.1]:54722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNZtH-0008Le-Td for submit@debbugs.gnu.org; Fri, 16 Nov 2018 03:54:16 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:59847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNZtH-0008L9-37 for 32790@debbugs.gnu.org; Fri, 16 Nov 2018 03:54:15 -0500 Original-Received: from [192.168.1.101] ([212.95.5.219]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0ML6qP-1gNqs33HJx-000Lfk; Fri, 16 Nov 2018 09:54:06 +0100 In-Reply-To: <87ftw2q74g.fsf@mail.linkov.net> X-Provags-ID: V03:K1:uWFB8AxZwHsukHWBvAajEMvvDnuftRk0oyCfwSduqqopYMZLeVE uFKxk/XX4C/XI3Fz+jnUal1BuLbqnZc/mzo/y0+ieRDuA2XGTHMIyQ8PCJC8G34s7LJ2G36 BOJZ0w5KVFcguqWb/VZoOnMN80xr9P6lLoHFv0AbKyXzSBLG8GcAWEQrRdS4gt2M0DaGbQF L4y6uYscDA/vWHKHwuRFg== X-UI-Out-Filterresults: notjunk:1;V01:K0:IKWKXxQmymw=:mcOKp36AFdjp2ABziSu9k+ V3hvYBs3L4qbiXrgAjXjNI0g8YApbmf+l6g1rT4MJWIq/vl5Exg49R808mNYQhubn9nhdFhdu ndVb/tA9y8fQt4iJY6F97hz8wUy9SQrJSFIWIeygGzm5FqLlZIwOJKTCjCNen116RInWqw7Vy jJvIKYqNIfPVYe9sh3CrBcArUzXWnUA+RbsTbRfQyy2eBIM15mEqrEj9vcSgfybcqeNHGOHMx F92Uc5z0KWA0v8D8LQpLQyyzNHwpbvvF5RNhxZVwHRCuWrL5zumOPNGdSkYEcWdR2oFOyUaQN QW8wBgb99mMiYPofm/FiSR1LsjrmH6KBaYOxLxGt0lbz20bg6bX4kpgJgwpR4tF+Ih50w8zXH zi3auRQ0jNipt7+Vc1rW0fE/F5I9AZGvVQA3ncw1aem41kbmvOQwTkvG+fh4U2WRX5EARbY3C wSUR0mTScqyRdu/yz1Zx2VPOIJeloKjRgE2HV+4ze+jLtZXv0+tQfKd4O87GsSoKnehv3iCOR qCMrxnBzErsHEs7F/CW6fRmE5LT5BSJeUaCg+RlHJVAnfNTMfVbPQOPZb6ynHiUxd/4giiRYz XBCjNTkjuB4PerSJ4w/cLwj/b8jcgp9omZN8QghVxB6VdvqNsM9SLkXgFPRbj4jAxfKnhKeLv gqRu0iFw0LxttFCwJwSVIImNXmrvSGpguEHxf/t7Gqfq+fQQ8Gi1OrCXIX40+iEVwPEdRcyv4 QBUaVQs9AY3b5dH6ELh9lJzu5ludbmk0tn8ND7GrJFBq0w5FIh0fegtYgc/8hpjmnm196qev 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:152447 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? > 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. >> Windows have been often made dedicated so they get auto-deleted as >> soon as their buffer gets buried or killed. This use-case should now >> be handled by the 'quit-restore' parameter. I have no idea whether >> windows are made dedicated for any other reason. Do you? > > Another reason would be to force pop-up from switch-buffer, but > it's not the right thing to do. Something like "I never want to show another buffer in this window, please remind me if I accidentally try to do that". martin