diff options
| author | Richard M. Stallman | 1998-06-24 18:32:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-24 18:32:53 +0000 |
| commit | 8a2ab0c6915d134196ed5738784d0bff4dc83bce (patch) | |
| tree | 598e82be9b98cbdef486dc9b1a5b4d547d08e493 /src | |
| parent | 3dd00fc37c5e6c0851747638a293626e4698dfb7 (diff) | |
| download | emacs-8a2ab0c6915d134196ed5738784d0bff4dc83bce.tar.gz emacs-8a2ab0c6915d134196ed5738784d0bff4dc83bce.zip | |
(PRINTFINISH): Convert text to unibyte before
inserting in a unibyte buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/print.c | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/src/print.c b/src/print.c index 8df254c4059..9cb8b1b960c 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -280,26 +280,39 @@ glyph_to_str_cpy (glyphs, str) | |||
| 280 | if (!CONSP (Vprint_gensym)) \ | 280 | if (!CONSP (Vprint_gensym)) \ |
| 281 | Vprint_gensym_alist = Qnil | 281 | Vprint_gensym_alist = Qnil |
| 282 | 282 | ||
| 283 | #define PRINTFINISH \ | 283 | #define PRINTFINISH \ |
| 284 | if (NILP (printcharfun)) \ | 284 | if (NILP (printcharfun)) \ |
| 285 | insert_1_both (print_buffer, print_buffer_pos, \ | 285 | { \ |
| 286 | print_buffer_pos_byte, 0, 1, 0); \ | 286 | if (print_buffer_pos != print_buffer_pos_byte \ |
| 287 | if (free_print_buffer) \ | 287 | && NILP (current_buffer->enable_multibyte_characters)) \ |
| 288 | { \ | 288 | { \ |
| 289 | xfree (print_buffer); \ | 289 | unsigned char *temp \ |
| 290 | print_buffer = 0; \ | 290 | = (unsigned char *) alloca (print_buffer_pos + 1); \ |
| 291 | } \ | 291 | copy_text (print_buffer, temp, print_buffer_pos_byte, \ |
| 292 | unbind_to (specpdl_count, Qnil); \ | 292 | 1, 0); \ |
| 293 | if (MARKERP (original)) \ | 293 | insert_1_both (temp, print_buffer_pos, \ |
| 294 | set_marker_both (original, Qnil, PT, PT_BYTE); \ | 294 | print_buffer_pos, 0, 1, 0); \ |
| 295 | if (old_point >= 0) \ | 295 | } \ |
| 296 | SET_PT_BOTH (old_point + (old_point >= start_point \ | 296 | else \ |
| 297 | ? PT - start_point : 0), \ | 297 | insert_1_both (print_buffer, print_buffer_pos, \ |
| 298 | print_buffer_pos_byte, 0, 1, 0); \ | ||
| 299 | } \ | ||
| 300 | if (free_print_buffer) \ | ||
| 301 | { \ | ||
| 302 | xfree (print_buffer); \ | ||
| 303 | print_buffer = 0; \ | ||
| 304 | } \ | ||
| 305 | unbind_to (specpdl_count, Qnil); \ | ||
| 306 | if (MARKERP (original)) \ | ||
| 307 | set_marker_both (original, Qnil, PT, PT_BYTE); \ | ||
| 308 | if (old_point >= 0) \ | ||
| 309 | SET_PT_BOTH (old_point + (old_point >= start_point \ | ||
| 310 | ? PT - start_point : 0), \ | ||
| 298 | old_point_byte + (old_point_byte >= start_point_byte \ | 311 | old_point_byte + (old_point_byte >= start_point_byte \ |
| 299 | ? PT_BYTE - start_point_byte : 0)); \ | 312 | ? PT_BYTE - start_point_byte : 0)); \ |
| 300 | if (old != current_buffer) \ | 313 | if (old != current_buffer) \ |
| 301 | set_buffer_internal (old); \ | 314 | set_buffer_internal (old); \ |
| 302 | if (!CONSP (Vprint_gensym)) \ | 315 | if (!CONSP (Vprint_gensym)) \ |
| 303 | Vprint_gensym_alist = Qnil | 316 | Vprint_gensym_alist = Qnil |
| 304 | 317 | ||
| 305 | #define PRINTCHAR(ch) printchar (ch, printcharfun) | 318 | #define PRINTCHAR(ch) printchar (ch, printcharfun) |