diff options
author | Karl Heuer <kwzh@gnu.org> | 1998-06-03 14:41:07 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1998-06-03 14:41:07 +0000 |
commit | ba77799cb24fd058ae7daa3c8052d934598fda9f (patch) | |
tree | 998a68c4c096a57a7f58e5b0ae453e959fd5658e | |
parent | ca2f4b034afe9634b530a942630f051de09c691d (diff) | |
download | emacs-ba77799cb24fd058ae7daa3c8052d934598fda9f.tar.gz |
(code_convert_string_norecord): New function.
Does encoding or decoding but doesn't set Vlast_coding_system_used.
-rw-r--r-- | src/coding.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c index 5e16250ce40..8ea518d3708 100644 --- a/src/coding.c +++ b/src/coding.c @@ -4722,6 +4722,28 @@ not fully specified.)") return code_convert_string1 (string, coding_system, nocopy, 1); } +/* Encode or decode STRING according to CODING_SYSTEM. + Do not set Vlast_coding_system_used. */ + +Lisp_Object +code_convert_string_norecord (string, coding_system, encodep) + Lisp_Object string, coding_system; + int encodep; +{ + struct coding_system coding; + + CHECK_STRING (string, 0); + CHECK_SYMBOL (coding_system, 1); + + if (NILP (coding_system)) + return string; + + if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) + error ("Invalid coding system: %s", XSYMBOL (coding_system)->name->data); + + coding.mode |= CODING_MODE_LAST_BLOCK; + return code_convert_string (string, &coding, encodep, Qt); +} DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, "Decode a JISX0208 character of shift-jis encoding.\n\ |