diff options
| author | Eli Zaretskii | 2016-12-16 10:49:31 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-12-16 10:49:31 +0200 |
| commit | b19fb4995efd7490527400c89becfcf2b6ed4b53 (patch) | |
| tree | f1dc56e3307602d68cfe8b0c84f080cea4f1f822 /lisp | |
| parent | 467768f64ee109fe127619e75fee7f3b5de1fec1 (diff) | |
| download | emacs-b19fb4995efd7490527400c89becfcf2b6ed4b53.tar.gz emacs-b19fb4995efd7490527400c89becfcf2b6ed4b53.zip | |
Improve documentation of 'define-coding-system'
* lisp/international/mule.el (define-coding-system): Warn against
possible infinite recursion in pre-write-conversion and
post-read-conversion functions. (Bug#25203)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/international/mule.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 21ab7e176d7..08d37b45a3d 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -713,7 +713,11 @@ decoded by the coding system itself and before any functions in | |||
| 713 | `after-insert-functions' are called. This function is passed one | 713 | `after-insert-functions' are called. This function is passed one |
| 714 | argument: the number of characters in the text to convert, with | 714 | argument: the number of characters in the text to convert, with |
| 715 | point at the start of the text. The function should leave point | 715 | point at the start of the text. The function should leave point |
| 716 | unchanged, and should return the new character count. | 716 | unchanged, and should return the new character count. Note that |
| 717 | this function should avoid reading from files or receiving text | ||
| 718 | from subprocesses -- anything that could invoke decoding; if it | ||
| 719 | must do so, it should bind `coding-system-for-read' to a value | ||
| 720 | other than the current coding-system, to avoid infinite recursion. | ||
| 717 | 721 | ||
| 718 | `:pre-write-conversion' | 722 | `:pre-write-conversion' |
| 719 | 723 | ||
| @@ -722,7 +726,12 @@ VALUE must be a function to call after all functions in | |||
| 722 | called, and before the text is encoded by the coding system | 726 | called, and before the text is encoded by the coding system |
| 723 | itself. This function should convert the whole text in the | 727 | itself. This function should convert the whole text in the |
| 724 | current buffer. For backward compatibility, this function is | 728 | current buffer. For backward compatibility, this function is |
| 725 | passed two arguments which can be ignored. | 729 | passed two arguments which can be ignored. Note that this |
| 730 | function should avoid writing to files or sending text to | ||
| 731 | subprocesses -- anything that could invoke encoding; if it | ||
| 732 | must do so, it should bind `coding-system-for-write' to a | ||
| 733 | value other than the current coding-system, to avoid infinite | ||
| 734 | recursion. | ||
| 726 | 735 | ||
| 727 | `:default-char' | 736 | `:default-char' |
| 728 | 737 | ||