aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-10 21:52:08 +0000
committerRichard M. Stallman1998-05-10 21:52:08 +0000
commitf072a3e84c52b0ca23edd250f36d5ce3cfaa746a (patch)
tree4255f4cf50075abad3314372f8935c59403f3aa1 /src/coding.c
parent6791894163b135c73145f2f0f2fcb6e7bb711aab (diff)
downloademacs-f072a3e84c52b0ca23edd250f36d5ce3cfaa746a.tar.gz
emacs-f072a3e84c52b0ca23edd250f36d5ce3cfaa746a.zip
(code_convert_region1): Set Vlast_coding_system_used.
(code_convert_string1): Likewise. (Fdecode_coding_region, Fencode_coding_region): Doc fixes. (Fdecode_coding_string, Fencode_coding_string): Doc fixes.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/coding.c b/src/coding.c
index a293d15988a..f989da12b6d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4645,6 +4645,7 @@ code_convert_region1 (start, end, coding_system, encodep)
4645 coding.mode |= CODING_MODE_LAST_BLOCK; 4645 coding.mode |= CODING_MODE_LAST_BLOCK;
4646 code_convert_region (from, CHAR_TO_BYTE (from), to, CHAR_TO_BYTE (to), 4646 code_convert_region (from, CHAR_TO_BYTE (from), to, CHAR_TO_BYTE (to),
4647 &coding, encodep, 1); 4647 &coding, encodep, 1);
4648 Vlast_coding_system_used = coding.symbol;
4648 return make_number (coding.produced_char); 4649 return make_number (coding.produced_char);
4649} 4650}
4650 4651
@@ -4653,7 +4654,10 @@ DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region,
4653 "Decode the current region by specified coding system.\n\ 4654 "Decode the current region by specified coding system.\n\
4654When called from a program, takes three arguments:\n\ 4655When called from a program, takes three arguments:\n\
4655START, END, and CODING-SYSTEM. START and END are buffer positions.\n\ 4656START, END, and CODING-SYSTEM. START and END are buffer positions.\n\
4656Return length of decoded text.") 4657This function sets `last-coding-system-used' to the precise coding system\n\
4658used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
4659not fully specified.)\n\
4660It returns the length of the decoded text.")
4657 (start, end, coding_system) 4661 (start, end, coding_system)
4658 Lisp_Object start, end, coding_system; 4662 Lisp_Object start, end, coding_system;
4659{ 4663{
@@ -4665,7 +4669,10 @@ DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region,
4665 "Encode the current region by specified coding system.\n\ 4669 "Encode the current region by specified coding system.\n\
4666When called from a program, takes three arguments:\n\ 4670When called from a program, takes three arguments:\n\
4667START, END, and CODING-SYSTEM. START and END are buffer positions.\n\ 4671START, END, and CODING-SYSTEM. START and END are buffer positions.\n\
4668Return length of encoded text.") 4672This function sets `last-coding-system-used' to the precise coding system\n\
4673used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
4674not fully specified.)\n\
4675It returns the length of the encoded text.")
4669 (start, end, coding_system) 4676 (start, end, coding_system)
4670 Lisp_Object start, end, coding_system; 4677 Lisp_Object start, end, coding_system;
4671{ 4678{
@@ -4689,6 +4696,7 @@ code_convert_string1 (string, coding_system, nocopy, encodep)
4689 error ("Invalid coding system: %s", XSYMBOL (coding_system)->name->data); 4696 error ("Invalid coding system: %s", XSYMBOL (coding_system)->name->data);
4690 4697
4691 coding.mode |= CODING_MODE_LAST_BLOCK; 4698 coding.mode |= CODING_MODE_LAST_BLOCK;
4699 Vlast_coding_system_used = coding.symbol;
4692 return code_convert_string (string, &coding, encodep, !NILP (nocopy)); 4700 return code_convert_string (string, &coding, encodep, !NILP (nocopy));
4693} 4701}
4694 4702
@@ -4696,22 +4704,28 @@ DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string,
4696 2, 3, 0, 4704 2, 3, 0,
4697 "Decode STRING which is encoded in CODING-SYSTEM, and return the result.\n\ 4705 "Decode STRING which is encoded in CODING-SYSTEM, and return the result.\n\
4698Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\ 4706Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\
4699if the decoding operation is trivial.") 4707if the decoding operation is trivial.\n\
4708This function sets `last-coding-system-used' to the precise coding system\n\
4709used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
4710not fully specified.)")
4700 (string, coding_system, nocopy) 4711 (string, coding_system, nocopy)
4701 Lisp_Object string, coding_system, nocopy; 4712 Lisp_Object string, coding_system, nocopy;
4702{ 4713{
4703 return code_convert_string1(string, coding_system, nocopy, 0); 4714 return code_convert_string1 (string, coding_system, nocopy, 0);
4704} 4715}
4705 4716
4706DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string, 4717DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string,
4707 2, 3, 0, 4718 2, 3, 0,
4708 "Encode STRING to CODING-SYSTEM, and return the result.\n\ 4719 "Encode STRING to CODING-SYSTEM, and return the result.\n\
4709Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\ 4720Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\
4710if the encoding operation is trivial.") 4721if the encoding operation is trivial.\n\
4722This function sets `last-coding-system-used' to the precise coding system\n\
4723used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
4724not fully specified.)")
4711 (string, coding_system, nocopy) 4725 (string, coding_system, nocopy)
4712 Lisp_Object string, coding_system, nocopy; 4726 Lisp_Object string, coding_system, nocopy;
4713{ 4727{
4714 return code_convert_string1(string, coding_system, nocopy, 1); 4728 return code_convert_string1 (string, coding_system, nocopy, 1);
4715} 4729}
4716 4730
4717 4731