]> git.eshelyaron.com Git - emacs.git/commitdiff
(general_insert_function): If enable-multibyte-characters is
authorKenichi Handa <handa@m17n.org>
Fri, 7 Aug 1998 05:04:36 +0000 (05:04 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 7 Aug 1998 05:04:36 +0000 (05:04 +0000)
nil, convert a multibyte character to unibyte appropriately.

src/editfns.c

index c3cdad96aa0dcaf14afa8161e4c09d833e66d2a0..fcf79d134318742d6bb3de0d08a8be1593565dc5 100644 (file)
@@ -1326,7 +1326,13 @@ general_insert_function (insert_func, insert_from_string_func,
          if (!NILP (current_buffer->enable_multibyte_characters))
            len = CHAR_STRING (XFASTINT (val), workbuf, str);
          else
-           workbuf[0] = XINT (val), str = workbuf, len = 1;
+           {
+             workbuf[0] = (SINGLE_BYTE_CHAR_P (XINT (val))
+                           ? XINT (val)
+                           : multibyte_char_to_unibyte (XINT (val), Qnil));
+             str = workbuf;
+             len = 1;
+           }
          (*insert_func) (str, len);
        }
       else if (STRINGP (val))