summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2024-06-04 10:58:29 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2024-06-09 00:19:03 -0400
commit3ecc6b4f3c2b070ed2c4463e2c5d8755ccc19f1c (patch)
tree36ec13f004e81faad33f8a42e30a96c4a40451d5 /doc
parentce5d004b5b093842d9c46976c50453015fe1a7e7 (diff)
(find-auto-coding): Provide filename to `auto-coding-functions`
Allow `auto-coding-functions` to know the file name. Motivated by the needs of Editorconfig support. * lisp/international/mule.el (auto-coding-file-name): New var. (find-auto-coding): Let-bind it for `auto-coding-functions`. Document the expectation that the arg be an absolute file name. * doc/lispref/nonascii.texi (Default Coding Systems): Mention `auto-coding-file-name`. * test/lisp/international/mule-util-resources/test.utf-16le: New file. * test/lisp/international/mule-tests.el (mule-tests--dir): New var. (mule-tests--auto-coding): New fun. (mule-tests--auto-coding-functions): New test.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/nonascii.texi3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index b33082e2b24..1482becb9f5 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1654,6 +1654,9 @@ argument, @var{size}, which tells it how many characters to look at,
starting from point. If the function succeeds in determining a coding
system for the file, it should return that coding system. Otherwise,
it should return @code{nil}.
+Each function can also find the name of the file to which
+the buffer's content belong in the variable
+@code{auto-coding-file-name}.
The functions in this list could be called either when the file is
visited and Emacs wants to decode its contents, and/or when the file's