mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-23 22:20:24 -08:00
(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.
This commit is contained in:
parent
6791894163
commit
f072a3e84c
1 changed files with 20 additions and 6 deletions
26
src/coding.c
26
src/coding.c
|
|
@ -4645,6 +4645,7 @@ code_convert_region1 (start, end, coding_system, encodep)
|
||||||
coding.mode |= CODING_MODE_LAST_BLOCK;
|
coding.mode |= CODING_MODE_LAST_BLOCK;
|
||||||
code_convert_region (from, CHAR_TO_BYTE (from), to, CHAR_TO_BYTE (to),
|
code_convert_region (from, CHAR_TO_BYTE (from), to, CHAR_TO_BYTE (to),
|
||||||
&coding, encodep, 1);
|
&coding, encodep, 1);
|
||||||
|
Vlast_coding_system_used = coding.symbol;
|
||||||
return make_number (coding.produced_char);
|
return make_number (coding.produced_char);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4653,7 +4654,10 @@ DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region,
|
||||||
"Decode the current region by specified coding system.\n\
|
"Decode the current region by specified coding system.\n\
|
||||||
When called from a program, takes three arguments:\n\
|
When called from a program, takes three arguments:\n\
|
||||||
START, END, and CODING-SYSTEM. START and END are buffer positions.\n\
|
START, END, and CODING-SYSTEM. START and END are buffer positions.\n\
|
||||||
Return length of decoded text.")
|
This function sets `last-coding-system-used' to the precise coding system\n\
|
||||||
|
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
|
||||||
|
not fully specified.)\n\
|
||||||
|
It returns the length of the decoded text.")
|
||||||
(start, end, coding_system)
|
(start, end, coding_system)
|
||||||
Lisp_Object start, end, coding_system;
|
Lisp_Object start, end, coding_system;
|
||||||
{
|
{
|
||||||
|
|
@ -4665,7 +4669,10 @@ DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region,
|
||||||
"Encode the current region by specified coding system.\n\
|
"Encode the current region by specified coding system.\n\
|
||||||
When called from a program, takes three arguments:\n\
|
When called from a program, takes three arguments:\n\
|
||||||
START, END, and CODING-SYSTEM. START and END are buffer positions.\n\
|
START, END, and CODING-SYSTEM. START and END are buffer positions.\n\
|
||||||
Return length of encoded text.")
|
This function sets `last-coding-system-used' to the precise coding system\n\
|
||||||
|
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
|
||||||
|
not fully specified.)\n\
|
||||||
|
It returns the length of the encoded text.")
|
||||||
(start, end, coding_system)
|
(start, end, coding_system)
|
||||||
Lisp_Object start, end, coding_system;
|
Lisp_Object start, end, coding_system;
|
||||||
{
|
{
|
||||||
|
|
@ -4689,6 +4696,7 @@ code_convert_string1 (string, coding_system, nocopy, encodep)
|
||||||
error ("Invalid coding system: %s", XSYMBOL (coding_system)->name->data);
|
error ("Invalid coding system: %s", XSYMBOL (coding_system)->name->data);
|
||||||
|
|
||||||
coding.mode |= CODING_MODE_LAST_BLOCK;
|
coding.mode |= CODING_MODE_LAST_BLOCK;
|
||||||
|
Vlast_coding_system_used = coding.symbol;
|
||||||
return code_convert_string (string, &coding, encodep, !NILP (nocopy));
|
return code_convert_string (string, &coding, encodep, !NILP (nocopy));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4696,22 +4704,28 @@ DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string,
|
||||||
2, 3, 0,
|
2, 3, 0,
|
||||||
"Decode STRING which is encoded in CODING-SYSTEM, and return the result.\n\
|
"Decode STRING which is encoded in CODING-SYSTEM, and return the result.\n\
|
||||||
Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\
|
Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\
|
||||||
if the decoding operation is trivial.")
|
if the decoding operation is trivial.\n\
|
||||||
|
This function sets `last-coding-system-used' to the precise coding system\n\
|
||||||
|
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
|
||||||
|
not fully specified.)")
|
||||||
(string, coding_system, nocopy)
|
(string, coding_system, nocopy)
|
||||||
Lisp_Object string, coding_system, nocopy;
|
Lisp_Object string, coding_system, nocopy;
|
||||||
{
|
{
|
||||||
return code_convert_string1(string, coding_system, nocopy, 0);
|
return code_convert_string1 (string, coding_system, nocopy, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string,
|
DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string,
|
||||||
2, 3, 0,
|
2, 3, 0,
|
||||||
"Encode STRING to CODING-SYSTEM, and return the result.\n\
|
"Encode STRING to CODING-SYSTEM, and return the result.\n\
|
||||||
Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\
|
Optional arg NOCOPY non-nil means it is ok to return STRING itself\n\
|
||||||
if the encoding operation is trivial.")
|
if the encoding operation is trivial.\n\
|
||||||
|
This function sets `last-coding-system-used' to the precise coding system\n\
|
||||||
|
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is\n\
|
||||||
|
not fully specified.)")
|
||||||
(string, coding_system, nocopy)
|
(string, coding_system, nocopy)
|
||||||
Lisp_Object string, coding_system, nocopy;
|
Lisp_Object string, coding_system, nocopy;
|
||||||
{
|
{
|
||||||
return code_convert_string1(string, coding_system, nocopy, 1);
|
return code_convert_string1 (string, coding_system, nocopy, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue