Function: ucs-normalize-compose-chars

ucs-normalize-compose-chars is a byte-compiled function defined in ucs-normalize.el.gz.

Signature

(ucs-normalize-compose-chars CHARS COMPOSITION-PREDICATE)

Documentation

Compose CHARS by COMPOSITION-PREDICATE.

CHARS must be sorted and normalized in starter-combining pairs.

Source Code

;; Defined in /usr/src/emacs/lisp/international/ucs-normalize.el.gz
(defun ucs-normalize-compose-chars (chars composition-predicate)
  "Compose CHARS by COMPOSITION-PREDICATE.
CHARS must be sorted and normalized in starter-combining pairs."
  (if composition-predicate
      (let* ((starter (car chars))
             remain result prev-ccc
             (target-chars (cdr chars))
             target target-ccc
             primary-composite)
     (while target-chars
       (setq target     (car target-chars)
             target-ccc (ucs-normalize-ccc target))
       (if (and (or (null prev-ccc)
                    (< prev-ccc target-ccc))
                (setq primary-composite
                      (ucs-normalize-primary-composite (list starter target)
                                                       composition-predicate)))
           ;; case 1: composable
           (setq starter primary-composite
                 prev-ccc nil)
         (if (= 0 target-ccc)
             ;; case 2: move starter
             (setq result (nconc result (cons starter (nreverse remain)))
                   starter target
                   remain nil)
           ;; case 3: move target
           (setq prev-ccc target-ccc
                 remain (cons target remain))))
       (setq target-chars (cdr target-chars)))
     (nconc result (cons starter (nreverse remain))))
    chars))