aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/international
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/mule.el25
1 files changed, 18 insertions, 7 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 5393958013b..281e5297d63 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1852,9 +1852,12 @@ or nil."
1852 1852
1853Each function in this list should be written to operate on the 1853Each function in this list should be written to operate on the
1854current buffer, but should not modify it in any way. The buffer 1854current buffer, but should not modify it in any way. The buffer
1855will contain undecoded text of parts of the file. Each function 1855will contain the text of parts of the file. Each function
1856should take one argument, SIZE, which says how many characters 1856should take one argument, SIZE, which says how many characters
1857\(starting from point) it should look at. 1857\(starting from point) it should look at. The function might be
1858called both when the file is visited and Emacs wants to decode
1859its contents, and when the file's buffer is about to be saved
1860and Emacs wants to determine how to encode its contents.
1858 1861
1859If one of these functions succeeds in determining a coding 1862If one of these functions succeeds in determining a coding
1860system, it should return that coding system. Otherwise, it 1863system, it should return that coding system. Otherwise, it
@@ -2501,10 +2504,17 @@ This function is intended to be added to `auto-coding-functions'."
2501 (let ((sym-type (coding-system-type sym)) 2504 (let ((sym-type (coding-system-type sym))
2502 (bfcs-type 2505 (bfcs-type
2503 (coding-system-type buffer-file-coding-system))) 2506 (coding-system-type buffer-file-coding-system)))
2504 ;; 'charset' will signal an error in 2507 ;; If the buffer is unibyte, its encoding is
2505 ;; coding-system-equal, since it isn't a 2508 ;; immaterial (it is just the default value of
2506 ;; coding-system. So test that up front. 2509 ;; buffer-file-coding-system), so we ignore it.
2507 (if (and (not (equal sym-type 'charset)) 2510 ;; This situation happens when this function is
2511 ;; called as part of visiting a file, as opposed
2512 ;; to when saving a buffer to a file.
2513 (if (and enable-multibyte-characters
2514 ;; 'charset' will signal an error in
2515 ;; coding-system-equal, since it isn't a
2516 ;; coding-system. So test that up front.
2517 (not (equal sym-type 'charset))
2508 (coding-system-equal 'utf-8 sym-type) 2518 (coding-system-equal 'utf-8 sym-type)
2509 (coding-system-equal 'utf-8 bfcs-type)) 2519 (coding-system-equal 'utf-8 bfcs-type))
2510 buffer-file-coding-system 2520 buffer-file-coding-system
@@ -2556,7 +2566,8 @@ This function is intended to be added to `auto-coding-functions'."
2556 (let ((sym-type (coding-system-type sym)) 2566 (let ((sym-type (coding-system-type sym))
2557 (bfcs-type 2567 (bfcs-type
2558 (coding-system-type buffer-file-coding-system))) 2568 (coding-system-type buffer-file-coding-system)))
2559 (if (and (coding-system-equal 'utf-8 sym-type) 2569 (if (and enable-multibyte-characters
2570 (coding-system-equal 'utf-8 sym-type)
2560 (coding-system-equal 'utf-8 bfcs-type)) 2571 (coding-system-equal 'utf-8 bfcs-type))
2561 buffer-file-coding-system 2572 buffer-file-coding-system
2562 sym)) 2573 sym))