Function: ethio-find-file

ethio-find-file is an autoloaded and byte-compiled function defined in ethio-util.el.gz.

Signature

(ethio-find-file)

Documentation

Transliterate file content into Ethiopic depending on filename suffix.

If the file-name extension is ".sera", convert from SERA to FIDEL. If the file-name extension is ".html", convert regions enclosed by "<sera>..</sera>" from SERA to FIDEL. If the file-name extension is ".tex", convert fidel-tex commands to FIDEL characters. If the file-name extension is ".java", convert Java escape sequences to FIDEL characters.

FIDEL is the Amharic alphabet; SERA (System for Ethiopic Representation in ASCII) is the Latin representation of Ethiopic script.

Source Code

;; Defined in /usr/src/emacs/lisp/language/ethio-util.el.gz
;;
;; file I/O hooks
;;

;;;###autoload
(defun ethio-find-file nil
  "Transliterate file content into Ethiopic depending on filename suffix.
If the file-name extension is \".sera\", convert from SERA to FIDEL.
If the file-name extension is \".html\", convert regions enclosed
by \"<sera>..</sera>\" from SERA to FIDEL.
If the file-name extension is \".tex\", convert fidel-tex commands
to FIDEL characters.
If the file-name extension is \".java\", convert Java escape sequences
to FIDEL characters.

FIDEL is the Amharic alphabet; SERA (System for Ethiopic Representation
in ASCII) is the Latin representation of Ethiopic script."
  (cond

   ((string-match "\\.sera$" (buffer-file-name))
    (save-excursion
      (ethio-sera-to-fidel-buffer nil 'force)
      (set-buffer-modified-p nil)))

   ((string-match "\\.html$" (buffer-file-name))
    (let ((ethio-sera-being-called-by-w3 t))
      (save-excursion
	(ethio-sera-to-fidel-marker 'force)
	(goto-char (point-min))
	(while (re-search-forward "&[lr]aquo;" nil t)
	  (if (= (char-after (1+ (match-beginning 0))) ?l)
	      (replace-match "«")
	    (replace-match "»")))
	(set-buffer-modified-p nil))))

   ((string-match "\\.tex$" (buffer-file-name))
    (save-excursion
      (ethio-tex-to-fidel-buffer)
      (set-buffer-modified-p nil)))

   ((string-match "\\.java$" (buffer-file-name))
    (save-excursion
      (ethio-java-to-fidel-buffer)
      (set-buffer-modified-p nil)))

   (t
    nil)))