Function: indian-translate-region

indian-translate-region is a macro defined in ind-util.el.gz.

Signature

(indian-translate-region FROM TO HASHTABLE ENCODE-P)

Source Code

;; Defined in /usr/src/emacs/lisp/language/ind-util.el.gz
(defmacro indian-translate-region (from to hashtable encode-p)
  `(save-excursion
     (save-restriction
       (let ((regexp ,(indian-regexp-of-hashtbl-keys
		       (if encode-p (car (eval hashtable))
			 (cdr (eval hashtable))))))
	 (narrow-to-region ,from ,to)
	 (goto-char (point-min))
	 (while (re-search-forward regexp nil t)
	   (let ((matchstr (gethash (match-string 0)
				    (if ,encode-p
					(car ,hashtable)
				      (cdr ,hashtable)))))
	     (if matchstr (replace-match matchstr))))))))