diff options
| author | Karl Heuer | 1998-06-03 14:41:07 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-06-03 14:41:07 +0000 |
| commit | ecec61c1991c09915c7a01d5e3a4fc5304771c24 (patch) | |
| tree | 071003d32128914f415eda93b42de8984eb91f9d /src/coding.c | |
| parent | 961c963df34e7cc193774b2c7d1956df129db8c3 (diff) | |
| download | emacs-ecec61c1991c09915c7a01d5e3a4fc5304771c24.tar.gz emacs-ecec61c1991c09915c7a01d5e3a4fc5304771c24.zip | |
(code_convert_string_norecord): New function.
Does encoding or decoding but doesn't set Vlast_coding_system_used.
Diffstat (limited to 'src/coding.c')
| -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.)") | |||
| 4722 | return code_convert_string1 (string, coding_system, nocopy, 1); | 4722 | return code_convert_string1 (string, coding_system, nocopy, 1); |
| 4723 | } | 4723 | } |
| 4724 | 4724 | ||
| 4725 | /* Encode or decode STRING according to CODING_SYSTEM. | ||
| 4726 | Do not set Vlast_coding_system_used. */ | ||
| 4727 | |||
| 4728 | Lisp_Object | ||
| 4729 | code_convert_string_norecord (string, coding_system, encodep) | ||
| 4730 | Lisp_Object string, coding_system; | ||
| 4731 | int encodep; | ||
| 4732 | { | ||
| 4733 | struct coding_system coding; | ||
| 4734 | |||
| 4735 | CHECK_STRING (string, 0); | ||
| 4736 | CHECK_SYMBOL (coding_system, 1); | ||
| 4737 | |||
| 4738 | if (NILP (coding_system)) | ||
| 4739 | return string; | ||
| 4740 | |||
| 4741 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) | ||
| 4742 | error ("Invalid coding system: %s", XSYMBOL (coding_system)->name->data); | ||
| 4743 | |||
| 4744 | coding.mode |= CODING_MODE_LAST_BLOCK; | ||
| 4745 | return code_convert_string (string, &coding, encodep, Qt); | ||
| 4746 | } | ||
| 4725 | 4747 | ||
| 4726 | DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, | 4748 | DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, |
| 4727 | "Decode a JISX0208 character of shift-jis encoding.\n\ | 4749 | "Decode a JISX0208 character of shift-jis encoding.\n\ |