Function: ethio-sera-to-fidel-region-ethio

ethio-sera-to-fidel-region-ethio is a byte-compiled function defined in ethio-util.el.gz.

Signature

(ethio-sera-to-fidel-region-ethio LANG)

Documentation

Return next language as symbol: amharic, tigrigna, toggle or nil.

Source Code

;; Defined in /usr/src/emacs/lisp/language/ethio-util.el.gz
(defun ethio-sera-to-fidel-region-ethio (lang)
  "Return next language as symbol: amharic, tigrigna, toggle or nil."
  (save-restriction
    (narrow-to-region
     (point)
     (if (re-search-forward "\\(`[1-9][0-9]*\\)\\|[\\<&]" nil t)
	 (match-beginning 0)
       (point-max)))
    (robin-convert-region (point-min) (point-max) "ethiopic-sera")
    (goto-char (point-max)))

  (let (lflag)
    (cond
     ((= (following-char) ?`)
      (delete-char 1)
      (ethio-process-digits)
      lang)

     ((looking-at "[<&]")
      (if (or (and (boundp 'ethio-sera-being-called-by-w3)
		   ethio-sera-being-called-by-w3)
	      (and (boundp 'sera-being-called-by-w3)
		   sera-being-called-by-w3))
	  (search-forward (if (= (following-char) ?<) ">" ";") nil 0)
	(forward-char 1))
      lang)

     ((eobp)
      nil)

     ;; Now we must be looking at a "\".
     ;; First delete that "\", then check the following chars.

     ((progn (delete-char 1) (= (following-char) 32))
      (delete-char 1)
      'toggle)

     ((looking-at "[,.;:'`?\\]+")
      (goto-char (match-end 0))
      lang)

     ((/= (following-char) ?~)
      'toggle)

     ;; Now we must be looking at a "~".

     ((setq lflag (ethio-process-language-flag))
      lflag)

     ;; Delete the following "~" and check the following chars.

     ((progn (delete-char 1) (looking-at "! ?"))
      (replace-match "")
      (if (re-search-forward "\\\\~! ?" nil 0)
	  (replace-match ""))
      lang)

     ((looking-at "-: ?")
      (replace-match "")
      (ethio-use-colon-for-colon t)
      lang)

     ((looking-at "`: ?")
      (replace-match "")
      (ethio-use-colon-for-colon nil)
      lang)

     ((looking-at "`| ?")
      (replace-match "")
      (ethio-use-three-dot-question t)
      lang)

     ((looking-at "\\? ?")
      (replace-match "")
      (ethio-use-three-dot-question nil)
      lang)

     ;; Unknown tilde escape.  Recover the deleted chars.
     (t
      (insert "\\~")
      lang))))