Mercurial > emacs
comparison lisp/language/ethio-util.el @ 60642:a19b91e10a73
(sera-being-called-by-w3): New variable.
(ethio-sera-to-fidel-ethio): Check also sera-being-called-by-w3.
(ethio-fidel-to-sera-buffer): Likewise.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 16 Mar 2005 11:33:14 +0000 |
parents | b94de166de9d |
children | 197607499a29 |
comparison
equal
deleted
inserted
replaced
60641:d58f58688093 | 60642:a19b91e10a73 |
---|---|
417 nil nil nil nil nil | 417 nil nil nil nil nil |
418 ]) | 418 ]) |
419 | 419 |
420 ;; To avoid byte-compiler warnings. It should never be set globally. | 420 ;; To avoid byte-compiler warnings. It should never be set globally. |
421 (defvar ethio-sera-being-called-by-w3) | 421 (defvar ethio-sera-being-called-by-w3) |
422 ;; This variable will be bound by some third-party package. | |
423 (defvar sera-being-called-by-w3) | |
422 | 424 |
423 ;;;###autoload | 425 ;;;###autoload |
424 (defun ethio-sera-to-fidel-region (beg end &optional secondary force) | 426 (defun ethio-sera-to-fidel-region (beg end &optional secondary force) |
425 "Convert the characters in region from SERA to FIDEL. | 427 "Convert the characters in region from SERA to FIDEL. |
426 The variable `ethio-primary-language' specifies the primary language | 428 The variable `ethio-primary-language' specifies the primary language |
588 (while (and (not (eobp)) (null new-language)) | 590 (while (and (not (eobp)) (null new-language)) |
589 (setq ch (following-char)) | 591 (setq ch (following-char)) |
590 (cond | 592 (cond |
591 | 593 |
592 ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode | 594 ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode |
593 ((and (boundp 'ethio-sera-being-called-by-w3) | 595 ((and (or (= ch ?<) (= ch ?&)) |
594 ethio-sera-being-called-by-w3 | 596 (or (and (boundp 'ethio-sera-being-called-by-w3) |
595 (or (= ch ?<) (= ch ?&))) | 597 ethio-sera-being-called-by-w3) |
598 (and (boundp 'sera-being-called-by-w3) | |
599 sera-being-called-by-w3))) | |
596 (search-forward (if (= ch ?<) ">" ";") | 600 (search-forward (if (= ch ?<) ">" ";") |
597 nil 0)) | 601 nil 0)) |
598 | 602 |
599 ;; leave non-ASCII characters as they are | 603 ;; leave non-ASCII characters as they are |
600 ((>= ch 128) | 604 ((>= ch 128) |
1175 ((looking-at "[,.;:'`?]+") | 1179 ((looking-at "[,.;:'`?]+") |
1176 (insert "\\") | 1180 (insert "\\") |
1177 (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\) | 1181 (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\) |
1178 | 1182 |
1179 ;; skip from "<" to ">" (or from "&" to ";") if called from w3 | 1183 ;; skip from "<" to ">" (or from "&" to ";") if called from w3 |
1180 ((and (boundp 'ethio-sera-being-called-by-w3) | 1184 ((and (or (= ch ?<) (= ch ?&)) |
1181 ethio-sera-being-called-by-w3 | 1185 (or (and (boundp 'ethio-sera-being-called-by-w3) |
1182 (or (= ch ?<) (= ch ?&))) | 1186 ethio-sera-being-called-by-w3) |
1187 (and (boundp 'sera-being-called-by-w3) | |
1188 sera-being-called-by-w3))) | |
1183 (search-forward (if (= ch ?<) ">" ";") | 1189 (search-forward (if (= ch ?<) ">" ";") |
1184 nil 0)) | 1190 nil 0)) |
1185 | 1191 |
1186 ;; neutral character. no need to quote. just skip it. | 1192 ;; neutral character. no need to quote. just skip it. |
1187 (t | 1193 (t |