aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorStefan Monnier2014-04-23 23:59:19 -0400
committerStefan Monnier2014-04-23 23:59:19 -0400
commit8917710efd63f7a253aec77fa190d6c5ec870bf3 (patch)
tree9b1ce196eebdac814370c9bc1f86a62c80b45aa0 /src/window.c
parent9b233997f468fe8a4f4cb7c0c799aff2e3374ba1 (diff)
downloademacs-8917710efd63f7a253aec77fa190d6c5ec870bf3.tar.gz
emacs-8917710efd63f7a253aec77fa190d6c5ec870bf3.zip
* src/window.c (Fset_window_configuration): Deactivate the mark before
unsetting the mark. (set_window_buffer): Ignore window_initialized. (window_initialized): Remove. * src/keyboard.c (Qdeactivate_mark): Not static any more. * src/buffer.c (buffer_local_value): Rename from buffer_local_value_1. Update all callers.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c
index 8e8252d3b76..ebcc41180f3 100644
--- a/src/window.c
+++ b/src/window.c
@@ -119,9 +119,6 @@ static Lisp_Object Qtemp_buffer_show_hook;
119/* Incremented for each window created. */ 119/* Incremented for each window created. */
120static int sequence_number; 120static int sequence_number;
121 121
122/* Nonzero after init_window_once has finished. */
123static int window_initialized;
124
125/* Hook to run when window config changes. */ 122/* Hook to run when window config changes. */
126static Lisp_Object Qwindow_configuration_change_hook; 123static Lisp_Object Qwindow_configuration_change_hook;
127 124
@@ -3439,14 +3436,10 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
3439 wset_redisplay (w); 3436 wset_redisplay (w);
3440 w->update_mode_line = true; 3437 w->update_mode_line = true;
3441 3438
3442 /* We must select BUFFER for running the window-scroll-functions. */ 3439 /* We must select BUFFER to run the window-scroll-functions and to look up
3443 /* We can't check ! NILP (Vwindow_scroll_functions) here 3440 the buffer-local value of Vwindow_point_insertion_type. */
3444 because that might itself be a local variable. */ 3441 record_unwind_current_buffer ();
3445 if (window_initialized) 3442 Fset_buffer (buffer);
3446 {
3447 record_unwind_current_buffer ();
3448 Fset_buffer (buffer);
3449 }
3450 3443
3451 XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type); 3444 XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
3452 3445
@@ -6267,6 +6260,15 @@ the return value is nil. Otherwise the value is t. */)
6267 set_marker_restricted (w->start, p->start, w->contents); 6260 set_marker_restricted (w->start, p->start, w->contents);
6268 set_marker_restricted (w->pointm, p->pointm, 6261 set_marker_restricted (w->pointm, p->pointm,
6269 w->contents); 6262 w->contents);
6263 if (MARKERP (p->mark) && !XMARKER (p->mark)->buffer
6264 && !NILP (BVAR (XBUFFER (w->contents), mark_active)))
6265 {
6266 struct buffer *old = current_buffer;
6267 extern Lisp_Object Qdeactivate_mark;
6268 set_buffer_internal (XBUFFER (w->contents));
6269 call0 (Qdeactivate_mark);
6270 set_buffer_internal (old);
6271 }
6270 Fset_marker (BVAR (XBUFFER (w->contents), mark), 6272 Fset_marker (BVAR (XBUFFER (w->contents), mark),
6271 p->mark, w->contents); 6273 p->mark, w->contents);
6272 6274
@@ -6619,7 +6621,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
6619 else 6621 else
6620 p->pointm = Fcopy_marker (w->pointm, Qnil); 6622 p->pointm = Fcopy_marker (w->pointm, Qnil);
6621 XMARKER (p->pointm)->insertion_type 6623 XMARKER (p->pointm)->insertion_type
6622 = !NILP (buffer_local_value_1 /* Don't signal error if void. */ 6624 = !NILP (buffer_local_value /* Don't signal error if void. */
6623 (Qwindow_point_insertion_type, w->contents)); 6625 (Qwindow_point_insertion_type, w->contents));
6624 6626
6625 p->start = Fcopy_marker (w->start, Qnil); 6627 p->start = Fcopy_marker (w->start, Qnil);
@@ -7138,8 +7140,6 @@ init_window_once (void)
7138 Vterminal_frame = selected_frame; 7140 Vterminal_frame = selected_frame;
7139 minibuf_window = f->minibuffer_window; 7141 minibuf_window = f->minibuffer_window;
7140 selected_window = f->selected_window; 7142 selected_window = f->selected_window;
7141
7142 window_initialized = 1;
7143} 7143}
7144 7144
7145void 7145void