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


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/lisp/international/mule-cmds.el
Date: Thu, 10 Apr 2003 21:20:36 -0400

Index: emacs/lisp/international/mule-cmds.el
diff -c emacs/lisp/international/mule-cmds.el:1.227 
emacs/lisp/international/mule-cmds.el:1.228
*** emacs/lisp/international/mule-cmds.el:1.227 Thu Apr 10 20:41:40 2003
--- emacs/lisp/international/mule-cmds.el       Thu Apr 10 21:20:36 2003
***************
*** 416,429 ****
  non-nil, it is used to sort CODINGS in the different way than above."
    (if sort-coding-systems-predicate
        (sort codings sort-coding-systems-predicate)
!     (let* ((most-preferred (symbol-value (car coding-category-list)))
           (lang-preferred (get-language-info current-language-environment
                                              'coding-system))
           (func (function
                  (lambda (x)
                    (let ((base (coding-system-base x)))
!                     (+ (if (eq base most-preferred) 64 0)
!                        (let ((mime (coding-system-get base 'mime-charset)))
                           ;; Prefer coding systems corresponding to a
                           ;; MIME charset.
                           (if mime
--- 416,441 ----
  non-nil, it is used to sort CODINGS in the different way than above."
    (if sort-coding-systems-predicate
        (sort codings sort-coding-systems-predicate)
!     (let* ((from-categories (mapcar #'(lambda (x) (symbol-value x))
!                                   coding-category-list))
!          (most-preferred (car from-categories))
           (lang-preferred (get-language-info current-language-environment
                                              'coding-system))
           (func (function
                  (lambda (x)
                    (let ((base (coding-system-base x)))
!                     ;; We calculate the priority number 0..255 by
!                     ;; using the 8 bits PMMLCEII as this:
!                     ;; P: 1 iff most preferred.
!                     ;; MM: greater than 0 iff mime-charset.
!                     ;; L: 1 iff one of the current lang. env.'s codings.
!                     ;; C: 1 iff one of codings listed in the category list.
!                     ;; E: 1 iff not XXX-with-esc
!                     ;; II: if iso-2022 based, 0..3, else 1.
!                     (logior
!                      (lsh (if (eq base most-preferred) 1 0) 7)
!                      (lsh
!                       (let ((mime (coding-system-get base 'mime-charset)))
                           ;; Prefer coding systems corresponding to a
                           ;; MIME charset.
                           (if mime
***************
*** 432,458 ****
                               ;; x-ctext below that.
                               (cond ((string-match "utf-16"
                                                    (symbol-name mime))
!                                     16)
                                     ((string-match "^x-" (symbol-name mime))
!                                     8)
!                                    (t 32))
                             0))
!                        (if (memq base lang-preferred) 8 0)
!                        (if (string-match "-with-esc\\'" (symbol-name base))
!                            0 4)
!                        (if (eq (coding-system-type base) 2)
!                            ;; For ISO based coding systems, prefer
!                            ;; one that doesn't use escape sequences.
!                            (let ((flags (coding-system-flags base)))
!                              (if (or (consp (aref flags 0))
!                                      (consp (aref flags 1))
!                                      (consp (aref flags 2))
!                                      (consp (aref flags 3)))
!                                  (if (or (aref flags 8) (aref flags 9))
!                                      0
!                                    1)
!                                2))
!                          1)))))))
        (sort codings (function (lambda (x y)
                                (> (funcall func x) (funcall func y))))))))
  
--- 444,473 ----
                               ;; x-ctext below that.
                               (cond ((string-match "utf-16"
                                                    (symbol-name mime))
!                                     2)
                                     ((string-match "^x-" (symbol-name mime))
!                                     1)
!                                    (t 3))
                             0))
!                       5)
!                      (lsh (if (memq base lang-preferred) 1 0) 4)
!                      (lsh (if (memq base from-categories) 1 0) 3)
!                      (lsh (if (string-match "-with-esc\\'"
!                                             (symbol-name base))
!                               0 1) 2)
!                      (if (eq (coding-system-type base) 2)
!                          ;; For ISO based coding systems, prefer
!                          ;; one that doesn't use escape sequences.
!                          (let ((flags (coding-system-flags base)))
!                            (if (or (consp (aref flags 0))
!                                    (consp (aref flags 1))
!                                    (consp (aref flags 2))
!                                    (consp (aref flags 3)))
!                                (if (or (aref flags 8) (aref flags 9))
!                                    0
!                                  1)
!                              2))
!                        1)))))))
        (sort codings (function (lambda (x y)
                                (> (funcall func x) (funcall func y))))))))
  




reply via email to

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