diff options
| author | Eli Zaretskii | 2019-03-02 10:42:29 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-03-02 10:42:29 +0200 |
| commit | f872b65b2f6b83f3cee2eb0e80cb296d1de99505 (patch) | |
| tree | 4c3b7f0f27913f721edf0077037b71634f0c5f46 | |
| parent | 04cad5e8eac6fee415c0951d673e8a27534e727d (diff) | |
| download | emacs-f872b65b2f6b83f3cee2eb0e80cb296d1de99505.tar.gz emacs-f872b65b2f6b83f3cee2eb0e80cb296d1de99505.zip | |
Improve documentation of 'auto-coding-functions'
* doc/lispref/nonascii.texi (Default Coding Systems): Clarify
that the functions in 'auto-coding-functions' are called both
for decoding and for encoding.
* lisp/international/mule.el (auto-coding-functions): Doc fix.
| -rw-r--r-- | doc/lispref/nonascii.texi | 15 | ||||
| -rw-r--r-- | lisp/international/mule.el | 7 |
2 files changed, 15 insertions, 7 deletions
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 66d12033d82..d58041b279b 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi | |||
| @@ -1632,11 +1632,16 @@ coding system for a file based on its undecoded contents. | |||
| 1632 | 1632 | ||
| 1633 | Each function in this list should be written to look at text in the | 1633 | Each function in this list should be written to look at text in the |
| 1634 | current buffer, but should not modify it in any way. The buffer will | 1634 | current buffer, but should not modify it in any way. The buffer will |
| 1635 | contain undecoded text of parts of the file. Each function should | 1635 | contain the text of parts of the file. Each function should take one |
| 1636 | take one argument, @var{size}, which tells it how many characters to | 1636 | argument, @var{size}, which tells it how many characters to look at, |
| 1637 | look at, starting from point. If the function succeeds in determining | 1637 | starting from point. If the function succeeds in determining a coding |
| 1638 | a coding system for the file, it should return that coding system. | 1638 | system for the file, it should return that coding system. Otherwise, |
| 1639 | Otherwise, it should return @code{nil}. | 1639 | it should return @code{nil}. |
| 1640 | |||
| 1641 | The functions in this list could be called either when the file is | ||
| 1642 | visited and Emacs wants to decode its contents, and/or when the file's | ||
| 1643 | buffer is about to be saved and Emacs wants to determine how to encode | ||
| 1644 | its contents. | ||
| 1640 | 1645 | ||
| 1641 | If a file has a @samp{coding:} tag, that takes precedence, so these | 1646 | If a file has a @samp{coding:} tag, that takes precedence, so these |
| 1642 | functions won't be called. | 1647 | functions won't be called. |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 58fdd28243a..cc0658dc3f4 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -1851,9 +1851,12 @@ or nil." | |||
| 1851 | 1851 | ||
| 1852 | Each function in this list should be written to operate on the | 1852 | Each function in this list should be written to operate on the |
| 1853 | current buffer, but should not modify it in any way. The buffer | 1853 | current buffer, but should not modify it in any way. The buffer |
| 1854 | will contain undecoded text of parts of the file. Each function | 1854 | will contain the text of parts of the file. Each function |
| 1855 | should take one argument, SIZE, which says how many characters | 1855 | should take one argument, SIZE, which says how many characters |
| 1856 | \(starting from point) it should look at. | 1856 | \(starting from point) it should look at. The function might be |
| 1857 | called both when the file is visited and Emacs wants to decode | ||
| 1858 | its contents, and when the file's buffer is about to be saved | ||
| 1859 | and Emacs wants to determine how to encode its contents. | ||
| 1857 | 1860 | ||
| 1858 | If one of these functions succeeds in determining a coding | 1861 | If one of these functions succeeds in determining a coding |
| 1859 | system, it should return that coding system. Otherwise, it | 1862 | system, it should return that coding system. Otherwise, it |