diff options
| author | Stefan Monnier | 2014-04-23 23:59:19 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-04-23 23:59:19 -0400 |
| commit | 8917710efd63f7a253aec77fa190d6c5ec870bf3 (patch) | |
| tree | 9b1ce196eebdac814370c9bc1f86a62c80b45aa0 /src | |
| parent | 9b233997f468fe8a4f4cb7c0c799aff2e3374ba1 (diff) | |
| download | emacs-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')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/buffer.c | 6 | ||||
| -rw-r--r-- | src/buffer.h | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/window.c | 28 | ||||
| -rw-r--r-- | src/xdisp.c | 8 |
6 files changed, 34 insertions, 24 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1a4c29f2580..654b9425770 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-04-24 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * window.c (Fset_window_configuration): Deactivate the mark before | ||
| 4 | unsetting the mark. | ||
| 5 | (set_window_buffer): Ignore window_initialized. | ||
| 6 | (window_initialized): Remove. | ||
| 7 | * keyboard.c (Qdeactivate_mark): Not static any more. | ||
| 8 | * buffer.c (buffer_local_value): Rename from buffer_local_value_1. | ||
| 9 | Update all callers. | ||
| 10 | |||
| 1 | 2014-04-23 Paul Eggert <eggert@cs.ucla.edu> | 11 | 2014-04-23 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 12 | ||
| 3 | * conf_post.h (ADDRESS_SANITIZER_WORKAROUND): Port to GCC 4.9.0 | 13 | * conf_post.h (ADDRESS_SANITIZER_WORKAROUND): Port to GCC 4.9.0 |
diff --git a/src/buffer.c b/src/buffer.c index 6a1a74ac1ec..e6968e88d01 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1158,10 +1158,10 @@ DEFUN ("buffer-local-value", Fbuffer_local_value, | |||
| 1158 | Sbuffer_local_value, 2, 2, 0, | 1158 | Sbuffer_local_value, 2, 2, 0, |
| 1159 | doc: /* Return the value of VARIABLE in BUFFER. | 1159 | doc: /* Return the value of VARIABLE in BUFFER. |
| 1160 | If VARIABLE does not have a buffer-local binding in BUFFER, the value | 1160 | If VARIABLE does not have a buffer-local binding in BUFFER, the value |
| 1161 | is the default binding of the variable. */) | 1161 | is the default binding of the variable. */) |
| 1162 | (register Lisp_Object variable, register Lisp_Object buffer) | 1162 | (register Lisp_Object variable, register Lisp_Object buffer) |
| 1163 | { | 1163 | { |
| 1164 | register Lisp_Object result = buffer_local_value_1 (variable, buffer); | 1164 | register Lisp_Object result = buffer_local_value (variable, buffer); |
| 1165 | 1165 | ||
| 1166 | if (EQ (result, Qunbound)) | 1166 | if (EQ (result, Qunbound)) |
| 1167 | xsignal1 (Qvoid_variable, variable); | 1167 | xsignal1 (Qvoid_variable, variable); |
| @@ -1174,7 +1174,7 @@ is the default binding of the variable. */) | |||
| 1174 | locally unbound. */ | 1174 | locally unbound. */ |
| 1175 | 1175 | ||
| 1176 | Lisp_Object | 1176 | Lisp_Object |
| 1177 | buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer) | 1177 | buffer_local_value (Lisp_Object variable, Lisp_Object buffer) |
| 1178 | { | 1178 | { |
| 1179 | register struct buffer *buf; | 1179 | register struct buffer *buf; |
| 1180 | register Lisp_Object result; | 1180 | register Lisp_Object result; |
diff --git a/src/buffer.h b/src/buffer.h index de117eb9c61..5c1e1bb278c 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -1079,7 +1079,7 @@ extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); | |||
| 1079 | extern void validate_region (Lisp_Object *, Lisp_Object *); | 1079 | extern void validate_region (Lisp_Object *, Lisp_Object *); |
| 1080 | extern void set_buffer_internal_1 (struct buffer *); | 1080 | extern void set_buffer_internal_1 (struct buffer *); |
| 1081 | extern void set_buffer_temp (struct buffer *); | 1081 | extern void set_buffer_temp (struct buffer *); |
| 1082 | extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); | 1082 | extern Lisp_Object buffer_local_value (Lisp_Object, Lisp_Object); |
| 1083 | extern void record_buffer (Lisp_Object); | 1083 | extern void record_buffer (Lisp_Object); |
| 1084 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); | 1084 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); |
| 1085 | extern void mmap_set_vars (bool); | 1085 | extern void mmap_set_vars (bool); |
diff --git a/src/keyboard.c b/src/keyboard.c index 705e9191c61..d52483e6a18 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -228,14 +228,14 @@ static Lisp_Object Qbackward_char; | |||
| 228 | Lisp_Object Qundefined; | 228 | Lisp_Object Qundefined; |
| 229 | static Lisp_Object Qtimer_event_handler; | 229 | static Lisp_Object Qtimer_event_handler; |
| 230 | 230 | ||
| 231 | /* read_key_sequence stores here the command definition of the | 231 | /* `read_key_sequence' stores here the command definition of the |
| 232 | key sequence that it reads. */ | 232 | key sequence that it reads. */ |
| 233 | static Lisp_Object read_key_sequence_cmd; | 233 | static Lisp_Object read_key_sequence_cmd; |
| 234 | static Lisp_Object read_key_sequence_remapped; | 234 | static Lisp_Object read_key_sequence_remapped; |
| 235 | 235 | ||
| 236 | static Lisp_Object Qinput_method_function; | 236 | static Lisp_Object Qinput_method_function; |
| 237 | 237 | ||
| 238 | static Lisp_Object Qdeactivate_mark; | 238 | Lisp_Object Qdeactivate_mark; |
| 239 | 239 | ||
| 240 | Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook; | 240 | Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook; |
| 241 | 241 | ||
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. */ |
| 120 | static int sequence_number; | 120 | static int sequence_number; |
| 121 | 121 | ||
| 122 | /* Nonzero after init_window_once has finished. */ | ||
| 123 | static int window_initialized; | ||
| 124 | |||
| 125 | /* Hook to run when window config changes. */ | 122 | /* Hook to run when window config changes. */ |
| 126 | static Lisp_Object Qwindow_configuration_change_hook; | 123 | static 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 | ||
| 7145 | void | 7145 | void |
diff --git a/src/xdisp.c b/src/xdisp.c index bb91d6f5e1f..6728a0275ea 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -23422,7 +23422,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, | |||
| 23422 | return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); | 23422 | return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); |
| 23423 | } | 23423 | } |
| 23424 | 23424 | ||
| 23425 | prop = buffer_local_value_1 (prop, it->w->contents); | 23425 | prop = buffer_local_value (prop, it->w->contents); |
| 23426 | if (EQ (prop, Qunbound)) | 23426 | if (EQ (prop, Qunbound)) |
| 23427 | prop = Qnil; | 23427 | prop = Qnil; |
| 23428 | } | 23428 | } |
| @@ -23474,7 +23474,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, | |||
| 23474 | return OK_PIXELS (pixels); | 23474 | return OK_PIXELS (pixels); |
| 23475 | } | 23475 | } |
| 23476 | 23476 | ||
| 23477 | car = buffer_local_value_1 (car, it->w->contents); | 23477 | car = buffer_local_value (car, it->w->contents); |
| 23478 | if (EQ (car, Qunbound)) | 23478 | if (EQ (car, Qunbound)) |
| 23479 | car = Qnil; | 23479 | car = Qnil; |
| 23480 | } | 23480 | } |
| @@ -28543,8 +28543,8 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 28543 | else if (area == ON_MODE_LINE) | 28543 | else if (area == ON_MODE_LINE) |
| 28544 | { | 28544 | { |
| 28545 | Lisp_Object default_help | 28545 | Lisp_Object default_help |
| 28546 | = buffer_local_value_1 (Qmode_line_default_help_echo, | 28546 | = buffer_local_value (Qmode_line_default_help_echo, |
| 28547 | w->contents); | 28547 | w->contents); |
| 28548 | 28548 | ||
| 28549 | if (STRINGP (default_help)) | 28549 | if (STRINGP (default_help)) |
| 28550 | { | 28550 | { |