]> code.delx.au - gnu-emacs/commitdiff
mule.el (define-coding-system): New coding system
authorKenichi Handa <handa@gnu.org>
Fri, 28 Jun 2013 14:54:18 +0000 (23:54 +0900)
committerKenichi Handa <handa@gnu.org>
Fri, 28 Jun 2013 14:54:18 +0000 (23:54 +0900)
properties :inhibit-null-byte-detection,
:inhibit-iso-escape-detection, and :prefer-utf-8.
(set-buffer-file-coding-system): If :charset-list property of
CODING-SYSTEM is `emacs', do not check if CODING-SYSTEM is
appropriate for setting.

lisp/ChangeLog
lisp/international/mule.el

index 0d69ca18dfadfc931687ef2973da3e62beb78574..7c36b2401753f3fd98fbaf0ece756cac4e4fb0a8 100644 (file)
@@ -1,3 +1,20 @@
+2013-06-28  Kenichi Handa  <handa@gnu.org>
+
+       * international/mule.el (define-coding-system): New coding system
+       properties :inhibit-null-byte-detection,
+       :inhibit-iso-escape-detection, and :prefer-utf-8.
+       (set-buffer-file-coding-system): If :charset-list property of
+       CODING-SYSTEM is `emacs', do not check if CODING-SYSTEM is
+       appropriate for setting.
+
+       * international/mule-cmds.el (select-safe-coding-system): If
+       DEFAULT-CODING-SYSTEM is prefer-utf-8 and the buffer contains
+       multibyte characters, return utf-8 (or one of it's siblings).
+
+       * international/mule-conf.el (prefer-utf-8): New coding system.
+       (file-coding-system-alist): Use prefer-utf-8 as default for Elisp
+       files.
+
 2013-06-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/package.el (package-el-version): Remove.
index 4ce1a28c4385dde57945bb09b8ac926a192fbaab..3577e0e91526e0348a7b3108355f0f54838b3563 100644 (file)
@@ -732,7 +732,26 @@ decoding.  This attribute has a meaning only when `:coding-type' is
 
 VALUE is a symbol representing the registered CCL program used for
 encoding.  This attribute has a meaning only when `:coding-type' is
-`ccl'."
+`ccl'.
+
+:inhibit-null-byte-detection
+
+VALUE non-nil means Emacs ignore null bytes on code detection.
+See the variable `inhibit-null-byte-detection'.  This attribute
+has a meaning only when `:coding-type' is `undecided'.
+
+:inhibit-iso-escape-detection
+
+VALUE non-nil means Emacs ignores ISO-2022 escape sequences on
+code detection.  See the variable `inhibit-iso-escape-detection'.
+This attribute has a meaning only when `:coding-type' is
+`undecided'.
+
+:prefer-utf-8
+
+VALUE non-nil means Emacs prefers UTF-8 on code detection for
+non-ASCII files.  This attribute has a meaning only when
+`:coding-type' is `undecided'."
   (let* ((common-attrs (mapcar 'list
                               '(:mnemonic
                                 :coding-type
@@ -761,7 +780,11 @@ encoding.  This attribute has a meaning only when `:coding-type' is
                                   ((eq coding-type 'ccl)
                                    '(:ccl-decoder
                                      :ccl-encoder
-                                     :valids))))))
+                                     :valids))
+                                  ((eq coding-type 'undecided)
+                                   '(:inhibit-null-byte-detection
+                                     :inhibit-iso-escape-detection
+                                     :prefer-utf-8))))))
 
     (dolist (slot common-attrs)
       (setcdr slot (plist-get props (car slot))))
@@ -1236,7 +1259,9 @@ just set the variable `buffer-file-coding-system' directly."
   (if (and coding-system buffer-file-coding-system (null force))
       (setq coding-system
            (merge-coding-systems coding-system buffer-file-coding-system)))
-  (when (called-interactively-p 'interactive)
+  (when (and (called-interactively-p 'interactive)
+            (not (memq 'emacs (coding-system-get coding-system
+                                                 :charset-list))))
     ;; Check whether save would succeed, and jump to the offending char(s)
     ;; if not.
     (let ((css (find-coding-systems-region (point-min) (point-max))))