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#7875: point preserved incorrectly with minibuffer-frame Date: Fri, 21 Jan 2011 08:41:25 +0100 Message-ID: <4D3938A5.3030608@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070702000100050002020707" X-Trace: dough.gmane.org 1295596505 15704 80.91.229.12 (21 Jan 2011 07:55:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2011 07:55:05 +0000 (UTC) Cc: 7875@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 21 08:55:00 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PgBpi-0004w8-Ao for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Jan 2011 08:54:59 +0100 Original-Received: from localhost ([127.0.0.1]:50231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgBph-0001t8-Ed for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Jan 2011 02:54:57 -0500 Original-Received: from [140.186.70.92] (port=57950 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgBpY-0001s8-Dn for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2011 02:54:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgBpW-0007zq-Me for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2011 02:54:48 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgBpW-0007zm-K8 for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2011 02:54:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PgBVS-0000wx-AD; Fri, 21 Jan 2011 02:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Jan 2011 07:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7875 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7875-submit@debbugs.gnu.org id=B7875.12955952173619 (code B ref 7875); Fri, 21 Jan 2011 07:34:02 +0000 Original-Received: (at 7875) by debbugs.gnu.org; 21 Jan 2011 07:33:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PgBV3-0000wK-3t for submit@debbugs.gnu.org; Fri, 21 Jan 2011 02:33:37 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PgBV0-0000w6-FK for 7875@debbugs.gnu.org; Fri, 21 Jan 2011 02:33:35 -0500 Original-Received: (qmail invoked by alias); 21 Jan 2011 07:41:25 -0000 Original-Received: from 62-47-62-172.adsl.highway.telekom.at (EHLO [62.47.62.172]) [62.47.62.172] by mail.gmx.net (mp061) with SMTP; 21 Jan 2011 08:41:25 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+jRttTiGCjbvhb9W/NbFoJhFCa8fYdGXe7pcFUDd PuKXKEvnaIXQR4 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 21 Jan 2011 02:34:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43503 Archived-At: This is a multi-part message in MIME format. --------------070702000100050002020707 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > When I do > > % src/emacs -Q --eval '(setq default-frame-alist (quote ((minibuffer . nil))))' > M-: (goto-char (point-min)) RET > > the cursor stays at EOB rather than going to BOB. I suspect this is due > to the recent change with the Fset_window_configuration issue. I have posted two possible fixes: Either you replace the code if (EQ (window, selected_window)) return window; in Fselect_window with if (EQ (window, selected_window)) { inhibit_point_swap = 0; return window; } or you try the attached patch. If possible, try both fixes. martin, who should think about a better solution --------------070702000100050002020707 Content-Type: text/plain; name="window.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window.c.diff" === modified file 'src/window.c' *** src/window.c 2011-01-15 23:16:57 +0000 --- src/window.c 2011-01-16 10:18:51 +0000 *************** *** 85,90 **** --- 85,91 ---- int (* fn) (struct window *, void *), void *); static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); + static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); /* This is the window in which the terminal's cursor should be left when nothing is being done with it. This must *************** *** 158,168 **** static int window_initialized; - /* Set in `set-window-configuration' to prevent "swapping out point" - in the old selected window. */ - - static int inhibit_point_swap; - /* Hook to run when window config changes. */ static Lisp_Object Qwindow_configuration_change_hook; --- 159,164 ---- *************** *** 3550,3569 **** return Qnil; } - /* Note that selected_window can be nil when this is called from - Fset_window_configuration. */ ! DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, ! doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. ! If WINDOW is not already selected, make WINDOW's buffer current ! and make WINDOW the frame's selected window. Return WINDOW. ! Optional second arg NORECORD non-nil means do not put this buffer ! at the front of the list of recently selected ones and do not ! make this window the most recently selected one. ! Note that the main editor command loop selects the buffer of the ! selected window before each command. */) ! (register Lisp_Object window, Lisp_Object norecord) { register struct window *w; register struct window *ow; --- 3546,3560 ---- return Qnil; } ! /* If select_window is called with inhibit_point_swap non-zero it will ! not store point of the old selected window's buffer back into that ! window's pointm slot. This is needed by Fset_window_configuration to ! avoid that the display routine is called with selected_window set to ! Qnil causing a subsequent crash. */ ! static Lisp_Object ! select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) { register struct window *w; register struct window *ow; *************** *** 3603,3611 **** /* Store the current buffer's actual point into the old selected window. It belongs to that window, and when the window is not selected, must be in the window. */ ! if (inhibit_point_swap) ! inhibit_point_swap = 0; ! else { ow = XWINDOW (selected_window); if (! NILP (ow->buffer)) --- 3594,3600 ---- /* Store the current buffer's actual point into the old selected window. It belongs to that window, and when the window is not selected, must be in the window. */ ! if (! inhibit_point_swap) { ow = XWINDOW (selected_window); if (! NILP (ow->buffer)) *************** *** 3639,3644 **** --- 3628,3648 ---- return window; } + DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, + doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. + If WINDOW is not already selected, make WINDOW's buffer current + and make WINDOW the frame's selected window. Return WINDOW. + Optional second arg NORECORD non-nil means do not put this buffer + at the front of the list of recently selected ones and do not + make this window the most recently selected one. + + Note that the main editor command loop selects the buffer of the + selected window before each command. */) + (register Lisp_Object window, Lisp_Object norecord) + { + select_window (window, norecord, 0); + } + static Lisp_Object select_window_norecord (Lisp_Object window) { *************** *** 6167,6174 **** out point" in the old selected window using the buffer that has been restored into it. We already swapped out that point from that window's old buffer. */ ! inhibit_point_swap = 1; ! Fselect_window (data->current_window, Qnil); XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window = selected_window; --- 6171,6177 ---- out point" in the old selected window using the buffer that has been restored into it. We already swapped out that point from that window's old buffer. */ ! select_window (data->current_window, Qnil, 1); XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window = selected_window; *************** *** 7099,7106 **** window_scroll_preserve_hpos = -1; window_scroll_preserve_vpos = -1; - inhibit_point_swap = 0; - DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, doc: /* Non-nil means call as function to display a help buffer. The function is called with one argument, the buffer to be displayed. --- 7102,7107 ---- --------------070702000100050002020707--