Function: ethio-write-file

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

Signature

(ethio-write-file)

Documentation

Transliterate Ethiopic characters to ASCII depending on the file extension.

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

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
;;;###autoload
(defun ethio-write-file nil
  "Transliterate Ethiopic characters to ASCII depending on the file extension.
If the file-name extension is \".sera\", convert from FIDEL to SERA.
If the file-name extension is \".html\", convert FIDEL characters to
SERA regions enclosed by \"<sera>..</sera>\".
If the file-name extension is \".tex\", convert FIDEL characters
to fidel-tex commands.
If the file-name extension is \".java\", convert FIDEL characters to
Java escape sequences.

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-fidel-to-sera-buffer nil 'force)
      (goto-char (point-min))
      (ethio-record-user-preference)
      (set-buffer-modified-p nil)))

   ((string-match "\\.html$" (buffer-file-name))
    (save-excursion
      (let ((ethio-sera-being-called-by-w3 t))
	(ethio-fidel-to-sera-marker 'force)
	(goto-char (point-min))
	(while (re-search-forward "[«»]" nil t)
	  (replace-match (if (= (preceding-char) ?«) "&laquo;" "&raquo;")))
	(goto-char (point-min))
	(if (search-forward "<sera>" nil t)
	    (ethio-record-user-preference))
	(set-buffer-modified-p nil))))

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

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

   (t
    nil)))