diff options
| author | Stefan Monnier | 2024-06-04 10:58:29 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2024-06-09 00:19:03 -0400 |
| commit | 3ecc6b4f3c2b070ed2c4463e2c5d8755ccc19f1c (patch) | |
| tree | 36ec13f004e81faad33f8a42e30a96c4a40451d5 /doc | |
| parent | ce5d004b5b093842d9c46976c50453015fe1a7e7 (diff) | |
| download | emacs-3ecc6b4f3c2b070ed2c4463e2c5d8755ccc19f1c.tar.gz emacs-3ecc6b4f3c2b070ed2c4463e2c5d8755ccc19f1c.zip | |
(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.texi | 3 |
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, | |||
| 1654 | starting from point. If the function succeeds in determining a coding | 1654 | starting from point. If the function succeeds in determining a coding |
| 1655 | system for the file, it should return that coding system. Otherwise, | 1655 | system for the file, it should return that coding system. Otherwise, |
| 1656 | it should return @code{nil}. | 1656 | it should return @code{nil}. |
| 1657 | Each function can also find the name of the file to which | ||
| 1658 | the buffer's content belong in the variable | ||
| 1659 | @code{auto-coding-file-name}. | ||
| 1657 | 1660 | ||
| 1658 | The functions in this list could be called either when the file is | 1661 | The functions in this list could be called either when the file is |
| 1659 | visited and Emacs wants to decode its contents, and/or when the file's | 1662 | visited and Emacs wants to decode its contents, and/or when the file's |