aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2011-08-23 20:49:03 +0900
committerKenichi Handa2011-08-23 20:49:03 +0900
commit821ff7208c4a8fb4b12a0ea8039006d2b2e57463 (patch)
tree9c34cedc8b73af96522f01e5f5ba45de71d7dbb1 /src
parent0902a04edd7a2e0ca5d73fd996e46f26d5228501 (diff)
parent8ddde6516c5bd15ea8af79800779a28c8742c488 (diff)
downloademacs-821ff7208c4a8fb4b12a0ea8039006d2b2e57463.tar.gz
emacs-821ff7208c4a8fb4b12a0ea8039006d2b2e57463.zip
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog53
-rw-r--r--src/cmds.c3
-rw-r--r--src/dispnew.c3
-rw-r--r--src/eval.c12
-rw-r--r--src/image.c54
-rw-r--r--src/xdisp.c12
6 files changed, 97 insertions, 40 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5b4e0023ac6..a3c7c2f09d2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,6 +3,41 @@
3 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a 3 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4 extra slot even if the purpose is char-code-property-table. 4 extra slot even if the purpose is char-code-property-table.
5 5
62011-08-23 Eli Zaretskii <eliz@gnu.org>
7
8 * xdisp.c (redisplay_window): When computing centering_position,
9 account for the height of the header line. (Bug#8874)
10
11 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13 candidate is selected by the mouse, and that candidate has a
14 composed character under the mouse.
15
16 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17 coordinates reported by pos-visible-in-window-p for a composed
18 character in column zero.
19
202011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
21
22 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
23
242011-08-22 Eli Zaretskii <eliz@gnu.org>
25
26 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
27 consider it a hit if to_charpos is anywhere in the range of the
28 composed buffer positions.
29
302011-08-22 Chong Yidong <cyd@stupidchicken.com>
31
32 * image.c (gif_load): Don't assume that each subimage has the same
33 dimensions as the base image. Handle disposal method that is
34 "undefined" by the gif spec (Bug#9335).
35
362011-08-20 Chong Yidong <cyd@stupidchicken.com>
37
38 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
39 (Fcondition_case): Document `debug' symbol in error handler.
40
62011-08-19 Eli Zaretskii <eliz@gnu.org> 412011-08-19 Eli Zaretskii <eliz@gnu.org>
7 42
8 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of 43 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
@@ -33,8 +68,8 @@
332011-08-17 Chong Yidong <cyd@stupidchicken.com> 682011-08-17 Chong Yidong <cyd@stupidchicken.com>
34 69
35 * eval.c (internal_condition_case, internal_condition_case_1) 70 * eval.c (internal_condition_case, internal_condition_case_1)
36 (internal_condition_case_2, internal_condition_case_n): Remove 71 (internal_condition_case_2, internal_condition_case_n):
37 unnecessary aborts (Bug#9081). 72 Remove unnecessary aborts (Bug#9081).
38 73
392011-08-17 Eli Zaretskii <eliz@gnu.org> 742011-08-17 Eli Zaretskii <eliz@gnu.org>
40 75
@@ -57,8 +92,8 @@
57 * unexcw.c ( __malloc_initialized): Declare external variable. 92 * unexcw.c ( __malloc_initialized): Declare external variable.
58 (fixup_executable): Force the dumped emacs to reinitialize malloc. 93 (fixup_executable): Force the dumped emacs to reinitialize malloc.
59 94
60 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): New 95 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
61 variables. 96 New variables.
62 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the 97 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
63 dumped emacs. 98 dumped emacs.
64 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage 99 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
@@ -160,8 +195,8 @@
160 * xdisp.c (iterate_out_of_display_property): xassert that 195 * xdisp.c (iterate_out_of_display_property): xassert that
161 IT->position is set to within IT->object's boundaries. Break from 196 IT->position is set to within IT->object's boundaries. Break from
162 the loop as soon as EOB is reached; avoids infloops in redisplay 197 the loop as soon as EOB is reached; avoids infloops in redisplay
163 when IT->position is set up wrongly due to some bug. Set 198 when IT->position is set up wrongly due to some bug.
164 IT->current to match the bidi iterator unconditionally. 199 Set IT->current to match the bidi iterator unconditionally.
165 (push_display_prop): Allow GET_FROM_STRING as IT->method on 200 (push_display_prop): Allow GET_FROM_STRING as IT->method on
166 entry. Force push_it to save on the stack the current 201 entry. Force push_it to save on the stack the current
167 buffer/string position, to be restored by pop_it. Fix flags in 202 buffer/string position, to be restored by pop_it. Fix flags in
@@ -184,8 +219,8 @@
1842011-08-08 Eli Zaretskii <eliz@gnu.org> 2192011-08-08 Eli Zaretskii <eliz@gnu.org>
185 220
186 * xdisp.c (forward_to_next_line_start): Allow to use the 221 * xdisp.c (forward_to_next_line_start): Allow to use the
187 no-display-properties-and-no-overlays under bidi display. Set 222 no-display-properties-and-no-overlays under bidi display.
188 disp_pos in the bidi iterator to avoid searches for display 223 Set disp_pos in the bidi iterator to avoid searches for display
189 properties and overlays. 224 properties and overlays.
190 225
1912011-08-08 Chong Yidong <cyd@stupidchicken.com> 2262011-08-08 Chong Yidong <cyd@stupidchicken.com>
@@ -223,7 +258,7 @@
223 * bidi.c <bidi_cache_total_alloc>: Now static. 258 * bidi.c <bidi_cache_total_alloc>: Now static.
224 (bidi_initialize): Initialize bidi_cache_total_alloc. 259 (bidi_initialize): Initialize bidi_cache_total_alloc.
225 260
226 *xdisp.c (display_line): Release buffer allocated for shelved bidi 261 * xdisp.c (display_line): Release buffer allocated for shelved bidi
227 cache. (Bug#9221) 262 cache. (Bug#9221)
228 263
229 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total 264 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
diff --git a/src/cmds.c b/src/cmds.c
index f49cfc221be..c079ad7168f 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -271,7 +271,8 @@ Whichever character you type to run this command is inserted.
271Before insertion, `expand-abbrev' is executed if the inserted character does 271Before insertion, `expand-abbrev' is executed if the inserted character does
272not have word syntax and the previous character in the buffer does. 272not have word syntax and the previous character in the buffer does.
273After insertion, the value of `auto-fill-function' is called if the 273After insertion, the value of `auto-fill-function' is called if the
274`auto-fill-chars' table has a non-nil value for the inserted character. */) 274`auto-fill-chars' table has a non-nil value for the inserted character.
275At the end, it runs `post-self-insert-hook'. */)
275 (Lisp_Object n) 276 (Lisp_Object n)
276{ 277{
277 int remove_boundary = 1; 278 int remove_boundary = 1;
diff --git a/src/dispnew.c b/src/dispnew.c
index fadfbb26603..e2bcf5d7090 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5307,7 +5307,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5307 if (STRINGP (it.string)) 5307 if (STRINGP (it.string))
5308 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); 5308 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
5309 else 5309 else
5310 BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos)); 5310 BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer),
5311 CHARPOS (pos->pos));
5311 } 5312 }
5312 5313
5313#ifdef HAVE_WINDOW_SYSTEM 5314#ifdef HAVE_WINDOW_SYSTEM
diff --git a/src/eval.c b/src/eval.c
index e37425020c9..372e9954620 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1357,8 +1357,12 @@ A handler is applicable to an error
1357if CONDITION-NAME is one of the error's condition names. 1357if CONDITION-NAME is one of the error's condition names.
1358If an error happens, the first applicable handler is run. 1358If an error happens, the first applicable handler is run.
1359 1359
1360The car of a handler may be a list of condition names 1360The car of a handler may be a list of condition names instead of a
1361instead of a single condition name. Then it handles all of them. 1361single condition name; then it handles all of them. If the special
1362condition name `debug' is present in this list, it allows another
1363condition in the list to run the debugger if `debug-on-error' and the
1364other usual mechanisms says it should (otherwise, `condition-case'
1365suppresses the debugger).
1362 1366
1363When a handler handles an error, control returns to the `condition-case' 1367When a handler handles an error, control returns to the `condition-case'
1364and it executes the handler's BODY... 1368and it executes the handler's BODY...
@@ -1699,6 +1703,10 @@ See also the function `condition-case'. */)
1699 && (!NILP (Vdebug_on_signal) 1703 && (!NILP (Vdebug_on_signal)
1700 /* If no handler is present now, try to run the debugger. */ 1704 /* If no handler is present now, try to run the debugger. */
1701 || NILP (clause) 1705 || NILP (clause)
1706 /* A `debug' symbol in the handler list disables the normal
1707 suppression of the debugger. */
1708 || (CONSP (clause) && CONSP (XCAR (clause))
1709 && !NILP (Fmemq (Qdebug, XCAR (clause))))
1702 /* Special handler that means "print a message and run debugger 1710 /* Special handler that means "print a message and run debugger
1703 if requested". */ 1711 if requested". */
1704 || EQ (h->handler, Qerror))) 1712 || EQ (h->handler, Qerror)))
diff --git a/src/image.c b/src/image.c
index d1091aec6f3..65be22b087a 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7139,7 +7139,6 @@ gif_load (struct frame *f, struct image *img)
7139 ColorMapObject *gif_color_map; 7139 ColorMapObject *gif_color_map;
7140 unsigned long pixel_colors[256]; 7140 unsigned long pixel_colors[256];
7141 GifFileType *gif; 7141 GifFileType *gif;
7142 int image_height, image_width;
7143 gif_memory_source memsrc; 7142 gif_memory_source memsrc;
7144 Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); 7143 Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL);
7145 Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); 7144 Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL);
@@ -7216,19 +7215,13 @@ gif_load (struct frame *f, struct image *img)
7216 } 7215 }
7217 } 7216 }
7218 7217
7219 img->corners[TOP_CORNER] = gif->SavedImages[idx].ImageDesc.Top; 7218 width = img->width = gif->SWidth;
7220 img->corners[LEFT_CORNER] = gif->SavedImages[idx].ImageDesc.Left; 7219 height = img->height = gif->SHeight;
7221 image_height = gif->SavedImages[idx].ImageDesc.Height;
7222 img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height;
7223 image_width = gif->SavedImages[idx].ImageDesc.Width;
7224 img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width;
7225 7220
7226 width = img->width = max (gif->SWidth, 7221 img->corners[TOP_CORNER] = gif->SavedImages[0].ImageDesc.Top;
7227 max (gif->Image.Left + gif->Image.Width, 7222 img->corners[LEFT_CORNER] = gif->SavedImages[0].ImageDesc.Left;
7228 img->corners[RIGHT_CORNER])); 7223 img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + height;
7229 height = img->height = max (gif->SHeight, 7224 img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + width;
7230 max (gif->Image.Top + gif->Image.Height,
7231 img->corners[BOT_CORNER]));
7232 7225
7233 if (!check_image_size (f, width, height)) 7226 if (!check_image_size (f, width, height))
7234 { 7227 {
@@ -7283,6 +7276,10 @@ gif_load (struct frame *f, struct image *img)
7283 unsigned char *raster = (unsigned char *) subimage->RasterBits; 7276 unsigned char *raster = (unsigned char *) subimage->RasterBits;
7284 int transparency_color_index = -1; 7277 int transparency_color_index = -1;
7285 int disposal = 0; 7278 int disposal = 0;
7279 int subimg_width = subimage->ImageDesc.Width;
7280 int subimg_height = subimage->ImageDesc.Height;
7281 int subimg_top = subimage->ImageDesc.Top;
7282 int subimg_left = subimage->ImageDesc.Left;
7286 7283
7287 /* Find the Graphic Control Extension block for this sub-image. 7284 /* Find the Graphic Control Extension block for this sub-image.
7288 Extract the disposal method and transparency color. */ 7285 Extract the disposal method and transparency color. */
@@ -7306,6 +7303,13 @@ gif_load (struct frame *f, struct image *img)
7306 if (j == 0) 7303 if (j == 0)
7307 disposal = 2; 7304 disposal = 2;
7308 7305
7306 /* For disposal == 0, the spec says "No disposal specified. The
7307 decoder is not required to take any action." In practice, it
7308 seems we need to treat this like "keep in place", see e.g.
7309 http://upload.wikimedia.org/wikipedia/commons/3/37/Clock.gif */
7310 if (disposal == 0)
7311 disposal = 1;
7312
7309 /* Allocate subimage colors. */ 7313 /* Allocate subimage colors. */
7310 memset (pixel_colors, 0, sizeof pixel_colors); 7314 memset (pixel_colors, 0, sizeof pixel_colors);
7311 gif_color_map = subimage->ImageDesc.ColorMap; 7315 gif_color_map = subimage->ImageDesc.ColorMap;
@@ -7333,34 +7337,34 @@ gif_load (struct frame *f, struct image *img)
7333 int row, pass; 7337 int row, pass;
7334 7338
7335 for (y = 0, row = interlace_start[0], pass = 0; 7339 for (y = 0, row = interlace_start[0], pass = 0;
7336 y < image_height; 7340 y < subimg_height;
7337 y++, row += interlace_increment[pass]) 7341 y++, row += interlace_increment[pass])
7338 { 7342 {
7339 if (row >= image_height) 7343 if (row >= subimg_height)
7340 { 7344 {
7341 row = interlace_start[++pass]; 7345 row = interlace_start[++pass];
7342 while (row >= image_height) 7346 while (row >= subimg_height)
7343 row = interlace_start[++pass]; 7347 row = interlace_start[++pass];
7344 } 7348 }
7345 7349
7346 for (x = 0; x < image_width; x++) 7350 for (x = 0; x < subimg_width; x++)
7347 { 7351 {
7348 int c = raster[y * image_width + x]; 7352 int c = raster[y * subimg_width + x];
7349 if (transparency_color_index != c || disposal != 1) 7353 if (transparency_color_index != c || disposal != 1)
7350 XPutPixel (ximg, x + img->corners[LEFT_CORNER], 7354 XPutPixel (ximg, x + subimg_left, row + subimg_top,
7351 row + img->corners[TOP_CORNER], pixel_colors[c]); 7355 pixel_colors[c]);
7352 } 7356 }
7353 } 7357 }
7354 } 7358 }
7355 else 7359 else
7356 { 7360 {
7357 for (y = 0; y < image_height; ++y) 7361 for (y = 0; y < subimg_height; ++y)
7358 for (x = 0; x < image_width; ++x) 7362 for (x = 0; x < subimg_width; ++x)
7359 { 7363 {
7360 int c = raster[y * image_width + x]; 7364 int c = raster[y * subimg_width + x];
7361 if (transparency_color_index != c || disposal != 1) 7365 if (transparency_color_index != c || disposal != 1)
7362 XPutPixel (ximg, x + img->corners[LEFT_CORNER], 7366 XPutPixel (ximg, x + subimg_left, y + subimg_top,
7363 y + img->corners[TOP_CORNER], pixel_colors[c]); 7367 pixel_colors[c]);
7364 } 7368 }
7365 } 7369 }
7366 } 7370 }
diff --git a/src/xdisp.c b/src/xdisp.c
index e773830800e..6a11628f858 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7699,7 +7699,12 @@ move_it_in_display_line_to (struct it *it,
7699 ((op & MOVE_TO_POS) != 0 \ 7699 ((op & MOVE_TO_POS) != 0 \
7700 && BUFFERP (it->object) \ 7700 && BUFFERP (it->object) \
7701 && (IT_CHARPOS (*it) == to_charpos \ 7701 && (IT_CHARPOS (*it) == to_charpos \
7702 || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos)) \ 7702 || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos) \
7703 || (it->what == IT_COMPOSITION \
7704 && ((IT_CHARPOS (*it) > to_charpos \
7705 && to_charpos >= it->cmp_it.charpos) \
7706 || (IT_CHARPOS (*it) < to_charpos \
7707 && to_charpos <= it->cmp_it.charpos)))) \
7703 && (it->method == GET_FROM_BUFFER \ 7708 && (it->method == GET_FROM_BUFFER \
7704 || (it->method == GET_FROM_DISPLAY_VECTOR \ 7709 || (it->method == GET_FROM_DISPLAY_VECTOR \
7705 && it->dpvec + it->current.dpvec_index + 1 >= it->dpend))) 7710 && it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
@@ -15239,7 +15244,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15239 if (pt_offset) 15244 if (pt_offset)
15240 centering_position -= pt_offset; 15245 centering_position -= pt_offset;
15241 centering_position -= 15246 centering_position -=
15242 FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0)); 15247 FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0))
15248 + WINDOW_HEADER_LINE_HEIGHT (w);
15243 /* Don't let point enter the scroll margin near top of 15249 /* Don't let point enter the scroll margin near top of
15244 the window. */ 15250 the window. */
15245 if (centering_position < margin * FRAME_LINE_HEIGHT (f)) 15251 if (centering_position < margin * FRAME_LINE_HEIGHT (f))
@@ -24059,6 +24065,8 @@ x_produce_glyphs (struct it *it)
24059 Lisp_Object gstring; 24065 Lisp_Object gstring;
24060 struct font_metrics metrics; 24066 struct font_metrics metrics;
24061 24067
24068 it->nglyphs = 1;
24069
24062 gstring = composition_gstring_from_id (it->cmp_it.id); 24070 gstring = composition_gstring_from_id (it->cmp_it.id);
24063 it->pixel_width 24071 it->pixel_width
24064 = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to, 24072 = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to,