emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 b19fb49: Improve documentation of 'define-coding-


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 b19fb49: Improve documentation of 'define-coding-system'
Date: Fri, 16 Dec 2016 08:51:08 +0000 (UTC)

branch: emacs-25
commit b19fb4995efd7490527400c89becfcf2b6ed4b53
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/international/mule.el |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 21ab7e1..08d37b4 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
 `after-insert-functions' are called.  This function is passed one
 argument: the number of characters in the text to convert, with
 point at the start of the text.  The function should leave point
-unchanged, and should return the new character count.
+unchanged, and should return the new character count.  Note that
+this function should avoid reading from files or receiving text
+from subprocesses -- anything that could invoke decoding; if it
+must do so, it should bind `coding-system-for-read' to a value
+other than the current coding-system, to avoid infinite recursion.
 
 `:pre-write-conversion'
 
@@ -722,7 +726,12 @@ VALUE must be a function to call after all functions in
 called, and before the text is encoded by the coding system
 itself.  This function should convert the whole text in the
 current buffer.  For backward compatibility, this function is
-passed two arguments which can be ignored.
+passed two arguments which can be ignored.  Note that this
+function should avoid writing to files or sending text to
+subprocesses -- anything that could invoke encoding; if it
+must do so, it should bind `coding-system-for-write' to a
+value other than the current coding-system, to avoid infinite
+recursion.
 
 `:default-char'
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]