Function: define-translation-table

define-translation-table is a byte-compiled function defined in mule.el.gz.

Signature

(define-translation-table SYMBOL &rest ARGS)

Documentation

Define SYMBOL as the name of translation table made by ARGS.

This sets up information so that the table can be used for translations in a CCL program.

If the first element of ARGS is a char-table whose purpose is translation-table, just define SYMBOL to name it. (Note that this function does not bind SYMBOL.)

Any other ARGS should be suitable as arguments of the function make-translation-table (which see).

This function sets properties translation-table and translation-table-id of SYMBOL to the created table itself and the identification number of the table respectively. It also registers the table in translation-table-vector.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule.el.gz
(defun define-translation-table (symbol &rest args)
  "Define SYMBOL as the name of translation table made by ARGS.
This sets up information so that the table can be used for
translations in a CCL program.

If the first element of ARGS is a char-table whose purpose is
`translation-table', just define SYMBOL to name it.  (Note that this
function does not bind SYMBOL.)

Any other ARGS should be suitable as arguments of the function
`make-translation-table' (which see).

This function sets properties `translation-table' and
`translation-table-id' of SYMBOL to the created table itself and the
identification number of the table respectively.  It also registers
the table in `translation-table-vector'."
  (declare (indent defun))
  (let ((table (if (and (char-table-p (car args))
			(eq (char-table-subtype (car args))
			    'translation-table))
		   (car args)
		 (apply 'make-translation-table args)))
	(len (length translation-table-vector))
	(id 0)
	(done nil))
    (put symbol 'translation-table table)
    (while (not done)
      (if (>= id len)
	  (setq translation-table-vector
		(vconcat translation-table-vector (make-vector len nil))))
      (let ((slot (aref translation-table-vector id)))
	(if (or (not slot)
		(eq (car slot) symbol))
	    (progn
	      (aset translation-table-vector id (cons symbol table))
	      (setq done t))
	  (setq id (1+ id)))))
    (put symbol 'translation-table-id id)
    id))