From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12766: read-from-minibuffer does not preserve current-buffer Date: Tue, 30 Oct 2012 11:27:58 +0100 Message-ID: <508FABAE.4050104@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351593046 18019 80.91.229.3 (30 Oct 2012 10:30:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2012 10:30:46 +0000 (UTC) Cc: 12766@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 30 11:30:55 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TT95x-0007ym-Ei for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2012 11:30:53 +0100 Original-Received: from localhost ([::1]:55234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT95p-0003Ot-72 for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2012 06:30:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT95h-0003D2-Ld for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2012 06:30:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TT95b-0007uY-SA for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2012 06:30:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT95b-0007uE-OO for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2012 06:30:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TT982-0003dy-Dd for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2012 06:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Oct 2012 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12766 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12766-submit@debbugs.gnu.org id=B12766.135159312613941 (code B ref 12766); Tue, 30 Oct 2012 10:33:02 +0000 Original-Received: (at 12766) by debbugs.gnu.org; 30 Oct 2012 10:32:06 +0000 Original-Received: from localhost ([127.0.0.1]:39136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TT978-0003co-0c for submit@debbugs.gnu.org; Tue, 30 Oct 2012 06:32:06 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:55281) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TT976-0003ch-Di for 12766@debbugs.gnu.org; Tue, 30 Oct 2012 06:32:05 -0400 Original-Received: (qmail invoked by alias); 30 Oct 2012 10:27:59 -0000 Original-Received: from 62-47-45-43.adsl.highway.telekom.at (EHLO [62.47.45.43]) [62.47.45.43] by mail.gmx.net (mp041) with SMTP; 30 Oct 2012 11:27:59 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18gO1s9mg4gc9HBetldRqs1/RWCTieEVEWxzaio00 Vo8/DSH9onA7Ib In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66232 Archived-At: > % src/emacs -Q --eval "(setq initial-frame-alist '((minibuffer . nil)))" > M-: (with-temp-buffer (list (read-string "toto: ") (current-buffer))) RET > > In Emacs 24.2 this always shows the current-buffer to be the temp buffer > (which is a killed buffer by the time M-: prints its result). > But in Emacs trunk, the result depends on whether you issue the M-: > from the normal frame (where it works right) or from the special > minibuffer-only frame, where current-buffer after read-string is > *minibuf-0*! > > This is a serious problem, which introduces subtle bugs that can be > pretty difficult to track down. Two changes I made could be involved: (1) `select-window' now always makes the window's buffer current. (2) read_minibuf now calls set_window_buffer instead of Fset_window_buffer. And there's also bug#10851 where `read-char-by-name' could change the current buffer. Also, is this related to the comment ;; FIXME: kill-buffer can change current-buffer in some odd cases. in `with-temp-buffer'? martin