Karl Heuer [Sun, 18 Jan 1998 04:53:32 +0000 (04:53 +0000)]
(compile_pattern_1): If representation of STRING
does not fit MULTIBYTE, convert its contents.
(fast_c_string_match_ignore_case): Pass 0 to compile_pattern
as MULTIBYTE.
(search_buffer): If representation of STRING
does not fit MULTIBYTE, convert its contents.
Karl Heuer [Sun, 18 Jan 1998 04:49:11 +0000 (04:49 +0000)]
(read1): Escape codes can force multibyte or single-byte.
Otherwise buffer_defaults->enable_multibyte_characters decides.
Only set force_singlebyte when a \-sequence is in the relevant
range.
(read_escape): New arg STRINGP. `\ ' is ignored only when STRINGP
(normally, when reading a string). Calls changed.
Karl Heuer [Sun, 18 Jan 1998 04:37:08 +0000 (04:37 +0000)]
(concat): Move the test for all nil in `append'
back to the right place.
Always compute result_len_byte as for a multibyte string. Then,
if the result will be single-byte, don't use that computation.
When converting single-byte to multibyte, don't use copy_text.
Do use copy_text between single-byte string and multibyte string.
(Fstring_make_multibyte, Fstring_make_unibyte): New functions.
(syms_of_fns): defsubr them.
(string_char_to_byte): Count from the beginning or the end,
whichever is closer. Keep a cache of recent values.
(string_byte_to_char): Likewise.
(Fstring_lessp): Compare the strings char by char.
Karl Heuer [Sun, 18 Jan 1998 03:19:14 +0000 (03:19 +0000)]
(STRING_BASE_SIZE): New macro.
(STRING_FULLSIZE): Use STRING_BASE_SIZE instead of the whole
size of struct Lisp_String.
(make_pure_string): Use STRING_FULLSIZE.
(ange-ftp-inodes-hashtable): New variable.
(ange-ftp-next-inode-number): New variable.
(ange-ftp-file-attributes): Assign each file a unique "inode number".
(struct gl_state_s): New field `object'.
(SETUP_SYNTAX_TABLE_FOR_OBJECT): Set it.
Handle non-current buffer properly. Args renamed to all caps.
(SETUP_SYNTAX_TABLE): Set `object'. Args renamed to all caps.
(UPDATE_SYNTAX_TABLE): Use gl_state.object.
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD): Likewise.
(SETUP_SYNTAX_TABLE_FOR_OBJECT): Add gl_state.offset
when using the arg FROM. Use BYTE_TO_CHAR.
(message_dolog, message2): New arg MULTIBYTE.
Callers changed.
(message1, message1_nolog): String must be ASCII-only.
(message2, message2_nolog): Now static.
(x_consider_frame_title): Use size_byte.
(display_text_line): Likewise.
And scan Voverlay_arrow_string by bytes and chars.
(display_menu_bar): Call display_string with a byte size.
(display_mode_line): Call display_string with a byte size.
(describe_vector): Unconditionally handle multibyte chars.
(describe_vector): Pass new args to insert_from_string.
(Ftext_char_description): Use make_multibyte_string.
(Fkey_binding): Scan PREFIX a char at a time.
(Fkey_description): Scan KEYS by chars.
(echo_now): Use message2_nolog, not message1_nolog.
(Fexecute_extended_command): Likewise.
(read_char_minibuf_menu_prompt): Use message2_nolog, not message1.
(parse_modifiers): Use size_byte.
(echo_char): Use size_byte.
(parse_modifiers_uncached): Likewise.
(record_char): Likewise.
(parse_solitary_modifier): Likewise.
(read_char): Use Faref on Vkeyboard_translate_table
if it is a string.
(apply_modifiers_uncached): New arg base_len_byte. Calls changed.
(read_char_minibuf_menu_prompt):
(read_key_sequence): Access buffer's downcase_table with XCHAR_TABLE.
(Fexecute_extended_command): Use Faref to access FUNCTION.
Use size_byte of BINDING.
(stuff_buffered_input): Use size_byte of STUFFSTRING.
(Fdo_auto_save): Save and restore multibyteness of minibuffer.
(Fwrite_region): Use message_with_string.
(auto_save_error, Fdo_auto_save): Likewise.
(Ffile_name_directory): Maybe use make_unibyte_string.
(Ffile_name_nondirectory): Likewise.
(Fsubstitute_in_file_name): Convert substituted envvars to multibyte
if necessary. Otherwise use make_unibyte_string.
(Finsert_file_contents): Use make_unibyte_string.
(double_dollars): Use make_uninit_multibyte_string.
(multibyte_chars_in_text): New function.
(Fstring): Use make_multibyte_string.
(Fcompose_string): Likewise.
(Ffind_charset_string): Handle bytes vs chars in string.
Special case for single-byte strings.
(Fchars_in_string): Function deleted.
(Fstring): Renamed from Fconcat_chars.
Handle bytes vs chars in string.
(syms_of_charset): Corresponding changes.
(read_escape): `\ ' stands for nothing at all.
(oblookup): Take args SIZE and SIZE_BYTE. Callers changed.
(init_obarray, read1, make_symbol):
Pass new arg to make_pure_string.
(Fintern, oblookup, Fintern_soft, intern): Handle size_byte.
(dir_warning): Pass new arg to message_dolog.
(read1): PCH is now int *.
Declare ch as int.
(read0): Declare c as int.
(read_list): Declare ch as int.
(read0): Use Fmake_string not make_string.
(read1): When reading a string, maybe use make_unibyte_string.
(Fread_from_string): Convert string indices to/from bytes.
(count_size_as_multibyte): New function.
(insert_from_string_1, insert_from_buffer_1): Use it.
(copy_text): New function.
(insert_from_buffer_1): Call copy_text to convert between
single-byte and multibyte text.
(insert_from_string_1): Likewise.
(insert_1_both): New function.
(insert_from_string): New args POS_BYTE, LENGTH.
(insert_from_string_before_markers):
(insert_from_string_1): New arg POS_BYTE. Swap args NCHARS, NBYTES.
Don't fail to use POS_BYTE!
(insert_from_buffer_1): Get both inschars and insbytes from NEW.
(Fformat): Do all the work directly--don't use doprnt.
Calculate the right size the first time, so no need to retry.
Count chars and bytes in the result.
Convert single-byte strings to multibyte as needed.
Eric M. Ludlam [Thu, 8 Jan 1998 23:35:34 +0000 (23:35 +0000)]
Added some more comments in the commentary.
You can now `quote' symbols that look like keystrokes
When spell checking, meta variables can end in `th' or `s'.