Mercurial > emacs
comparison lisp/language/ethio-util.el @ 54736:b94de166de9d
(ethio-sera-being-called-by-w3): New
variable.
(ethio-sera-to-fidel-ethio): Check ethio-sera-being-called-by-w3
instead of sera-being-called-by-w3.
(ethio-fidel-to-sera-buffer): Likewise.
(ethio-find-file): Bind ethio-sera-being-called-by-w3 to t
instead of sera-being-called-by-w3.
(ethio-write-file): Likewise.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 05 Apr 2004 23:27:37 +0000 |
parents | 6232f791322c |
children | a19b91e10a73 |
comparison
equal
deleted
inserted
replaced
54735:eb44ae138199 | 54736:b94de166de9d |
---|---|
415 (?e "$(3#B%n(B") (?u "$(3#B%r(B") (?i "$(3#B%o(B") (?E "$(3#B%q(B"))) | 415 (?e "$(3#B%n(B") (?u "$(3#B%r(B") (?i "$(3#B%o(B") (?E "$(3#B%q(B"))) |
416 ;;; { | } ~ DEL | 416 ;;; { | } ~ DEL |
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. | |
421 (defvar ethio-sera-being-called-by-w3) | |
422 | |
420 ;;;###autoload | 423 ;;;###autoload |
421 (defun ethio-sera-to-fidel-region (beg end &optional secondary force) | 424 (defun ethio-sera-to-fidel-region (beg end &optional secondary force) |
422 "Convert the characters in region from SERA to FIDEL. | 425 "Convert the characters in region from SERA to FIDEL. |
423 The variable `ethio-primary-language' specifies the primary language | 426 The variable `ethio-primary-language' specifies the primary language |
424 and `ethio-secondary-language' specifies the secondary. | 427 and `ethio-secondary-language' specifies the secondary. |
585 (while (and (not (eobp)) (null new-language)) | 588 (while (and (not (eobp)) (null new-language)) |
586 (setq ch (following-char)) | 589 (setq ch (following-char)) |
587 (cond | 590 (cond |
588 | 591 |
589 ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode | 592 ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode |
590 ((and (boundp 'sera-being-called-by-w3) | 593 ((and (boundp 'ethio-sera-being-called-by-w3) |
591 sera-being-called-by-w3 | 594 ethio-sera-being-called-by-w3 |
592 (or (= ch ?<) (= ch ?&))) | 595 (or (= ch ?<) (= ch ?&))) |
593 (search-forward (if (= ch ?<) ">" ";") | 596 (search-forward (if (= ch ?<) ">" ";") |
594 nil 0)) | 597 nil 0)) |
595 | 598 |
596 ;; leave non-ASCII characters as they are | 599 ;; leave non-ASCII characters as they are |
1172 ((looking-at "[,.;:'`?]+") | 1175 ((looking-at "[,.;:'`?]+") |
1173 (insert "\\") | 1176 (insert "\\") |
1174 (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\) | 1177 (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\) |
1175 | 1178 |
1176 ;; skip from "<" to ">" (or from "&" to ";") if called from w3 | 1179 ;; skip from "<" to ">" (or from "&" to ";") if called from w3 |
1177 ((and (boundp 'sera-being-called-by-w3) | 1180 ((and (boundp 'ethio-sera-being-called-by-w3) |
1178 sera-being-called-by-w3 | 1181 ethio-sera-being-called-by-w3 |
1179 (or (= ch ?<) (= ch ?&))) | 1182 (or (= ch ?<) (= ch ?&))) |
1180 (search-forward (if (= ch ?<) ">" ";") | 1183 (search-forward (if (= ch ?<) ">" ";") |
1181 nil 0)) | 1184 nil 0)) |
1182 | 1185 |
1183 ;; neutral character. no need to quote. just skip it. | 1186 ;; neutral character. no need to quote. just skip it. |
1833 (save-excursion | 1836 (save-excursion |
1834 (ethio-sera-to-fidel-buffer nil 'force) | 1837 (ethio-sera-to-fidel-buffer nil 'force) |
1835 (set-buffer-modified-p nil))) | 1838 (set-buffer-modified-p nil))) |
1836 | 1839 |
1837 ((string-match "\\.html$" (buffer-file-name)) | 1840 ((string-match "\\.html$" (buffer-file-name)) |
1838 (let ((sera-being-called-by-w3 t)) | 1841 (let ((ethio-sera-being-called-by-w3 t)) |
1839 (save-excursion | 1842 (save-excursion |
1840 (ethio-sera-to-fidel-marker 'force) | 1843 (ethio-sera-to-fidel-marker 'force) |
1841 (goto-char (point-min)) | 1844 (goto-char (point-min)) |
1842 (while (re-search-forward "&[lr]aquote;" nil t) | 1845 (while (re-search-forward "&[lr]aquote;" nil t) |
1843 (if (= (char-after (1+ (match-beginning 0))) ?l) | 1846 (if (= (char-after (1+ (match-beginning 0))) ?l) |
1870 (ethio-record-user-preference) | 1873 (ethio-record-user-preference) |
1871 (set-buffer-modified-p nil))) | 1874 (set-buffer-modified-p nil))) |
1872 | 1875 |
1873 ((string-match "\\.html$" (buffer-file-name)) | 1876 ((string-match "\\.html$" (buffer-file-name)) |
1874 (save-excursion | 1877 (save-excursion |
1875 (let ((sera-being-called-by-w3 t) | 1878 (let ((ethio-sera-being-called-by-w3 t) |
1876 (lq (aref ethio-fidel-to-sera-map 461)) | 1879 (lq (aref ethio-fidel-to-sera-map 461)) |
1877 (rq (aref ethio-fidel-to-sera-map 462))) | 1880 (rq (aref ethio-fidel-to-sera-map 462))) |
1878 (aset ethio-fidel-to-sera-map 461 "«te;") | 1881 (aset ethio-fidel-to-sera-map 461 "«te;") |
1879 (aset ethio-fidel-to-sera-map 462 "»te;") | 1882 (aset ethio-fidel-to-sera-map 462 "»te;") |
1880 (ethio-fidel-to-sera-marker 'force) | 1883 (ethio-fidel-to-sera-marker 'force) |