emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/international/mule-cmds.el,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/lisp/international/mule-cmds.el,v
Date: Thu, 26 Jun 2008 07:37:21 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/06/26 07:37:16

Index: mule-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/international/mule-cmds.el,v
retrieving revision 1.329
retrieving revision 1.330
diff -u -b -r1.329 -r1.330
--- mule-cmds.el        12 Jun 2008 03:56:18 -0000      1.329
+++ mule-cmds.el        26 Jun 2008 07:37:15 -0000      1.330
@@ -2805,11 +2805,14 @@
 (defun encode-coding-char (char coding-system)
   "Encode CHAR by CODING-SYSTEM and return the resulting string.
 If CODING-SYSTEM can't safely encode CHAR, return nil."
-  (let ((str1 (string-as-multibyte (string char)))
+  (let* ((str1 (string-as-multibyte (string char)))
        (str2 (string-as-multibyte (string char char)))
+        (found (find-coding-systems-string str1))
        enc1 enc2 i1 i2)
-    (when (memq (coding-system-base coding-system)
-               (find-coding-systems-string str1))
+    (if (and (consp found)
+            (eq (car found) 'undecided))
+       str1
+      (when (memq (coding-system-base coding-system) found)
       ;; We must find the encoded string of CHAR.  But, just encoding
       ;; CHAR will put extra control sequences (usually to designate
       ;; ASCII charset) at the tail if type of CODING is ISO 2022.
@@ -2827,7 +2830,7 @@
       ;; Now (substring enc1 i1) and (substring enc2 i2) are the same,
       ;; and they are the extra control sequences at the tail to
       ;; exclude.
-      (substring enc2 0 i2))))
+       (substring enc2 0 i2)))))
 
 ;; Backwards compatibility.  These might be better with :init-value t,
 ;; but that breaks loadup.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]