From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32777: 27.0.50; window-buffer gets wrong point Date: Tue, 02 Oct 2018 06:21:30 +0300 Message-ID: <83wor12fut.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1538450407 21209 195.159.176.226 (2 Oct 2018 03:20:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 Oct 2018 03:20:07 +0000 (UTC) Cc: juri@linkov.net, 32777@debbugs.gnu.org To: Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 02 05:20: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 1g7BEB-0005S2-4j for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Oct 2018 05:20:03 +0200 Original-Received: from localhost ([::1]:41569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7BGH-0000EE-N0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 23:22:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7BGB-0000Dy-1j for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 23:22:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7BG7-0000Mb-Va for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 23:22:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7BG7-0000MT-RJ for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 23:22:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g7BG6-0001lf-AP for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 23:22:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Oct 2018 03:22: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.15384505066772 (code B ref 32777); Tue, 02 Oct 2018 03:22:02 +0000 Original-Received: (at 32777) by debbugs.gnu.org; 2 Oct 2018 03:21:46 +0000 Original-Received: from localhost ([127.0.0.1]:33656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g7BFq-0001l9-Fl for submit@debbugs.gnu.org; Mon, 01 Oct 2018 23:21:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g7BFo-0001kx-Vv for 32777@debbugs.gnu.org; Mon, 01 Oct 2018 23:21:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7BFg-0008Vz-OL for 32777@debbugs.gnu.org; Mon, 01 Oct 2018 23:21:39 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7BFg-0008Vv-Kp; Mon, 01 Oct 2018 23:21:36 -0400 Original-Received: from [176.228.60.248] (port=4286 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g7BFg-0008NS-8k; Mon, 01 Oct 2018 23:21:36 -0400 In-reply-to: (message from Federico Tedin on Mon, 1 Oct 2018 23:07:41 -0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:150897 Archived-At: > From: Federico Tedin > Date: Mon, 1 Oct 2018 23:07:41 -0300 > Cc: 32777@debbugs.gnu.org > > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -1710,9 +1710,10 @@ read-extended-command > (lambda () > ;; Get a command name at point in the original buffer > ;; to propose it after M-n. > - (with-current-buffer (window-buffer (minibuffer-selected-window)) > - (and (commandp (function-called-at-point)) > - (format "%S" (function-called-at-point))))))) > + (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)))))))) > ;; Read a string, completing from and restricting to the set of > ;; all defined commands. Don't provide any initial input. > ;; Save the command read on the extended-command history list. Can you explain the change? The minibuffer window is already the selected window at this point (look at the implementation of minibuffer-selected-window), so using with-selected-window, which seems to be the only real change in the above, should be redundant. Also, with-selected-window makes the window's buffer current, so why did you need with-current-buffer in addition? What am I missing? Thanks.