diff options
| author | Paul Eggert | 2011-08-24 14:20:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-08-24 14:20:36 -0700 |
| commit | 011ba6eaacfa50cc9871d0cfea34e8f0a7a5bc43 (patch) | |
| tree | ced7a98ff1eb289559da6ebfda46a8e436640da6 /src | |
| parent | fe4496a6e27ac892283b8568adbd12831868cc54 (diff) | |
| parent | f22f4808a08e8f985d5e6175bbd13d5260e1ab1a (diff) | |
| download | emacs-011ba6eaacfa50cc9871d0cfea34e8f0a7a5bc43.tar.gz emacs-011ba6eaacfa50cc9871d0cfea34e8f0a7a5bc43.zip | |
Merge from trunk.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 91 | ||||
| -rw-r--r-- | src/bidi.c | 15 | ||||
| -rw-r--r-- | src/chartab.c | 2 | ||||
| -rw-r--r-- | src/cmds.c | 3 | ||||
| -rw-r--r-- | src/dispnew.c | 3 | ||||
| -rw-r--r-- | src/eval.c | 12 | ||||
| -rw-r--r-- | src/image.c | 54 | ||||
| -rw-r--r-- | src/nsfont.m | 2 | ||||
| -rw-r--r-- | src/process.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 36 |
10 files changed, 165 insertions, 56 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 922a8a33a9c..49d5325c224 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2011-08-19 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-08-24 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Integer and memory overflow issues (Bug#9196). | 3 | Integer and memory overflow issues (Bug#9196). |
| 4 | 4 | ||
| @@ -422,6 +422,77 @@ | |||
| 422 | (gs_load): Use printmax_t to print the widest integers possible. | 422 | (gs_load): Use printmax_t to print the widest integers possible. |
| 423 | Check for integer overflow when computing image height and width. | 423 | Check for integer overflow when computing image height and width. |
| 424 | 424 | ||
| 425 | 2011-08-24 Eli Zaretskii <eliz@gnu.org> | ||
| 426 | |||
| 427 | * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte | ||
| 428 | buffers, return left-to-right. | ||
| 429 | (set_cursor_from_row): Consider candidate row a win if its glyph | ||
| 430 | represents a newline and point is on that newline. Fixes cursor | ||
| 431 | positioning on the newline at EOL of R2L text within L2R | ||
| 432 | paragraph, and vice versa. | ||
| 433 | (try_cursor_movement): Check continued rows, in addition to | ||
| 434 | continuation rows. Fixes unwarranted scroll when point enters a | ||
| 435 | continued line of R2L text within an L2R paragraph, or vice versa. | ||
| 436 | (cursor_row_p): Consider the case of point being equal to | ||
| 437 | MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving | ||
| 438 | from the end of a short line to the beginning of a continued line | ||
| 439 | of R2L text within L2R paragraph. | ||
| 440 | (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for | ||
| 441 | composed characters. | ||
| 442 | |||
| 443 | * bidi.c (bidi_check_type): Use xassert. | ||
| 444 | (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p | ||
| 445 | members. | ||
| 446 | |||
| 447 | 2011-08-23 Eli Zaretskii <eliz@gnu.org> | ||
| 448 | |||
| 449 | * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of | ||
| 450 | a character. | ||
| 451 | |||
| 452 | 2011-08-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 453 | |||
| 454 | * nsfont.m (ns_otf_to_script): Fix typo. | ||
| 455 | |||
| 456 | 2011-08-22 Kenichi Handa <handa@m17n.org> | ||
| 457 | |||
| 458 | * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a | ||
| 459 | extra slot even if the purpose is char-code-property-table. | ||
| 460 | |||
| 461 | 2011-08-23 Eli Zaretskii <eliz@gnu.org> | ||
| 462 | |||
| 463 | * xdisp.c (redisplay_window): When computing centering_position, | ||
| 464 | account for the height of the header line. (Bug#8874) | ||
| 465 | |||
| 466 | * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos | ||
| 467 | instead of CHAR_TO_BYTE. Fixes a crash when a completion | ||
| 468 | candidate is selected by the mouse, and that candidate has a | ||
| 469 | composed character under the mouse. | ||
| 470 | |||
| 471 | * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel | ||
| 472 | coordinates reported by pos-visible-in-window-p for a composed | ||
| 473 | character in column zero. | ||
| 474 | |||
| 475 | 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 476 | |||
| 477 | * cmds.c (Fself_insert_command): Mention post-self-insert-hook. | ||
| 478 | |||
| 479 | 2011-08-22 Eli Zaretskii <eliz@gnu.org> | ||
| 480 | |||
| 481 | * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition, | ||
| 482 | consider it a hit if to_charpos is anywhere in the range of the | ||
| 483 | composed buffer positions. | ||
| 484 | |||
| 485 | 2011-08-22 Chong Yidong <cyd@stupidchicken.com> | ||
| 486 | |||
| 487 | * image.c (gif_load): Don't assume that each subimage has the same | ||
| 488 | dimensions as the base image. Handle disposal method that is | ||
| 489 | "undefined" by the gif spec (Bug#9335). | ||
| 490 | |||
| 491 | 2011-08-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 492 | |||
| 493 | * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329). | ||
| 494 | (Fcondition_case): Document `debug' symbol in error handler. | ||
| 495 | |||
| 425 | 2011-08-19 Eli Zaretskii <eliz@gnu.org> | 496 | 2011-08-19 Eli Zaretskii <eliz@gnu.org> |
| 426 | 497 | ||
| 427 | * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of | 498 | * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of |
| @@ -452,8 +523,8 @@ | |||
| 452 | 2011-08-17 Chong Yidong <cyd@stupidchicken.com> | 523 | 2011-08-17 Chong Yidong <cyd@stupidchicken.com> |
| 453 | 524 | ||
| 454 | * eval.c (internal_condition_case, internal_condition_case_1) | 525 | * eval.c (internal_condition_case, internal_condition_case_1) |
| 455 | (internal_condition_case_2, internal_condition_case_n): Remove | 526 | (internal_condition_case_2, internal_condition_case_n): |
| 456 | unnecessary aborts (Bug#9081). | 527 | Remove unnecessary aborts (Bug#9081). |
| 457 | 528 | ||
| 458 | 2011-08-17 Eli Zaretskii <eliz@gnu.org> | 529 | 2011-08-17 Eli Zaretskii <eliz@gnu.org> |
| 459 | 530 | ||
| @@ -476,8 +547,8 @@ | |||
| 476 | * unexcw.c ( __malloc_initialized): Declare external variable. | 547 | * unexcw.c ( __malloc_initialized): Declare external variable. |
| 477 | (fixup_executable): Force the dumped emacs to reinitialize malloc. | 548 | (fixup_executable): Force the dumped emacs to reinitialize malloc. |
| 478 | 549 | ||
| 479 | * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): New | 550 | * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): |
| 480 | variables. | 551 | New variables. |
| 481 | (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the | 552 | (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the |
| 482 | dumped emacs. | 553 | dumped emacs. |
| 483 | (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage | 554 | (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage |
| @@ -579,8 +650,8 @@ | |||
| 579 | * xdisp.c (iterate_out_of_display_property): xassert that | 650 | * xdisp.c (iterate_out_of_display_property): xassert that |
| 580 | IT->position is set to within IT->object's boundaries. Break from | 651 | IT->position is set to within IT->object's boundaries. Break from |
| 581 | the loop as soon as EOB is reached; avoids infloops in redisplay | 652 | the loop as soon as EOB is reached; avoids infloops in redisplay |
| 582 | when IT->position is set up wrongly due to some bug. Set | 653 | when IT->position is set up wrongly due to some bug. |
| 583 | IT->current to match the bidi iterator unconditionally. | 654 | Set IT->current to match the bidi iterator unconditionally. |
| 584 | (push_display_prop): Allow GET_FROM_STRING as IT->method on | 655 | (push_display_prop): Allow GET_FROM_STRING as IT->method on |
| 585 | entry. Force push_it to save on the stack the current | 656 | entry. Force push_it to save on the stack the current |
| 586 | buffer/string position, to be restored by pop_it. Fix flags in | 657 | buffer/string position, to be restored by pop_it. Fix flags in |
| @@ -603,8 +674,8 @@ | |||
| 603 | 2011-08-08 Eli Zaretskii <eliz@gnu.org> | 674 | 2011-08-08 Eli Zaretskii <eliz@gnu.org> |
| 604 | 675 | ||
| 605 | * xdisp.c (forward_to_next_line_start): Allow to use the | 676 | * xdisp.c (forward_to_next_line_start): Allow to use the |
| 606 | no-display-properties-and-no-overlays under bidi display. Set | 677 | no-display-properties-and-no-overlays under bidi display. |
| 607 | disp_pos in the bidi iterator to avoid searches for display | 678 | Set disp_pos in the bidi iterator to avoid searches for display |
| 608 | properties and overlays. | 679 | properties and overlays. |
| 609 | 680 | ||
| 610 | 2011-08-08 Chong Yidong <cyd@stupidchicken.com> | 681 | 2011-08-08 Chong Yidong <cyd@stupidchicken.com> |
| @@ -642,7 +713,7 @@ | |||
| 642 | * bidi.c <bidi_cache_total_alloc>: Now static. | 713 | * bidi.c <bidi_cache_total_alloc>: Now static. |
| 643 | (bidi_initialize): Initialize bidi_cache_total_alloc. | 714 | (bidi_initialize): Initialize bidi_cache_total_alloc. |
| 644 | 715 | ||
| 645 | *xdisp.c (display_line): Release buffer allocated for shelved bidi | 716 | * xdisp.c (display_line): Release buffer allocated for shelved bidi |
| 646 | cache. (Bug#9221) | 717 | cache. (Bug#9221) |
| 647 | 718 | ||
| 648 | * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total | 719 | * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total |
diff --git a/src/bidi.c b/src/bidi.c index 769a14f089b..433c2cea2dc 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -108,8 +108,12 @@ bidi_get_type (int ch, bidi_dir_t override) | |||
| 108 | abort (); | 108 | abort (); |
| 109 | 109 | ||
| 110 | default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); | 110 | default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); |
| 111 | if (default_type == 0) | 111 | /* Every valid character code, even those that are unassigned by the |
| 112 | default_type = STRONG_L; | 112 | UCD, have some bidi-class property, according to |
| 113 | DerivedBidiClass.txt file. Therefore, if we ever get UNKNOWN_BT | ||
| 114 | (= zero) code from CHAR_TABLE_REF, that's a bug. */ | ||
| 115 | if (default_type == UNKNOWN_BT) | ||
| 116 | abort (); | ||
| 113 | 117 | ||
| 114 | if (override == NEUTRAL_DIR) | 118 | if (override == NEUTRAL_DIR) |
| 115 | return default_type; | 119 | return default_type; |
| @@ -142,11 +146,10 @@ bidi_get_type (int ch, bidi_dir_t override) | |||
| 142 | } | 146 | } |
| 143 | } | 147 | } |
| 144 | 148 | ||
| 145 | static void | 149 | static inline void |
| 146 | bidi_check_type (bidi_type_t type) | 150 | bidi_check_type (bidi_type_t type) |
| 147 | { | 151 | { |
| 148 | if (type < UNKNOWN_BT || type > NEUTRAL_ON) | 152 | xassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); |
| 149 | abort (); | ||
| 150 | } | 153 | } |
| 151 | 154 | ||
| 152 | /* Given a bidi TYPE of a character, return its category. */ | 155 | /* Given a bidi TYPE of a character, return its category. */ |
| @@ -549,6 +552,8 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) | |||
| 549 | bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral; | 552 | bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral; |
| 550 | bidi_cache[idx].next_for_ws = bidi_it->next_for_ws; | 553 | bidi_cache[idx].next_for_ws = bidi_it->next_for_ws; |
| 551 | bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit; | 554 | bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit; |
| 555 | bidi_cache[idx].disp_pos = bidi_it->disp_pos; | ||
| 556 | bidi_cache[idx].disp_prop_p = bidi_it->disp_prop_p; | ||
| 552 | } | 557 | } |
| 553 | 558 | ||
| 554 | bidi_cache_last_idx = idx; | 559 | bidi_cache_last_idx = idx; |
diff --git a/src/chartab.c b/src/chartab.c index 0cabaac4cf5..1d4ac04312a 100644 --- a/src/chartab.c +++ b/src/chartab.c | |||
| @@ -589,8 +589,6 @@ DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot, | |||
| 589 | (Lisp_Object char_table, Lisp_Object n, Lisp_Object value) | 589 | (Lisp_Object char_table, Lisp_Object n, Lisp_Object value) |
| 590 | { | 590 | { |
| 591 | CHECK_CHAR_TABLE (char_table); | 591 | CHECK_CHAR_TABLE (char_table); |
| 592 | if (EQ (XCHAR_TABLE (char_table)->purpose, Qchar_code_property_table)) | ||
| 593 | error ("Can't change extra-slot of char-code-property-table"); | ||
| 594 | CHECK_NUMBER (n); | 592 | CHECK_NUMBER (n); |
| 595 | if (XINT (n) < 0 | 593 | if (XINT (n) < 0 |
| 596 | || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) | 594 | || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) |
diff --git a/src/cmds.c b/src/cmds.c index 2feaf313f23..5a155ac77a5 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -271,7 +271,8 @@ Whichever character you type to run this command is inserted. | |||
| 271 | Before insertion, `expand-abbrev' is executed if the inserted character does | 271 | Before insertion, `expand-abbrev' is executed if the inserted character does |
| 272 | not have word syntax and the previous character in the buffer does. | 272 | not have word syntax and the previous character in the buffer does. |
| 273 | After insertion, the value of `auto-fill-function' is called if the | 273 | After 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. |
| 275 | At 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 5fedbb75a3a..e96583e0025 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5314,7 +5314,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5314 | if (STRINGP (it.string)) | 5314 | if (STRINGP (it.string)) |
| 5315 | BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); | 5315 | BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); |
| 5316 | else | 5316 | else |
| 5317 | BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos)); | 5317 | BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer), |
| 5318 | CHARPOS (pos->pos)); | ||
| 5318 | } | 5319 | } |
| 5319 | 5320 | ||
| 5320 | #ifdef HAVE_WINDOW_SYSTEM | 5321 | #ifdef HAVE_WINDOW_SYSTEM |
diff --git a/src/eval.c b/src/eval.c index 8149683a104..e722b53fb72 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1358,8 +1358,12 @@ A handler is applicable to an error | |||
| 1358 | if CONDITION-NAME is one of the error's condition names. | 1358 | if CONDITION-NAME is one of the error's condition names. |
| 1359 | If an error happens, the first applicable handler is run. | 1359 | If an error happens, the first applicable handler is run. |
| 1360 | 1360 | ||
| 1361 | The car of a handler may be a list of condition names | 1361 | The car of a handler may be a list of condition names instead of a |
| 1362 | instead of a single condition name. Then it handles all of them. | 1362 | single condition name; then it handles all of them. If the special |
| 1363 | condition name `debug' is present in this list, it allows another | ||
| 1364 | condition in the list to run the debugger if `debug-on-error' and the | ||
| 1365 | other usual mechanisms says it should (otherwise, `condition-case' | ||
| 1366 | suppresses the debugger). | ||
| 1363 | 1367 | ||
| 1364 | When a handler handles an error, control returns to the `condition-case' | 1368 | When a handler handles an error, control returns to the `condition-case' |
| 1365 | and it executes the handler's BODY... | 1369 | and it executes the handler's BODY... |
| @@ -1700,6 +1704,10 @@ See also the function `condition-case'. */) | |||
| 1700 | && (!NILP (Vdebug_on_signal) | 1704 | && (!NILP (Vdebug_on_signal) |
| 1701 | /* If no handler is present now, try to run the debugger. */ | 1705 | /* If no handler is present now, try to run the debugger. */ |
| 1702 | || NILP (clause) | 1706 | || NILP (clause) |
| 1707 | /* A `debug' symbol in the handler list disables the normal | ||
| 1708 | suppression of the debugger. */ | ||
| 1709 | || (CONSP (clause) && CONSP (XCAR (clause)) | ||
| 1710 | && !NILP (Fmemq (Qdebug, XCAR (clause)))) | ||
| 1703 | /* Special handler that means "print a message and run debugger | 1711 | /* Special handler that means "print a message and run debugger |
| 1704 | if requested". */ | 1712 | if requested". */ |
| 1705 | || EQ (h->handler, Qerror))) | 1713 | || EQ (h->handler, Qerror))) |
diff --git a/src/image.c b/src/image.c index d10fdad1c54..d0d28bea582 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -7147,7 +7147,6 @@ gif_load (struct frame *f, struct image *img) | |||
| 7147 | ColorMapObject *gif_color_map; | 7147 | ColorMapObject *gif_color_map; |
| 7148 | unsigned long pixel_colors[256]; | 7148 | unsigned long pixel_colors[256]; |
| 7149 | GifFileType *gif; | 7149 | GifFileType *gif; |
| 7150 | int image_height, image_width; | ||
| 7151 | gif_memory_source memsrc; | 7150 | gif_memory_source memsrc; |
| 7152 | Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); | 7151 | Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); |
| 7153 | Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); | 7152 | Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); |
| @@ -7224,19 +7223,13 @@ gif_load (struct frame *f, struct image *img) | |||
| 7224 | } | 7223 | } |
| 7225 | } | 7224 | } |
| 7226 | 7225 | ||
| 7227 | img->corners[TOP_CORNER] = gif->SavedImages[idx].ImageDesc.Top; | 7226 | width = img->width = gif->SWidth; |
| 7228 | img->corners[LEFT_CORNER] = gif->SavedImages[idx].ImageDesc.Left; | 7227 | height = img->height = gif->SHeight; |
| 7229 | image_height = gif->SavedImages[idx].ImageDesc.Height; | ||
| 7230 | img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height; | ||
| 7231 | image_width = gif->SavedImages[idx].ImageDesc.Width; | ||
| 7232 | img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width; | ||
| 7233 | 7228 | ||
| 7234 | width = img->width = max (gif->SWidth, | 7229 | img->corners[TOP_CORNER] = gif->SavedImages[0].ImageDesc.Top; |
| 7235 | max (gif->Image.Left + gif->Image.Width, | 7230 | img->corners[LEFT_CORNER] = gif->SavedImages[0].ImageDesc.Left; |
| 7236 | img->corners[RIGHT_CORNER])); | 7231 | img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + height; |
| 7237 | height = img->height = max (gif->SHeight, | 7232 | img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + width; |
| 7238 | max (gif->Image.Top + gif->Image.Height, | ||
| 7239 | img->corners[BOT_CORNER])); | ||
| 7240 | 7233 | ||
| 7241 | if (!check_image_size (f, width, height)) | 7234 | if (!check_image_size (f, width, height)) |
| 7242 | { | 7235 | { |
| @@ -7291,6 +7284,10 @@ gif_load (struct frame *f, struct image *img) | |||
| 7291 | unsigned char *raster = (unsigned char *) subimage->RasterBits; | 7284 | unsigned char *raster = (unsigned char *) subimage->RasterBits; |
| 7292 | int transparency_color_index = -1; | 7285 | int transparency_color_index = -1; |
| 7293 | int disposal = 0; | 7286 | int disposal = 0; |
| 7287 | int subimg_width = subimage->ImageDesc.Width; | ||
| 7288 | int subimg_height = subimage->ImageDesc.Height; | ||
| 7289 | int subimg_top = subimage->ImageDesc.Top; | ||
| 7290 | int subimg_left = subimage->ImageDesc.Left; | ||
| 7294 | 7291 | ||
| 7295 | /* Find the Graphic Control Extension block for this sub-image. | 7292 | /* Find the Graphic Control Extension block for this sub-image. |
| 7296 | Extract the disposal method and transparency color. */ | 7293 | Extract the disposal method and transparency color. */ |
| @@ -7314,6 +7311,13 @@ gif_load (struct frame *f, struct image *img) | |||
| 7314 | if (j == 0) | 7311 | if (j == 0) |
| 7315 | disposal = 2; | 7312 | disposal = 2; |
| 7316 | 7313 | ||
| 7314 | /* For disposal == 0, the spec says "No disposal specified. The | ||
| 7315 | decoder is not required to take any action." In practice, it | ||
| 7316 | seems we need to treat this like "keep in place", see e.g. | ||
| 7317 | http://upload.wikimedia.org/wikipedia/commons/3/37/Clock.gif */ | ||
| 7318 | if (disposal == 0) | ||
| 7319 | disposal = 1; | ||
| 7320 | |||
| 7317 | /* Allocate subimage colors. */ | 7321 | /* Allocate subimage colors. */ |
| 7318 | memset (pixel_colors, 0, sizeof pixel_colors); | 7322 | memset (pixel_colors, 0, sizeof pixel_colors); |
| 7319 | gif_color_map = subimage->ImageDesc.ColorMap; | 7323 | gif_color_map = subimage->ImageDesc.ColorMap; |
| @@ -7341,34 +7345,34 @@ gif_load (struct frame *f, struct image *img) | |||
| 7341 | int row, pass; | 7345 | int row, pass; |
| 7342 | 7346 | ||
| 7343 | for (y = 0, row = interlace_start[0], pass = 0; | 7347 | for (y = 0, row = interlace_start[0], pass = 0; |
| 7344 | y < image_height; | 7348 | y < subimg_height; |
| 7345 | y++, row += interlace_increment[pass]) | 7349 | y++, row += interlace_increment[pass]) |
| 7346 | { | 7350 | { |
| 7347 | if (row >= image_height) | 7351 | if (row >= subimg_height) |
| 7348 | { | 7352 | { |
| 7349 | row = interlace_start[++pass]; | 7353 | row = interlace_start[++pass]; |
| 7350 | while (row >= image_height) | 7354 | while (row >= subimg_height) |
| 7351 | row = interlace_start[++pass]; | 7355 | row = interlace_start[++pass]; |
| 7352 | } | 7356 | } |
| 7353 | 7357 | ||
| 7354 | for (x = 0; x < image_width; x++) | 7358 | for (x = 0; x < subimg_width; x++) |
| 7355 | { | 7359 | { |
| 7356 | int c = raster[y * image_width + x]; | 7360 | int c = raster[y * subimg_width + x]; |
| 7357 | if (transparency_color_index != c || disposal != 1) | 7361 | if (transparency_color_index != c || disposal != 1) |
| 7358 | XPutPixel (ximg, x + img->corners[LEFT_CORNER], | 7362 | XPutPixel (ximg, x + subimg_left, row + subimg_top, |
| 7359 | row + img->corners[TOP_CORNER], pixel_colors[c]); | 7363 | pixel_colors[c]); |
| 7360 | } | 7364 | } |
| 7361 | } | 7365 | } |
| 7362 | } | 7366 | } |
| 7363 | else | 7367 | else |
| 7364 | { | 7368 | { |
| 7365 | for (y = 0; y < image_height; ++y) | 7369 | for (y = 0; y < subimg_height; ++y) |
| 7366 | for (x = 0; x < image_width; ++x) | 7370 | for (x = 0; x < subimg_width; ++x) |
| 7367 | { | 7371 | { |
| 7368 | int c = raster[y * image_width + x]; | 7372 | int c = raster[y * subimg_width + x]; |
| 7369 | if (transparency_color_index != c || disposal != 1) | 7373 | if (transparency_color_index != c || disposal != 1) |
| 7370 | XPutPixel (ximg, x + img->corners[LEFT_CORNER], | 7374 | XPutPixel (ximg, x + subimg_left, y + subimg_top, |
| 7371 | y + img->corners[TOP_CORNER], pixel_colors[c]); | 7375 | pixel_colors[c]); |
| 7372 | } | 7376 | } |
| 7373 | } | 7377 | } |
| 7374 | } | 7378 | } |
diff --git a/src/nsfont.m b/src/nsfont.m index 60f8c5321aa..c4d9123faef 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -303,7 +303,7 @@ static NSString | |||
| 303 | { | 303 | { |
| 304 | Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); | 304 | Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); |
| 305 | return CONSP (script) | 305 | return CONSP (script) |
| 306 | ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME XCDR ((script)))] | 306 | ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (XCDR ((script))))] |
| 307 | : @""; | 307 | : @""; |
| 308 | } | 308 | } |
| 309 | 309 | ||
diff --git a/src/process.c b/src/process.c index 08da53b4a40..a8088322147 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5161,6 +5161,9 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5161 | p->decoding_carryover = coding->carryover_bytes; | 5161 | p->decoding_carryover = coding->carryover_bytes; |
| 5162 | } | 5162 | } |
| 5163 | if (SBYTES (text) > 0) | 5163 | if (SBYTES (text) > 0) |
| 5164 | /* FIXME: It's wrong to wrap or not based on debug-on-error, and | ||
| 5165 | sometimes it's simply wrong to wrap (e.g. when called from | ||
| 5166 | accept-process-output). */ | ||
| 5164 | internal_condition_case_1 (read_process_output_call, | 5167 | internal_condition_case_1 (read_process_output_call, |
| 5165 | Fcons (outstream, | 5168 | Fcons (outstream, |
| 5166 | Fcons (proc, Fcons (text, Qnil))), | 5169 | Fcons (proc, Fcons (text, Qnil))), |
diff --git a/src/xdisp.c b/src/xdisp.c index 86ad523dfdd..e7aee09682b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7696,7 +7696,12 @@ move_it_in_display_line_to (struct it *it, | |||
| 7696 | ((op & MOVE_TO_POS) != 0 \ | 7696 | ((op & MOVE_TO_POS) != 0 \ |
| 7697 | && BUFFERP (it->object) \ | 7697 | && BUFFERP (it->object) \ |
| 7698 | && (IT_CHARPOS (*it) == to_charpos \ | 7698 | && (IT_CHARPOS (*it) == to_charpos \ |
| 7699 | || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos)) \ | 7699 | || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos) \ |
| 7700 | || (it->what == IT_COMPOSITION \ | ||
| 7701 | && ((IT_CHARPOS (*it) > to_charpos \ | ||
| 7702 | && to_charpos >= it->cmp_it.charpos) \ | ||
| 7703 | || (IT_CHARPOS (*it) < to_charpos \ | ||
| 7704 | && to_charpos <= it->cmp_it.charpos)))) \ | ||
| 7700 | && (it->method == GET_FROM_BUFFER \ | 7705 | && (it->method == GET_FROM_BUFFER \ |
| 7701 | || (it->method == GET_FROM_DISPLAY_VECTOR \ | 7706 | || (it->method == GET_FROM_DISPLAY_VECTOR \ |
| 7702 | && it->dpvec + it->current.dpvec_index + 1 >= it->dpend))) | 7707 | && it->dpvec + it->current.dpvec_index + 1 >= it->dpend))) |
| @@ -13789,7 +13794,14 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 13789 | && glyph->charpos != pt_old))))) | 13794 | && glyph->charpos != pt_old))))) |
| 13790 | return 0; | 13795 | return 0; |
| 13791 | /* If this candidate gives an exact match, use that. */ | 13796 | /* If this candidate gives an exact match, use that. */ |
| 13792 | if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) | 13797 | if (!((BUFFERP (glyph->object) && glyph->charpos == pt_old) |
| 13798 | /* If this candidate is a glyph created for the | ||
| 13799 | terminating newline of a line, and point is on that | ||
| 13800 | newline, it wins because it's an exact match. */ | ||
| 13801 | || (!row->continued_p | ||
| 13802 | && INTEGERP (glyph->object) | ||
| 13803 | && glyph->charpos == 0 | ||
| 13804 | && pt_old == MATRIX_ROW_END_CHARPOS (row) - 1)) | ||
| 13793 | /* Otherwise, keep the candidate that comes from a row | 13805 | /* Otherwise, keep the candidate that comes from a row |
| 13794 | spanning less buffer positions. This may win when one or | 13806 | spanning less buffer positions. This may win when one or |
| 13795 | both candidate positions are on glyphs that came from | 13807 | both candidate positions are on glyphs that came from |
| @@ -14571,7 +14583,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14571 | } | 14583 | } |
| 14572 | ++row; | 14584 | ++row; |
| 14573 | } | 14585 | } |
| 14574 | while ((MATRIX_ROW_CONTINUATION_LINE_P (row) | 14586 | while (((MATRIX_ROW_CONTINUATION_LINE_P (row) |
| 14587 | || row->continued_p) | ||
| 14575 | && MATRIX_ROW_BOTTOM_Y (row) <= last_y) | 14588 | && MATRIX_ROW_BOTTOM_Y (row) <= last_y) |
| 14576 | || (MATRIX_ROW_START_CHARPOS (row) == PT | 14589 | || (MATRIX_ROW_START_CHARPOS (row) == PT |
| 14577 | && MATRIX_ROW_BOTTOM_Y (row) < last_y)); | 14590 | && MATRIX_ROW_BOTTOM_Y (row) < last_y)); |
| @@ -15237,7 +15250,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15237 | if (pt_offset) | 15250 | if (pt_offset) |
| 15238 | centering_position -= pt_offset; | 15251 | centering_position -= pt_offset; |
| 15239 | centering_position -= | 15252 | centering_position -= |
| 15240 | FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0)); | 15253 | FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0)) |
| 15254 | + WINDOW_HEADER_LINE_HEIGHT (w); | ||
| 15241 | /* Don't let point enter the scroll margin near top of | 15255 | /* Don't let point enter the scroll margin near top of |
| 15242 | the window. */ | 15256 | the window. */ |
| 15243 | if (centering_position < margin * FRAME_LINE_HEIGHT (f)) | 15257 | if (centering_position < margin * FRAME_LINE_HEIGHT (f)) |
| @@ -18001,7 +18015,8 @@ cursor_row_p (struct glyph_row *row) | |||
| 18001 | { | 18015 | { |
| 18002 | int result = 1; | 18016 | int result = 1; |
| 18003 | 18017 | ||
| 18004 | if (PT == CHARPOS (row->end.pos)) | 18018 | if (PT == CHARPOS (row->end.pos) |
| 18019 | || PT == MATRIX_ROW_END_CHARPOS (row)) | ||
| 18005 | { | 18020 | { |
| 18006 | /* Suppose the row ends on a string. | 18021 | /* Suppose the row ends on a string. |
| 18007 | Unless the row is continued, that means it ends on a newline | 18022 | Unless the row is continued, that means it ends on a newline |
| @@ -18396,10 +18411,10 @@ display_line (struct it *it) | |||
| 18396 | min_pos = current_pos; \ | 18411 | min_pos = current_pos; \ |
| 18397 | min_bpos = current_bpos; \ | 18412 | min_bpos = current_bpos; \ |
| 18398 | } \ | 18413 | } \ |
| 18399 | if (current_pos > max_pos) \ | 18414 | if (IT_CHARPOS (*it) > max_pos) \ |
| 18400 | { \ | 18415 | { \ |
| 18401 | max_pos = current_pos; \ | 18416 | max_pos = IT_CHARPOS (*it); \ |
| 18402 | max_bpos = current_bpos; \ | 18417 | max_bpos = IT_BYTEPOS (*it); \ |
| 18403 | } \ | 18418 | } \ |
| 18404 | } \ | 18419 | } \ |
| 18405 | while (0) | 18420 | while (0) |
| @@ -19006,7 +19021,8 @@ See also `bidi-paragraph-direction'. */) | |||
| 19006 | buf = XBUFFER (buffer); | 19021 | buf = XBUFFER (buffer); |
| 19007 | } | 19022 | } |
| 19008 | 19023 | ||
| 19009 | if (NILP (BVAR (buf, bidi_display_reordering))) | 19024 | if (NILP (BVAR (buf, bidi_display_reordering)) |
| 19025 | || NILP (BVAR (buf, enable_multibyte_characters))) | ||
| 19010 | return Qleft_to_right; | 19026 | return Qleft_to_right; |
| 19011 | else if (!NILP (BVAR (buf, bidi_paragraph_direction))) | 19027 | else if (!NILP (BVAR (buf, bidi_paragraph_direction))) |
| 19012 | return BVAR (buf, bidi_paragraph_direction); | 19028 | return BVAR (buf, bidi_paragraph_direction); |
| @@ -24057,6 +24073,8 @@ x_produce_glyphs (struct it *it) | |||
| 24057 | Lisp_Object gstring; | 24073 | Lisp_Object gstring; |
| 24058 | struct font_metrics metrics; | 24074 | struct font_metrics metrics; |
| 24059 | 24075 | ||
| 24076 | it->nglyphs = 1; | ||
| 24077 | |||
| 24060 | gstring = composition_gstring_from_id (it->cmp_it.id); | 24078 | gstring = composition_gstring_from_id (it->cmp_it.id); |
| 24061 | it->pixel_width | 24079 | it->pixel_width |
| 24062 | = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to, | 24080 | = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to, |