diff options
| author | Kim F. Storm | 2005-05-16 21:25:20 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-05-16 21:25:20 +0000 |
| commit | a605fefc84600e18fcda7f0cc98e8bde41e1d674 (patch) | |
| tree | 9dad735c24a4b04a35cb5b2da7b2e927d05b9d3c | |
| parent | 1cb83e13eda50d2d0d95da7b2c679e9f278fe47e (diff) | |
| download | emacs-a605fefc84600e18fcda7f0cc98e8bde41e1d674.tar.gz emacs-a605fefc84600e18fcda7f0cc98e8bde41e1d674.zip | |
(handle_display_prop): Handle empty replacement.
(handle_single_display_spec): Return -1 for empty replacement.
| -rw-r--r-- | src/xdisp.c | 13 |
1 files changed, 11 insertions, 2 deletions
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) | |||
| 3471 | } | 3471 | } |
| 3472 | else | 3472 | else |
| 3473 | { | 3473 | { |
| 3474 | if (handle_single_display_spec (it, prop, object, position, 0)) | 3474 | int ret = handle_single_display_spec (it, prop, object, position, 0); |
| 3475 | if (ret < 0) /* Replaced by "", i.e. nothing. */ | ||
| 3476 | return HANDLED_RECOMPUTE_PROPS; | ||
| 3477 | if (ret) | ||
| 3475 | display_replaced_p = 1; | 3478 | display_replaced_p = 1; |
| 3476 | } | 3479 | } |
| 3477 | 3480 | ||
| @@ -3515,7 +3518,8 @@ display_prop_end (it, object, start_pos) | |||
| 3515 | property ends. | 3518 | property ends. |
| 3516 | 3519 | ||
| 3517 | Value is non-zero if something was found which replaces the display | 3520 | Value is non-zero if something was found which replaces the display |
| 3518 | of buffer or string text. */ | 3521 | of buffer or string text. Specifically, the value is -1 if that |
| 3522 | "something" is "nothing". */ | ||
| 3519 | 3523 | ||
| 3520 | static int | 3524 | static int |
| 3521 | handle_single_display_spec (it, spec, object, position, | 3525 | handle_single_display_spec (it, spec, object, position, |
| @@ -3830,6 +3834,11 @@ handle_single_display_spec (it, spec, object, position, | |||
| 3830 | 3834 | ||
| 3831 | if (STRINGP (value)) | 3835 | if (STRINGP (value)) |
| 3832 | { | 3836 | { |
| 3837 | if (SCHARS (value) == 0) | ||
| 3838 | { | ||
| 3839 | pop_it (it); | ||
| 3840 | return -1; /* Replaced by "", i.e. nothing. */ | ||
| 3841 | } | ||
| 3833 | it->string = value; | 3842 | it->string = value; |
| 3834 | it->multibyte_p = STRING_MULTIBYTE (it->string); | 3843 | it->multibyte_p = STRING_MULTIBYTE (it->string); |
| 3835 | it->current.overlay_string_index = -1; | 3844 | it->current.overlay_string_index = -1; |