From: Kim F. Storm Date: Mon, 16 May 2005 21:25:20 +0000 (+0000) Subject: (handle_display_prop): Handle empty replacement. X-Git-Tag: ttn-vms-21-2-B4~230 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a605fefc84600e18fcda7f0cc98e8bde41e1d674;p=emacs.git (handle_display_prop): Handle empty replacement. (handle_single_display_spec): Return -1 for empty replacement. --- diff --git a/src/xdisp.c b/src/xdisp.c index 8bbe2811869..628688c2f07 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3471,7 +3471,10 @@ handle_display_prop (it) } else { - if (handle_single_display_spec (it, prop, object, position, 0)) + int ret = handle_single_display_spec (it, prop, object, position, 0); + if (ret < 0) /* Replaced by "", i.e. nothing. */ + return HANDLED_RECOMPUTE_PROPS; + if (ret) display_replaced_p = 1; } @@ -3515,7 +3518,8 @@ display_prop_end (it, object, start_pos) property ends. Value is non-zero if something was found which replaces the display - of buffer or string text. */ + of buffer or string text. Specifically, the value is -1 if that + "something" is "nothing". */ static int handle_single_display_spec (it, spec, object, position, @@ -3830,6 +3834,11 @@ handle_single_display_spec (it, spec, object, position, if (STRINGP (value)) { + if (SCHARS (value) == 0) + { + pop_it (it); + return -1; /* Replaced by "", i.e. nothing. */ + } it->string = value; it->multibyte_p = STRING_MULTIBYTE (it->string); it->current.overlay_string_index = -1;