From: Stefan Monnier Date: Tue, 21 May 2013 21:48:52 +0000 (-0400) Subject: * src/search.c (looking_at_1): Only set last_thing_searched if the match X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~13 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fc30d803f4325ebf67eee72a5a98100f01f6b182;p=emacs.git * src/search.c (looking_at_1): Only set last_thing_searched if the match changed the match-data. Fixes: debbugs:14281 --- diff --git a/src/ChangeLog b/src/ChangeLog index f9925abb9ef..919f94d0fbb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-05-21 Barry OReilly + + * search.c (looking_at_1): Only set last_thing_searched if the match + changed the match-data (bug#14281). + 2013-05-21 Dmitry Antipov * xdisp.c (reseat_at_previous_visible_line_start): @@ -8,8 +13,8 @@ * xfns.c (check_x_display_info): Don't use XINT for terminal object. (Fx_display_pixel_width, Fx_display_pixel_height) - (Fx_display_mm_width, Fx_display_mm_height): Mention - `display-monitor-attributes-list' in docstrings. + (Fx_display_mm_width, Fx_display_mm_height): + Mention `display-monitor-attributes-list' in docstrings. * nsfns.m (ns_get_screen): Remove function. All uses removed. (check_ns_display_info): Sync with check_x_display_info in xfns.c. @@ -25,8 +30,8 @@ (Fx_display_pixel_width, Fx_display_pixel_width): Return width or height for all physical monitors as in X11. - * nsterm.m (x_display_pixel_width, x_display_pixel_height): Return - pixel width or height for all physical monitors as in X11. + * nsterm.m (x_display_pixel_width, x_display_pixel_height): + Return pixel width or height for all physical monitors as in X11. 2013-05-18 Paul Eggert diff --git a/src/search.c b/src/search.c index ea36133deb7..8b4d39c7811 100644 --- a/src/search.c +++ b/src/search.c @@ -328,18 +328,18 @@ looking_at_1 (Lisp_Object string, bool posix) val = (i >= 0 ? Qt : Qnil); if (NILP (Vinhibit_changing_match_data) && i >= 0) + { for (i = 0; i < search_regs.num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] = BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE); - search_regs.end[i] - = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE); - } - - /* Set last_thing_searched only when match data is changed. */ - if (NILP (Vinhibit_changing_match_data)) + search_regs.end[i] + = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE); + } + /* Set last_thing_searched only when match data is changed. */ XSETBUFFER (last_thing_searched, current_buffer); + } return val; }