>From 18eb654c4541a49f415d4826974fd2c216f2c2db Mon Sep 17 00:00:00 2001 From: Andrew Hyatt Date: Sun, 24 Jul 2016 23:58:47 -0400 Subject: [PATCH] Warn against unintentional recursion in formatting. Change documentation for format-alist to warn against formatting when formatting, which leads to incorrect results.. --- doc/lispref/files.texi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index f3650a4..5763380 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -3238,7 +3238,9 @@ Format Conversion Round-Trip One responsibility of @var{from-fn} is to make sure that the beginning of the file no longer matches @var{regexp}. Otherwise it is likely to -get called again. +get called again. Also, @var{from-fn} must not involve other buffers or +files other than the one being decoded, or else formatting may happen +during formatting, leading to incorrect results. @item to-fn A shell command or function to encode data in this format---that is, to @@ -3269,6 +3271,10 @@ Format Conversion Round-Trip positions. All this takes place without modifying the buffer. @end itemize +@var{to-fn} must not involve other buffers or files other than the one +being encoded, or else formatting may happen during formatting, +leading to incorrect results. + @item modify A flag, @code{t} if the encoding function modifies the buffer, and @code{nil} if it works by returning a list of annotations. -- 2.4.9 (Apple Git-60)