From bd1ba3e824d2d070b76e0c77529a993db2d8b4ba Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 20 Aug 2011 17:17:06 -0400 Subject: * src/eval.c (Fsignal): Handle `debug' symbol in error handler. Fixes: debbugs:9329 --- src/ChangeLog | 4 ++++ src/eval.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 85a55b2b7c9..adf7291eadf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-08-20 Chong Yidong + + * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329). + 2011-08-19 Eli Zaretskii * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of diff --git a/src/eval.c b/src/eval.c index e37425020c9..8b121665ff7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1699,6 +1699,10 @@ See also the function `condition-case'. */) && (!NILP (Vdebug_on_signal) /* If no handler is present now, try to run the debugger. */ || NILP (clause) + /* A `debug' symbol in the handler list disables the normal + suppression of the debugger. */ + || (CONSP (clause) && CONSP (XCAR (clause)) + && !NILP (Fmemq (Qdebug, XCAR (clause)))) /* Special handler that means "print a message and run debugger if requested". */ || EQ (h->handler, Qerror))) -- cgit v1.2.1 From 024a2d76113268052dd9fa85c915c6fb9f29c152 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 20 Aug 2011 17:22:46 -0400 Subject: * eval.c (Fcondition_case): Document `debug' symbol in error handler. --- src/ChangeLog | 1 + src/eval.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index adf7291eadf..82d75d39b40 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2011-08-20 Chong Yidong * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329). + (Fcondition_case): Document `debug' symbol in error handler. 2011-08-19 Eli Zaretskii diff --git a/src/eval.c b/src/eval.c index 8b121665ff7..372e9954620 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1357,8 +1357,12 @@ A handler is applicable to an error if CONDITION-NAME is one of the error's condition names. If an error happens, the first applicable handler is run. -The car of a handler may be a list of condition names -instead of a single condition name. Then it handles all of them. +The car of a handler may be a list of condition names instead of a +single condition name; then it handles all of them. If the special +condition name `debug' is present in this list, it allows another +condition in the list to run the debugger if `debug-on-error' and the +other usual mechanisms says it should (otherwise, `condition-case' +suppresses the debugger). When a handler handles an error, control returns to the `condition-case' and it executes the handler's BODY... -- cgit v1.2.1 From e013fb340c50dd99676ccc4552fd6aae2e319aa8 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 21 Aug 2011 22:34:23 -0400 Subject: Fix animated gif segfault and frame clearing bug. * src/image.c (gif_load): Don't assume that each subimage has the same dimensions as the base image. Handle disposal method that is "undefined" by the gif spec. Fixes: debbugs:9335 --- src/ChangeLog | 6 ++++++ src/image.c | 54 +++++++++++++++++++++++++++++------------------------- 2 files changed, 35 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 82d75d39b40..243a39af45d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-08-22 Chong Yidong + + * image.c (gif_load): Don't assume that each subimage has the same + dimensions as the base image. Handle disposal method that is + "undefined" by the gif spec (Bug#9335). + 2011-08-20 Chong Yidong * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329). 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) ColorMapObject *gif_color_map; unsigned long pixel_colors[256]; GifFileType *gif; - int image_height, image_width; gif_memory_source memsrc; Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); @@ -7216,19 +7215,13 @@ gif_load (struct frame *f, struct image *img) } } - img->corners[TOP_CORNER] = gif->SavedImages[idx].ImageDesc.Top; - img->corners[LEFT_CORNER] = gif->SavedImages[idx].ImageDesc.Left; - image_height = gif->SavedImages[idx].ImageDesc.Height; - img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height; - image_width = gif->SavedImages[idx].ImageDesc.Width; - img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width; + width = img->width = gif->SWidth; + height = img->height = gif->SHeight; - width = img->width = max (gif->SWidth, - max (gif->Image.Left + gif->Image.Width, - img->corners[RIGHT_CORNER])); - height = img->height = max (gif->SHeight, - max (gif->Image.Top + gif->Image.Height, - img->corners[BOT_CORNER])); + img->corners[TOP_CORNER] = gif->SavedImages[0].ImageDesc.Top; + img->corners[LEFT_CORNER] = gif->SavedImages[0].ImageDesc.Left; + img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + height; + img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + width; if (!check_image_size (f, width, height)) { @@ -7283,6 +7276,10 @@ gif_load (struct frame *f, struct image *img) unsigned char *raster = (unsigned char *) subimage->RasterBits; int transparency_color_index = -1; int disposal = 0; + int subimg_width = subimage->ImageDesc.Width; + int subimg_height = subimage->ImageDesc.Height; + int subimg_top = subimage->ImageDesc.Top; + int subimg_left = subimage->ImageDesc.Left; /* Find the Graphic Control Extension block for this sub-image. Extract the disposal method and transparency color. */ @@ -7306,6 +7303,13 @@ gif_load (struct frame *f, struct image *img) if (j == 0) disposal = 2; + /* For disposal == 0, the spec says "No disposal specified. The + decoder is not required to take any action." In practice, it + seems we need to treat this like "keep in place", see e.g. + http://upload.wikimedia.org/wikipedia/commons/3/37/Clock.gif */ + if (disposal == 0) + disposal = 1; + /* Allocate subimage colors. */ memset (pixel_colors, 0, sizeof pixel_colors); gif_color_map = subimage->ImageDesc.ColorMap; @@ -7333,34 +7337,34 @@ gif_load (struct frame *f, struct image *img) int row, pass; for (y = 0, row = interlace_start[0], pass = 0; - y < image_height; + y < subimg_height; y++, row += interlace_increment[pass]) { - if (row >= image_height) + if (row >= subimg_height) { row = interlace_start[++pass]; - while (row >= image_height) + while (row >= subimg_height) row = interlace_start[++pass]; } - for (x = 0; x < image_width; x++) + for (x = 0; x < subimg_width; x++) { - int c = raster[y * image_width + x]; + int c = raster[y * subimg_width + x]; if (transparency_color_index != c || disposal != 1) - XPutPixel (ximg, x + img->corners[LEFT_CORNER], - row + img->corners[TOP_CORNER], pixel_colors[c]); + XPutPixel (ximg, x + subimg_left, row + subimg_top, + pixel_colors[c]); } } } else { - for (y = 0; y < image_height; ++y) - for (x = 0; x < image_width; ++x) + for (y = 0; y < subimg_height; ++y) + for (x = 0; x < subimg_width; ++x) { - int c = raster[y * image_width + x]; + int c = raster[y * subimg_width + x]; if (transparency_color_index != c || disposal != 1) - XPutPixel (ximg, x + img->corners[LEFT_CORNER], - y + img->corners[TOP_CORNER], pixel_colors[c]); + XPutPixel (ximg, x + subimg_left, y + subimg_top, + pixel_colors[c]); } } } -- cgit v1.2.1 From dac347dd4a459bbbd7274f106797201e6e420701 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 22 Aug 2011 20:00:40 +0300 Subject: Fix vertical cursor motion under bidi on auto-composed characters. src/xdisp.c (BUFFER_POS_REACHED_P): If this is a composition, consider it a hit if to_charpos is anywhere in the range of the composed buffer positions. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 243a39af45d..e3cf7546962 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-08-22 Eli Zaretskii + + * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition, + consider it a hit if to_charpos is anywhere in the range of the + composed buffer positions. + 2011-08-22 Chong Yidong * image.c (gif_load): Don't assume that each subimage has the same diff --git a/src/xdisp.c b/src/xdisp.c index e773830800e..1878327480f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7699,7 +7699,12 @@ move_it_in_display_line_to (struct it *it, ((op & MOVE_TO_POS) != 0 \ && BUFFERP (it->object) \ && (IT_CHARPOS (*it) == to_charpos \ - || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos)) \ + || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos) \ + || (it->what == IT_COMPOSITION \ + && ((IT_CHARPOS (*it) > to_charpos \ + && to_charpos >= it->cmp_it.charpos) \ + || (IT_CHARPOS (*it) < to_charpos \ + && to_charpos <= it->cmp_it.charpos)))) \ && (it->method == GET_FROM_BUFFER \ || (it->method == GET_FROM_DISPLAY_VECTOR \ && it->dpvec + it->current.dpvec_index + 1 >= it->dpend))) -- cgit v1.2.1 From 8b76d6f8eab68baebd7cc7da85e93bf09e4d34da Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 22 Aug 2011 23:09:59 -0400 Subject: * src/cmds.c (Fself_insert_command): Mention post-self-insert-hook. --- src/ChangeLog | 22 +++++++++++++--------- src/cmds.c | 3 ++- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e3cf7546962..a1a826d625f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-08-23 Stefan Monnier + + * cmds.c (Fself_insert_command): Mention post-self-insert-hook. + 2011-08-22 Eli Zaretskii * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition, @@ -45,8 +49,8 @@ 2011-08-17 Chong Yidong * eval.c (internal_condition_case, internal_condition_case_1) - (internal_condition_case_2, internal_condition_case_n): Remove - unnecessary aborts (Bug#9081). + (internal_condition_case_2, internal_condition_case_n): + Remove unnecessary aborts (Bug#9081). 2011-08-17 Eli Zaretskii @@ -69,8 +73,8 @@ * unexcw.c ( __malloc_initialized): Declare external variable. (fixup_executable): Force the dumped emacs to reinitialize malloc. - * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): New - variables. + * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): + New variables. (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the dumped emacs. (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage @@ -172,8 +176,8 @@ * xdisp.c (iterate_out_of_display_property): xassert that IT->position is set to within IT->object's boundaries. Break from the loop as soon as EOB is reached; avoids infloops in redisplay - when IT->position is set up wrongly due to some bug. Set - IT->current to match the bidi iterator unconditionally. + when IT->position is set up wrongly due to some bug. + Set IT->current to match the bidi iterator unconditionally. (push_display_prop): Allow GET_FROM_STRING as IT->method on entry. Force push_it to save on the stack the current buffer/string position, to be restored by pop_it. Fix flags in @@ -196,8 +200,8 @@ 2011-08-08 Eli Zaretskii * xdisp.c (forward_to_next_line_start): Allow to use the - no-display-properties-and-no-overlays under bidi display. Set - disp_pos in the bidi iterator to avoid searches for display + no-display-properties-and-no-overlays under bidi display. + Set disp_pos in the bidi iterator to avoid searches for display properties and overlays. 2011-08-08 Chong Yidong @@ -235,7 +239,7 @@ * bidi.c : Now static. (bidi_initialize): Initialize bidi_cache_total_alloc. - *xdisp.c (display_line): Release buffer allocated for shelved bidi + * xdisp.c (display_line): Release buffer allocated for shelved bidi cache. (Bug#9221) * 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. Before insertion, `expand-abbrev' is executed if the inserted character does not have word syntax and the previous character in the buffer does. After insertion, the value of `auto-fill-function' is called if the -`auto-fill-chars' table has a non-nil value for the inserted character. */) +`auto-fill-chars' table has a non-nil value for the inserted character. +At the end, it runs `post-self-insert-hook'. */) (Lisp_Object n) { int remove_boundary = 1; -- cgit v1.2.1 From 1a2e6670cf53a76bfd134c8453f81a2de8c6ea5c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 23 Aug 2011 10:01:25 +0300 Subject: Fix pos-visible-in-window-p for zero-column composed character. src/xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel coordinates reported by pos-visible-in-window-p for a composed character in column zero. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a1a826d625f..ffb8dd76366 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-08-23 Eli Zaretskii + + * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel + coordinates reported by pos-visible-in-window-p for a composed + character in column zero. + 2011-08-23 Stefan Monnier * cmds.c (Fself_insert_command): Mention post-self-insert-hook. diff --git a/src/xdisp.c b/src/xdisp.c index 1878327480f..9b2b0da4317 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -24064,6 +24064,8 @@ x_produce_glyphs (struct it *it) Lisp_Object gstring; struct font_metrics metrics; + it->nglyphs = 1; + gstring = composition_gstring_from_id (it->cmp_it.id); it->pixel_width = composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to, -- cgit v1.2.1 From 425cc014ac9191debe8c01dc360685486bba0ff1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 23 Aug 2011 11:38:29 +0300 Subject: Fix crashes with completion and composed characters. src/dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos instead of CHAR_TO_BYTE. Fixes a crash when a completion candidate is selected by the mouse, and that candidate has a composed character under the mouse. --- src/ChangeLog | 5 +++++ src/dispnew.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ffb8dd76366..d4f654a1028 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2011-08-23 Eli Zaretskii + * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos + instead of CHAR_TO_BYTE. Fixes a crash when a completion + candidate is selected by the mouse, and that candidate has a + composed character under the mouse. + * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel coordinates reported by pos-visible-in-window-p for a composed character in column zero. 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 if (STRINGP (it.string)) BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); else - BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos)); + BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer), + CHARPOS (pos->pos)); } #ifdef HAVE_WINDOW_SYSTEM -- cgit v1.2.1 From 8ddde6516c5bd15ea8af79800779a28c8742c488 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 23 Aug 2011 13:35:47 +0300 Subject: Fix bug #8874 with recentering and header line under scroll-conservatively. src/xdisp.c (redisplay_window): When computing centering_position, account for the height of the header line. --- src/ChangeLog | 3 +++ src/xdisp.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d4f654a1028..1b1a8f67e43 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-08-23 Eli Zaretskii + * xdisp.c (redisplay_window): When computing centering_position, + account for the height of the header line. (Bug#8874) + * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos instead of CHAR_TO_BYTE. Fixes a crash when a completion candidate is selected by the mouse, and that candidate has a diff --git a/src/xdisp.c b/src/xdisp.c index 9b2b0da4317..6a11628f858 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15244,7 +15244,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p) if (pt_offset) centering_position -= pt_offset; centering_position -= - FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0)); + FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0)) + + WINDOW_HEADER_LINE_HEIGHT (w); /* Don't let point enter the scroll margin near top of the window. */ if (centering_position < margin * FRAME_LINE_HEIGHT (f)) -- cgit v1.2.1 From 0902a04edd7a2e0ca5d73fd996e46f26d5228501 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 23 Aug 2011 20:48:07 +0900 Subject: Fix default values of character properties. --- src/ChangeLog | 5 +++++ src/chartab.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 85a55b2b7c9..5b4e0023ac6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-08-22 Kenichi Handa + + * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a + extra slot even if the purpose is char-code-property-table. + 2011-08-19 Eli Zaretskii * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of 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, (Lisp_Object char_table, Lisp_Object n, Lisp_Object value) { CHECK_CHAR_TABLE (char_table); - if (EQ (XCHAR_TABLE (char_table)->purpose, Qchar_code_property_table)) - error ("Can't change extra-slot of char-code-property-table"); CHECK_NUMBER (n); if (XINT (n) < 0 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) -- cgit v1.2.1 From 4a5885a74a3310ed4f4ba86eee3c406019b2c334 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 23 Aug 2011 10:41:07 -0400 Subject: * src/nsfont.m (ns_otf_to_script): Fix typo. --- src/ChangeLog | 4 ++++ src/nsfont.m | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a3c7c2f09d2..e7d426f23fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-08-23 Chong Yidong + + * nsfont.m (ns_otf_to_script): Fix typo. + 2011-08-22 Kenichi Handa * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a 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 { Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); return CONSP (script) - ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME XCDR ((script)))] + ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (XCDR ((script))))] : @""; } -- cgit v1.2.1 From bca633fb296b17c0e86d589c50fb3414b361e0b3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 23 Aug 2011 17:45:14 +0300 Subject: Followup for character properties in 2011-08-23T11:48:07Z!handa@m17n.org. src/bidi.c (bidi_get_type): Abort if we get zero as the bidi type of a character. admin/unidata/unidata-gen.el (unidata-prop-alist): Update the default values of bidi-class according to DerivedBidiClass.txt from the latest UCD. lisp/international/uni-bidi.el: Regenerated. doc/lispref/nonascii.texi (Character Properties): Document the values for unassigned codepoints. --- src/ChangeLog | 5 +++++ src/bidi.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e7d426f23fb..c629598fcf7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-08-23 Eli Zaretskii + + * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of + a character. + 2011-08-23 Chong Yidong * nsfont.m (ns_otf_to_script): Fix typo. diff --git a/src/bidi.c b/src/bidi.c index 7517eca5aed..00aa31bf48d 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -108,8 +108,12 @@ bidi_get_type (int ch, bidi_dir_t override) abort (); default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); - if (default_type == 0) - default_type = STRONG_L; + /* Every valid character code, even those that are unassigned by the + UCD, have some bidi-class property, according to + DerivedBidiClass.txt file. Therefore, if we ever get UNKNOWN_BT + (= zero) code from CHAR_TABLE_REF, that's a bug. */ + if (default_type == UNKNOWN_BT) + abort (); if (override == NEUTRAL_DIR) return default_type; -- cgit v1.2.1 From 963b492b635cd33a6a5dd46119208a378e3e6378 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Aug 2011 21:55:10 -0400 Subject: * lisp/mpc.el (mpc--proc-filter): Don't signal mpc-proc-error since signals from process filters aren't reliably transmitted to the surrounding accept-process-output. (mpc-proc-check): New function. (mpc-proc-sync): Use it Fixes: debbugs:8293 --- src/process.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/process.c b/src/process.c index 2125478907f..977cfb964e2 100644 --- a/src/process.c +++ b/src/process.c @@ -5186,6 +5186,9 @@ read_process_output (Lisp_Object proc, register int channel) p->decoding_carryover = coding->carryover_bytes; } if (SBYTES (text) > 0) + /* FIXME: It's wrong to wrap or not based on debug-on-error, and + sometimes it's simply wrong to wrap (e.g. when called from + accept-process-output). */ internal_condition_case_1 (read_process_output_call, Fcons (outstream, Fcons (proc, Fcons (text, Qnil))), -- cgit v1.2.1 From f67cdd7f258347b3fe21fa3c8bfc335decad02d6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 24 Aug 2011 10:46:00 +0300 Subject: Minor changes in bidi.c. src/bidi.c (bidi_check_type): Use xassert. (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p members. --- src/ChangeLog | 6 ++++++ src/bidi.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index c629598fcf7..f52e8cad479 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-08-24 Eli Zaretskii + + * bidi.c (bidi_check_type): Use xassert. + (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p + members. + 2011-08-23 Eli Zaretskii * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of diff --git a/src/bidi.c b/src/bidi.c index 00aa31bf48d..425a0be9578 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -146,11 +146,10 @@ bidi_get_type (int ch, bidi_dir_t override) } } -static void +static inline void bidi_check_type (bidi_type_t type) { - if (type < UNKNOWN_BT || type > NEUTRAL_ON) - abort (); + xassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); } /* Given a bidi TYPE of a character, return its category. */ @@ -540,6 +539,8 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral; bidi_cache[idx].next_for_ws = bidi_it->next_for_ws; bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit; + bidi_cache[idx].disp_pos = bidi_it->disp_pos; + bidi_cache[idx].disp_prop_p = bidi_it->disp_prop_p; } bidi_cache_last_idx = idx; -- cgit v1.2.1 From 5980d4c6db923da523fbb0e2fb44ecd68b13c53d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 24 Aug 2011 14:49:54 +0300 Subject: Fix current-bidi-paragraph-direction and its doc. src/xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte buffers, return left-to-right. doc/lispref/display.texi (Bidirectional Display): Document return value in buffers that are not bidi-reordered for display, and in unibyte buffers. --- src/ChangeLog | 3 +++ src/xdisp.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f52e8cad479..d4d6a4c4bbd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-08-24 Eli Zaretskii + * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte + buffers, return left-to-right. + * bidi.c (bidi_check_type): Use xassert. (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p members. diff --git a/src/xdisp.c b/src/xdisp.c index 6a11628f858..8b3a71027b6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19014,7 +19014,8 @@ See also `bidi-paragraph-direction'. */) buf = XBUFFER (buffer); } - if (NILP (BVAR (buf, bidi_display_reordering))) + if (NILP (BVAR (buf, bidi_display_reordering)) + || NILP (BVAR (buf, enable_multibyte_characters))) return Qleft_to_right; else if (!NILP (BVAR (buf, bidi_paragraph_direction))) return BVAR (buf, bidi_paragraph_direction); -- cgit v1.2.1 From 8610fe8b84e22f5d962f5e480001748a6687a3b2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 24 Aug 2011 18:51:56 +0300 Subject: Fix cursor movement in R2L text within L2R paragraphs. src/xdisp.c (set_cursor_from_row): Consider candidate row a win if its glyph represents a newline and point is on that newline. Fixes cursor positioning on the newline at EOL of R2L text within L2R paragraph, and vice versa. (try_cursor_movement): Check continued rows, in addition to continuation rows. Fixes unwarranted scroll when point enters a continued line of R2L text within an L2R paragraph, or vice versa. (cursor_row_p): Consider the case of point being equal to MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving from the end of a short line to the beginning of a continued line of R2L text within L2R paragraph. (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for composed characters. --- src/ChangeLog | 13 +++++++++++++ src/xdisp.c | 21 +++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index d4d6a4c4bbd..b9c627bf160 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,19 @@ * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte buffers, return left-to-right. + (set_cursor_from_row): Consider candidate row a win if its glyph + represents a newline and point is on that newline. Fixes cursor + positioning on the newline at EOL of R2L text within L2R + paragraph, and vice versa. + (try_cursor_movement): Check continued rows, in addition to + continuation rows. Fixes unwarranted scroll when point enters a + continued line of R2L text within an L2R paragraph, or vice versa. + (cursor_row_p): Consider the case of point being equal to + MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving + from the end of a short line to the beginning of a continued line + of R2L text within L2R paragraph. + (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for + composed characters. * bidi.c (bidi_check_type): Use xassert. (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p diff --git a/src/xdisp.c b/src/xdisp.c index 8b3a71027b6..4ed08e72e19 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13796,7 +13796,14 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, && glyph->charpos != pt_old))))) return 0; /* If this candidate gives an exact match, use that. */ - if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) + if (!((BUFFERP (glyph->object) && glyph->charpos == pt_old) + /* If this candidate is a glyph created for the + terminating newline of a line, and point is on that + newline, it wins because it's an exact match. */ + || (!row->continued_p + && INTEGERP (glyph->object) + && glyph->charpos == 0 + && pt_old == MATRIX_ROW_END_CHARPOS (row) - 1)) /* Otherwise, keep the candidate that comes from a row spanning less buffer positions. This may win when one or both candidate positions are on glyphs that came from @@ -14578,7 +14585,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste } ++row; } - while ((MATRIX_ROW_CONTINUATION_LINE_P (row) + while (((MATRIX_ROW_CONTINUATION_LINE_P (row) + || row->continued_p) && MATRIX_ROW_BOTTOM_Y (row) <= last_y) || (MATRIX_ROW_START_CHARPOS (row) == PT && MATRIX_ROW_BOTTOM_Y (row) < last_y)); @@ -18009,7 +18017,8 @@ cursor_row_p (struct glyph_row *row) { int result = 1; - if (PT == CHARPOS (row->end.pos)) + if (PT == CHARPOS (row->end.pos) + || PT == MATRIX_ROW_END_CHARPOS (row)) { /* Suppose the row ends on a string. Unless the row is continued, that means it ends on a newline @@ -18404,10 +18413,10 @@ display_line (struct it *it) min_pos = current_pos; \ min_bpos = current_bpos; \ } \ - if (current_pos > max_pos) \ + if (IT_CHARPOS (*it) > max_pos) \ { \ - max_pos = current_pos; \ - max_bpos = current_bpos; \ + max_pos = IT_CHARPOS (*it); \ + max_bpos = IT_BYTEPOS (*it); \ } \ } \ while (0) -- cgit v1.2.1