[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100392: Rework 2011-01-15 changes
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100392: Rework 2011-01-15 changes to window.c. |
Date: |
Fri, 21 Jan 2011 21:44:53 -0500 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100392
author: Martin Rudalics <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Fri 2011-01-21 21:44:53 -0500
message:
Rework 2011-01-15 changes to window.c.
* src/window.c (select_window): New function.
(Fselect_window): Call it.
(inhibit_point_swap): Variable deleted.
(Fset_window_configuration): Call select_window directly.
modified:
src/ChangeLog
src/window.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-01-16 15:40:47 +0000
+++ b/src/ChangeLog 2011-01-22 02:44:53 +0000
@@ -1,3 +1,10 @@
+2011-01-22 Martin Rudalics <address@hidden>
+
+ * window.c (select_window): New function.
+ (Fselect_window): Call it.
+ (inhibit_point_swap): Variable deleted.
+ (Fset_window_configuration): Call select_window directly.
+
2011-01-16 Stefan Monnier <address@hidden>
* image.c (syms_of_image): Don't access XSYMBOL's internals directly.
=== modified file 'src/window.c'
--- a/src/window.c 2011-01-15 02:55:58 +0000
+++ b/src/window.c 2011-01-22 02:44:53 +0000
@@ -85,6 +85,7 @@
int (* fn) (struct window *, void *),
void *));
static Lisp_Object window_list_1 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+static Lisp_Object select_window _P ((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,11 +159,6 @@
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;
@@ -3585,21 +3581,16 @@
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. */)
- (window, norecord)
- register Lisp_Object window, norecord;
+/* 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 (window, norecord, inhibit_point_swap)
+ Lisp_Object window, norecord;
+ int inhibit_point_swap;
{
register struct window *w;
register struct window *ow;
@@ -3638,9 +3629,7 @@
/* 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
+ if (!inhibit_point_swap)
{
ow = XWINDOW (selected_window);
if (! NILP (ow->buffer))
@@ -3676,6 +3665,26 @@
return window;
}
+
+/* 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. */)
+ (window, norecord)
+ register Lisp_Object window, norecord;
+{
+ select_window (window, norecord, 0);
+}
+
static Lisp_Object
select_window_norecord (window)
Lisp_Object window;
@@ -6255,8 +6264,7 @@
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);
+ select_window (data->current_window, Qnil, 1);
XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
= selected_window;
@@ -7214,8 +7222,6 @@
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100392: Rework 2011-01-15 changes to window.c.,
Chong Yidong <=