aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-09-08 02:01:59 +0000
committerKenichi Handa1998-09-08 02:01:59 +0000
commit2e45bf18010af1c55dda850afb325284e367d1e9 (patch)
tree9bd42fbe811ad31e60c4e4914acd08ed21a045e1 /src
parent21a003b90ff24779c1faa0c620e496269c8f7074 (diff)
downloademacs-2e45bf18010af1c55dda850afb325284e367d1e9.tar.gz
emacs-2e45bf18010af1c55dda850afb325284e367d1e9.zip
(Ffind_charset_region): Optimization for unibyte buffer.
(Ffind_charset_string): For unibyte string, return (ascii).
Diffstat (limited to 'src')
-rw-r--r--src/charset.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/charset.c b/src/charset.c
index 55cfe717d3d..9cafe3ebcf8 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -798,6 +798,11 @@ Optional arg TABLE if non-nil is a translation table to look up.")
798 from = XFASTINT (beg); 798 from = XFASTINT (beg);
799 stop = to = XFASTINT (end); 799 stop = to = XFASTINT (end);
800 800
801 if (NILP (current_buffer->enable_multibyte_characters))
802 return (from == to
803 ? Qnil
804 : Fcons (Qascii, Qnil));
805
801 if (from < GPT && GPT < to) 806 if (from < GPT && GPT < to)
802 { 807 {
803 stop = GPT; 808 stop = GPT;
@@ -843,7 +848,9 @@ Optional arg TABLE if non-nil is a translation table to look up.")
843 CHECK_STRING (str, 0); 848 CHECK_STRING (str, 0);
844 849
845 if (! STRING_MULTIBYTE (str)) 850 if (! STRING_MULTIBYTE (str))
846 return Qnil; 851 return (XSTRING (str)->size == 0
852 ? Qnil
853 : Fcons (Qascii, Qnil));
847 854
848 bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); 855 bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
849 find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)), 856 find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)),