Mercurial > emacs
comparison src/xdisp.c @ 20703:f465da76f36b
(message_dolog): Use unibyte_char_to_multibyte.
Pass different args to scan_newline.
Properly compare oldpoint with Z.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 21 Jan 1998 22:00:26 +0000 |
parents | 10a3afa36ed2 |
children | 49d68bf8f34b |
comparison
equal
deleted
inserted
replaced
20702:0122b019a5d6 | 20703:f465da76f36b |
---|---|
1 /* Display generation from window structure and buffer text. | 1 /* Display generation from window structure and buffer text. |
2 Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 1997 | 2 Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 97, 1998 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 | 4 |
5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
6 | 6 |
7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
49 extern int interrupt_input; | 49 extern int interrupt_input; |
50 extern int command_loop_level; | 50 extern int command_loop_level; |
51 | 51 |
52 extern int minibuffer_auto_raise; | 52 extern int minibuffer_auto_raise; |
53 | 53 |
54 extern int nonascii_insert_offset; | |
55 | |
56 extern Lisp_Object Qface; | 54 extern Lisp_Object Qface; |
57 | 55 |
58 extern Lisp_Object Voverriding_local_map; | 56 extern Lisp_Object Voverriding_local_map; |
59 extern Lisp_Object Voverriding_local_map_menu_flag; | 57 extern Lisp_Object Voverriding_local_map_menu_flag; |
60 | 58 |
299 | 297 |
300 oldpoint = Fpoint_marker (); | 298 oldpoint = Fpoint_marker (); |
301 oldbegv = Fpoint_min_marker (); | 299 oldbegv = Fpoint_min_marker (); |
302 oldzv = Fpoint_max_marker (); | 300 oldzv = Fpoint_max_marker (); |
303 | 301 |
304 if (oldpoint == Z) | 302 if (PT == Z) |
305 point_at_end = 1; | 303 point_at_end = 1; |
306 if (oldzv == Z) | 304 if (ZV == Z) |
307 zv_at_end = 1; | 305 zv_at_end = 1; |
308 | 306 |
309 BEGV = BEG; | 307 BEGV = BEG; |
310 BEGV_BYTE = BEG_BYTE; | 308 BEGV_BYTE = BEG_BYTE; |
311 ZV = Z; | 309 ZV = Z; |
332 } | 330 } |
333 } | 331 } |
334 else if (! multibyte | 332 else if (! multibyte |
335 && ! NILP (current_buffer->enable_multibyte_characters)) | 333 && ! NILP (current_buffer->enable_multibyte_characters)) |
336 { | 334 { |
337 int c, i = 0; | 335 int i = 0; |
338 /* Convert a single-byte string to multibyte | 336 /* Convert a single-byte string to multibyte |
339 for the *Message* buffer. */ | 337 for the *Message* buffer. */ |
340 while (i < len) | 338 while (i < len) |
341 { | 339 { |
342 c = m[i++]; | 340 int c = unibyte_char_to_multibyte (m[i++]); |
343 /* Convert non-ascii chars as if for self-insert. */ | |
344 if (c >= 0200 && c <= 0377) | |
345 c += nonascii_insert_offset; | |
346 insert_char (c); | 341 insert_char (c); |
347 } | 342 } |
348 } | 343 } |
349 else if (len) | 344 else if (len) |
350 insert_1 (m, len, 1, 0, 0); | 345 insert_1 (m, len, 1, 0, 0); |
358 this_bol = PT; | 353 this_bol = PT; |
359 this_bol_byte = PT_BYTE; | 354 this_bol_byte = PT_BYTE; |
360 | 355 |
361 if (this_bol > BEG) | 356 if (this_bol > BEG) |
362 { | 357 { |
363 scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); | 358 scan_newline (PT, PT_BYTE, BEG, BEG_BYTE, -2, 0); |
364 prev_bol = PT; | 359 prev_bol = PT; |
365 prev_bol_byte = PT_BYTE; | 360 prev_bol_byte = PT_BYTE; |
366 | 361 |
367 dup = message_log_check_duplicate (prev_bol, this_bol, | 362 dup = message_log_check_duplicate (prev_bol, this_bol, |
368 prev_bol_byte, this_bol_byte); | 363 prev_bol_byte, this_bol_byte); |