diff options
| author | Gerd Moellmann | 2001-01-19 09:39:47 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-19 09:39:47 +0000 |
| commit | 1e313f2809ef8d10ee00519b7c8c550e0186ba31 (patch) | |
| tree | da4726b743ffcd0a64ada7b03ec9e21e02dde506 | |
| parent | 2550055a67cc37c4ed14b510b8cb4d70a9d73819 (diff) | |
| download | emacs-1e313f2809ef8d10ee00519b7c8c550e0186ba31.tar.gz emacs-1e313f2809ef8d10ee00519b7c8c550e0186ba31.zip | |
(message_dolog, message2, message2_nolog): Rename
parameter LEN to NBYTES.
| -rw-r--r-- | src/xdisp.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 145dcbac00a..c17489eaedf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5248,16 +5248,16 @@ message_log_maybe_newline () | |||
| 5248 | } | 5248 | } |
| 5249 | 5249 | ||
| 5250 | 5250 | ||
| 5251 | /* Add a string M of length LEN to the message log, optionally | 5251 | /* Add a string M of length NBYTES to the message log, optionally |
| 5252 | terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if | 5252 | terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if |
| 5253 | nonzero, means interpret the contents of M as multibyte. This | 5253 | nonzero, means interpret the contents of M as multibyte. This |
| 5254 | function calls low-level routines in order to bypass text property | 5254 | function calls low-level routines in order to bypass text property |
| 5255 | hooks, etc. which might not be safe to run. */ | 5255 | hooks, etc. which might not be safe to run. */ |
| 5256 | 5256 | ||
| 5257 | void | 5257 | void |
| 5258 | message_dolog (m, len, nlflag, multibyte) | 5258 | message_dolog (m, nbytes, nlflag, multibyte) |
| 5259 | char *m; | 5259 | char *m; |
| 5260 | int len, nlflag, multibyte; | 5260 | int nbytes, nlflag, multibyte; |
| 5261 | { | 5261 | { |
| 5262 | if (!NILP (Vmessage_log_max)) | 5262 | if (!NILP (Vmessage_log_max)) |
| 5263 | { | 5263 | { |
| @@ -5295,14 +5295,14 @@ message_dolog (m, len, nlflag, multibyte) | |||
| 5295 | if (multibyte | 5295 | if (multibyte |
| 5296 | && NILP (current_buffer->enable_multibyte_characters)) | 5296 | && NILP (current_buffer->enable_multibyte_characters)) |
| 5297 | { | 5297 | { |
| 5298 | int i, c, nbytes; | 5298 | int i, c, char_bytes; |
| 5299 | unsigned char work[1]; | 5299 | unsigned char work[1]; |
| 5300 | 5300 | ||
| 5301 | /* Convert a multibyte string to single-byte | 5301 | /* Convert a multibyte string to single-byte |
| 5302 | for the *Message* buffer. */ | 5302 | for the *Message* buffer. */ |
| 5303 | for (i = 0; i < len; i += nbytes) | 5303 | for (i = 0; i < nbytes; i += nbytes) |
| 5304 | { | 5304 | { |
| 5305 | c = string_char_and_length (m + i, len - i, &nbytes); | 5305 | c = string_char_and_length (m + i, nbytes - i, &char_bytes); |
| 5306 | work[0] = (SINGLE_BYTE_CHAR_P (c) | 5306 | work[0] = (SINGLE_BYTE_CHAR_P (c) |
| 5307 | ? c | 5307 | ? c |
| 5308 | : multibyte_char_to_unibyte (c, Qnil)); | 5308 | : multibyte_char_to_unibyte (c, Qnil)); |
| @@ -5312,20 +5312,20 @@ message_dolog (m, len, nlflag, multibyte) | |||
| 5312 | else if (! multibyte | 5312 | else if (! multibyte |
| 5313 | && ! NILP (current_buffer->enable_multibyte_characters)) | 5313 | && ! NILP (current_buffer->enable_multibyte_characters)) |
| 5314 | { | 5314 | { |
| 5315 | int i, c, nbytes; | 5315 | int i, c, char_bytes; |
| 5316 | unsigned char *msg = (unsigned char *) m; | 5316 | unsigned char *msg = (unsigned char *) m; |
| 5317 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 5317 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 5318 | /* Convert a single-byte string to multibyte | 5318 | /* Convert a single-byte string to multibyte |
| 5319 | for the *Message* buffer. */ | 5319 | for the *Message* buffer. */ |
| 5320 | for (i = 0; i < len; i++) | 5320 | for (i = 0; i < nbytes; i++) |
| 5321 | { | 5321 | { |
| 5322 | c = unibyte_char_to_multibyte (msg[i]); | 5322 | c = unibyte_char_to_multibyte (msg[i]); |
| 5323 | nbytes = CHAR_STRING (c, str); | 5323 | char_bytes = CHAR_STRING (c, str); |
| 5324 | insert_1_both (str, 1, nbytes, 1, 0, 0); | 5324 | insert_1_both (str, 1, char_bytes, 1, 0, 0); |
| 5325 | } | 5325 | } |
| 5326 | } | 5326 | } |
| 5327 | else if (len) | 5327 | else if (nbytes) |
| 5328 | insert_1 (m, len, 1, 0, 0); | 5328 | insert_1 (m, nbytes, 1, 0, 0); |
| 5329 | 5329 | ||
| 5330 | if (nlflag) | 5330 | if (nlflag) |
| 5331 | { | 5331 | { |
| @@ -5446,9 +5446,10 @@ message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte) | |||
| 5446 | } | 5446 | } |
| 5447 | 5447 | ||
| 5448 | 5448 | ||
| 5449 | /* Display an echo area message M with a specified length of LEN | 5449 | /* Display an echo area message M with a specified length of NBYTES |
| 5450 | chars. The string may include null characters. If M is 0, clear | 5450 | bytes. The string may include null characters. If M is 0, clear |
| 5451 | out any existing message, and let the mini-buffer text show through. | 5451 | out any existing message, and let the mini-buffer text show |
| 5452 | through. | ||
| 5452 | 5453 | ||
| 5453 | The buffer M must continue to exist until after the echo area gets | 5454 | The buffer M must continue to exist until after the echo area gets |
| 5454 | cleared or some other message gets displayed there. This means do | 5455 | cleared or some other message gets displayed there. This means do |
| @@ -5456,25 +5457,25 @@ message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte) | |||
| 5456 | a buffer that was alloca'd. */ | 5457 | a buffer that was alloca'd. */ |
| 5457 | 5458 | ||
| 5458 | void | 5459 | void |
| 5459 | message2 (m, len, multibyte) | 5460 | message2 (m, nbytes, multibyte) |
| 5460 | char *m; | 5461 | char *m; |
| 5461 | int len; | 5462 | int nbytes; |
| 5462 | int multibyte; | 5463 | int multibyte; |
| 5463 | { | 5464 | { |
| 5464 | /* First flush out any partial line written with print. */ | 5465 | /* First flush out any partial line written with print. */ |
| 5465 | message_log_maybe_newline (); | 5466 | message_log_maybe_newline (); |
| 5466 | if (m) | 5467 | if (m) |
| 5467 | message_dolog (m, len, 1, multibyte); | 5468 | message_dolog (m, nbytes, 1, multibyte); |
| 5468 | message2_nolog (m, len, multibyte); | 5469 | message2_nolog (m, nbytes, multibyte); |
| 5469 | } | 5470 | } |
| 5470 | 5471 | ||
| 5471 | 5472 | ||
| 5472 | /* The non-logging counterpart of message2. */ | 5473 | /* The non-logging counterpart of message2. */ |
| 5473 | 5474 | ||
| 5474 | void | 5475 | void |
| 5475 | message2_nolog (m, len, multibyte) | 5476 | message2_nolog (m, nbytes, multibyte) |
| 5476 | char *m; | 5477 | char *m; |
| 5477 | int len; | 5478 | int nbytes; |
| 5478 | { | 5479 | { |
| 5479 | struct frame *sf = SELECTED_FRAME (); | 5480 | struct frame *sf = SELECTED_FRAME (); |
| 5480 | message_enable_multibyte = multibyte; | 5481 | message_enable_multibyte = multibyte; |
| @@ -5485,7 +5486,7 @@ message2_nolog (m, len, multibyte) | |||
| 5485 | putc ('\n', stderr); | 5486 | putc ('\n', stderr); |
| 5486 | noninteractive_need_newline = 0; | 5487 | noninteractive_need_newline = 0; |
| 5487 | if (m) | 5488 | if (m) |
| 5488 | fwrite (m, len, 1, stderr); | 5489 | fwrite (m, nbytes, 1, stderr); |
| 5489 | if (cursor_in_echo_area == 0) | 5490 | if (cursor_in_echo_area == 0) |
| 5490 | fprintf (stderr, "\n"); | 5491 | fprintf (stderr, "\n"); |
| 5491 | fflush (stderr); | 5492 | fflush (stderr); |
| @@ -5512,7 +5513,7 @@ message2_nolog (m, len, multibyte) | |||
| 5512 | 5513 | ||
| 5513 | if (m) | 5514 | if (m) |
| 5514 | { | 5515 | { |
| 5515 | set_message (m, Qnil, len, multibyte); | 5516 | set_message (m, Qnil, nbytes, multibyte); |
| 5516 | if (minibuffer_auto_raise) | 5517 | if (minibuffer_auto_raise) |
| 5517 | Fraise_frame (WINDOW_FRAME (XWINDOW (mini_window))); | 5518 | Fraise_frame (WINDOW_FRAME (XWINDOW (mini_window))); |
| 5518 | } | 5519 | } |