]> git.eshelyaron.com Git - emacs.git/commit
(find-auto-coding): Provide filename to `auto-coding-functions`
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Jun 2024 14:58:29 +0000 (10:58 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Jun 2024 09:52:43 +0000 (11:52 +0200)
commitb6fca74632a14e673195f837dd40c9b7034a9eed
tree10f16229b427961b2712d3d907ce8f182b4503b8
parent30be0083674d7dc6770d3611908e9219488ee869
(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.

(cherry picked from commit 3ecc6b4f3c2b070ed2c4463e2c5d8755ccc19f1c)
doc/lispref/nonascii.texi
etc/NEWS
lisp/international/mule.el
test/lisp/international/mule-tests.el
test/lisp/international/mule-util-resources/test.utf-16le [new file with mode: 0644]