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#32777: 27.0.50; window-buffer gets wrong point Date: Sat, 13 Oct 2018 15:08:08 +0200 Message-ID: <5BC1EE38.2060906@gmx.at> References: <83wor12fut.fsf@gnu.org> <83o9byurtg.fsf@gnu.org> 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 1539436027 2870 195.159.176.226 (13 Oct 2018 13:07:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Oct 2018 13:07:07 +0000 (UTC) Cc: juri@linkov.net, 32777@debbugs.gnu.org To: Eli Zaretskii , Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 13 15:07: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 1gBJdG-0000ed-Px for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 15:07:02 +0200 Original-Received: from localhost ([::1]:45026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBJfN-0003Aw-0f for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 09:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBJfG-0003Ab-4d for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 09:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBJfD-00082B-22 for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 09:09:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43591) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBJfC-000827-Ty for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 09:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gBJfC-00013A-Ga for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 09:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Oct 2018 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32777 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32777-submit@debbugs.gnu.org id=B32777.15394361043979 (code B ref 32777); Sat, 13 Oct 2018 13:09:02 +0000 Original-Received: (at 32777) by debbugs.gnu.org; 13 Oct 2018 13:08:24 +0000 Original-Received: from localhost ([127.0.0.1]:47847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBJea-000127-0I for submit@debbugs.gnu.org; Sat, 13 Oct 2018 09:08:24 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:37101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBJeY-00011r-8z for 32777@debbugs.gnu.org; Sat, 13 Oct 2018 09:08:22 -0400 Original-Received: from [192.168.1.100] ([213.162.73.245]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M3AWN-1fLgR326ul-00sziU; Sat, 13 Oct 2018 15:08:10 +0200 Original-Received: from [192.168.1.100] ([213.162.73.245]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M3AWN-1fLgR326ul-00sziU; Sat, 13 Oct 2018 15:08:10 +0200 In-Reply-To: <83o9byurtg.f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gNyON1e6Os3/Bbu0bDqV5Wru 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:151219 Archived-At: > Martin, any comments? + (with-selected-window (minibuffer-selected-window) + (with-current-buffer (window-buffer (selected-window)) + (and (commandp (function-called-at-point)) + (format "%S" (function-called-at-point)))))))) The + (with-current-buffer (window-buffer (selected-window)) should be superfluous by all our rules but we know too well how valid these rules sometimes are. Any other patch (for example, using an idiom like (window-point (minibuffer-selected-window))) would be likely longer than Federico's solution. It would be interesting to find out why the patch works. Federico's earlier remark The problem is that when "with-current-buffer" is called with the resulting buffer, it that buffer has been opened on more than one window, the active window will be set according to a criteria which I haven't figured out yet, but not necessarily to the same exact window "minibuffer-selected-window" returned. can't be the cause IMO because 'with-current-buffer' does not set the "active window" and the value of point of the buffer made current remains the previous value of point in that buffer and that should be the value assigned by this step 4.3. put point on "next-error", type M-x M-n, of Juri's scenario. So far I'm clueless. martin