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#31695: bug-gnu-emacs@gnu.org Date: Thu, 07 Jun 2018 10:39:13 +0200 Message-ID: <5B18EF31.1080706@gmx.at> References: <20180603.101706.47071122.enometh@meer.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 1528360687 11543 195.159.176.226 (7 Jun 2018 08:38:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2018 08:38:07 +0000 (UTC) To: Madhu , 31695@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 07 10:38:03 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 1fQqQk-0002vF-JB for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 10:38:02 +0200 Original-Received: from localhost ([::1]:56356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQqSr-00037B-KU for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 04:40:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQqSj-00036s-9H for bug-gnu-emacs@gnu.org; Thu, 07 Jun 2018 04:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQqSg-0004Jy-6J for bug-gnu-emacs@gnu.org; Thu, 07 Jun 2018 04:40:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQqSg-0004Jm-0o for bug-gnu-emacs@gnu.org; Thu, 07 Jun 2018 04:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fQqSf-0004mW-Pg for bug-gnu-emacs@gnu.org; Thu, 07 Jun 2018 04:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jun 2018 08:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31695 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 31695-submit@debbugs.gnu.org id=B31695.152836077818341 (code B ref 31695); Thu, 07 Jun 2018 08:40:01 +0000 Original-Received: (at 31695) by debbugs.gnu.org; 7 Jun 2018 08:39:38 +0000 Original-Received: from localhost ([127.0.0.1]:37408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQqSH-0004ll-Ts for submit@debbugs.gnu.org; Thu, 07 Jun 2018 04:39:38 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:36149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQqSF-0004lY-OD for 31695@debbugs.gnu.org; Thu, 07 Jun 2018 04:39:36 -0400 Original-Received: from [192.168.1.100] ([213.162.73.230]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0McDl1-1fkIDD0v1b-00JcJo; Thu, 07 Jun 2018 10:39:24 +0200 In-Reply-To: <20180603.101706.47071122.enometh@meer.net> X-Provags-ID: V03:K1:Cj8/nQD8GYK1wkZHVu5xjPzSwUVCIeP03qZWwRr8iFYLwge/Mrp RHEzM5HKX/u4xDqsnAgzyS3hsqFdSlfmhxgtV939bGRG2MxLbGGFKkPtzkCz+nip0v8AsSg OUMTdN8F9MWyFF7zr1eYZocu4hdgk+qZjUFMAMMksFj6WYyxJwSiKmPccAzIpXzLssvrXea qtcbaIeHwEV/g5xDmuQxQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:W4jeouxqtLo=:xk923pdQLZPC0CbUSVtbJd CDsfPx/xQND12LOqbuIlbcmVwbpseUdFvFTfubrFbKWG09kv7RJQu9s3xFheL8YWQSSl+N6GC l0bRbrJsDBGZenvKu7EtflRCCsscvXEs0GsfaH/hH9FhW3rs/bIgUy3dR7g2BPbG/2xCDgMgB P6V6bifnz87KyP3p/6lRyFuehY+yD9ws3DcjUg4pVZ3D8paPdw6C2ej9/amBoghNYuPP72QEA +JrpMWjZrxbV5Z3ZCExXf50I7+qpsi/ejUaZGEtpywdkUWzu5oj2Qj44617/bU1oOyffMEjNA Hb5Ch6hWeZGkBKBRF5kNplInA1TB72QxAGKKSBaDCWgr5p6mIqvAW8KlPW8GJV4jzc7TZRsMH PyETP2VQGxaGJzj75WzXH82XCBG/oAp9yaDjXDHeAA5dVqjLfLgPiFq/C4VIeaRT3Lx3nAUpN EdX4nQ7B100m8Mq90IYU8/mrJx7MUBWnI1B5IJrGbit8xCFrf23aeXHQgXQeguoil2Fv1sHog lzxEN2cu9jpGhBogrXvo2oSHFfbHv775DVvpCZXFI6P1kKvLW+uwMBAugwmJlnbqq7G9JflXB fuBxW+oD6vM48XBRK8lfesEarviXwNmWs+1CY1jRiXfY4bsTHd73HsUx56oC8YqtuUvMcpTON gUFEJjxCCuf1hJsYFNUIRYNExZ9Px6lWIKE8pmVV+D7xqEd1LQjW+VnN/FgM03eT+rUEjpQ67 RU7DkJeQQzD/VZnD60/JumlXLZ2+wkTVK2qum/wKyv0AOghknsfzeztfAIquPN5ck7GkwtSv 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:147126 Archived-At: > The window-point jumps unexpectedly after minibuffer interaction when a > buffer is being displayed in two frames, and the frames do not have > their own minibuffers. > > To reproduce: emacs -Q -D and create two frames displaying some buffer > at different points > > (with-selected-frame (setq $a (make-frame '((minibuffer)))) > (let ((enable-local-variables :all)) > (view-emacs-news) > (beginning-of-buffer))) > > (with-selected-frame (setq $b (make-frame '((minibuffer)))) > (let ((enable-local-variables :all)) > (view-emacs-news) > (end-of-buffer))) > > Now select frame $b, and execute some minibuffer command: > M-: 1 > > The point in the window of frame $b, which was at the bottom now jumps > to the top of the buffer. (This corresponds with the point in the > buffer in the other frame where it is displayed. This should be fixed now on the Emacs 26.2 release branch. The precise reason of the bug is yet unknown to me but what happens is the following: When restoring the configuration of the minibuffer-frame after execution of the minibuffer command, 'set-window-configuration' assigns old_point = BUF_PT (XBUFFER (new_current_buffer)); because new_current_buffer (which is NEWS) is not the current buffer (which is *Minibuf-1*) and because data->current_window does not show NEWS. I can't tell why BUF_PT gets value from the window showing NEWS at BOB but a comment in 'set-window-configuration' says that this may happen. Note that data->current_window shows *scratch* and this is the window that will become the minibuffer frame's selected window instead of the minibuffer window. Now after data->selected_frame (which is the frame showing NEWS at EOB) has been reselected, 'set-window-configuration' does if (!EQ (XWINDOW (data->current_window)->contents, new_current_buffer)) Fgoto_char (make_number (old_point)); and since data->current_window shows *scratch* (and not NEWS) going to old_point will cause the point of the window showing NEWS at EOB show it at BOB instead. In my fix I use if (!EQ (XWINDOW (selected_window)->contents, new_current_buffer)) Fgoto_char (make_number (old_point)); instead and since selected_window already shows new_current_buffer at that time the bug should not happen. If you build from the release branch, please try it. If you build from master only, please wait a few days until the change has been propagated there. Belated thanks for the simple recipe, martin