diff options
| author | Kenichi Handa | 2002-11-07 06:29:31 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-11-07 06:29:31 +0000 |
| commit | 2e82b5d51366411bc1edba48773b18d56cc6e8b0 (patch) | |
| tree | 8a8ce58d6b74f11f7857dd9cceec4dfc3fb0f555 /lisp/language/devan-util.el | |
| parent | 9e193af4b984b6b1a543ed11656fc390476c086d (diff) | |
| download | emacs-2e82b5d51366411bc1edba48773b18d56cc6e8b0.tar.gz emacs-2e82b5d51366411bc1edba48773b18d56cc6e8b0.zip | |
Register devanagari-composable-pattern
in indian-composable-pattern.
(devanagari-composition-function): Add autoload cookie. Change
arguments to conform to composition-function-table.
Diffstat (limited to 'lisp/language/devan-util.el')
| -rw-r--r-- | lisp/language/devan-util.el | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lisp/language/devan-util.el b/lisp/language/devan-util.el index 1a2caf617c9..f2f7873b33e 100644 --- a/lisp/language/devan-util.el +++ b/lisp/language/devan-util.el | |||
| @@ -58,6 +58,12 @@ | |||
| 58 | "\\)") | 58 | "\\)") |
| 59 | "Regexp matching a composable sequence of Devanagari characters.") | 59 | "Regexp matching a composable sequence of Devanagari characters.") |
| 60 | 60 | ||
| 61 | (dolist (range '((#x0903 . #x0903) | ||
| 62 | (#x0905 . #x0939) | ||
| 63 | (#x0958 . #x0961))) | ||
| 64 | (set-char-table-range indian-composable-pattern range | ||
| 65 | devanagari-composable-pattern)) | ||
| 66 | |||
| 61 | ;;;###autoload | 67 | ;;;###autoload |
| 62 | (defun devanagari-compose-region (from to) | 68 | (defun devanagari-compose-region (from to) |
| 63 | (interactive "r") | 69 | (interactive "r") |
| @@ -98,21 +104,19 @@ | |||
| 98 | dummy) | 104 | dummy) |
| 99 | (function (lambda (x y) (> (length x) (length y)))))))) | 105 | (function (lambda (x y) (> (length x) (length y)))))))) |
| 100 | 106 | ||
| 101 | (defun devanagari-composition-function (from to pattern &optional string) | ||
| 102 | "Compose Devanagari characters in REGION, or STRING if specified. | ||
| 103 | Assume that the REGION or STRING must fully match the composable | ||
| 104 | PATTERN regexp." | ||
| 105 | (if string (devanagari-compose-syllable-string string) | ||
| 106 | (devanagari-compose-syllable-region from to)) | ||
| 107 | (- to from)) | ||
| 108 | 107 | ||
| 109 | ;; Register a function to compose Devanagari characters. | 108 | ;;;###autoload |
| 110 | (mapc | 109 | (defun devanagari-composition-function (pos &optional string) |
| 111 | (function (lambda (ucs) | 110 | "Compose Devanagari characters after the position POS. |
| 112 | (aset composition-function-table ucs | 111 | If STRING is not nil, it is a string, and POS is an index to the string. |
| 113 | (list (cons devanagari-composable-pattern | 112 | In this case, compose characters after POS of the string." |
| 114 | 'devanagari-composition-function))))) | 113 | (if string |
| 115 | (nconc '(#x0903) (devanagari-range #x0905 #x0939) (devanagari-range #x0958 #x0961))) | 114 | ;; Not yet implemented. |
| 115 | nil | ||
| 116 | (goto-char pos) | ||
| 117 | (if (looking-at devanagari-composable-pattern) | ||
| 118 | (prog1 (match-end 0) | ||
| 119 | (devanagari-compose-syllable-region pos (match-end 0)))))) | ||
| 116 | 120 | ||
| 117 | ;; Notes on conversion steps. | 121 | ;; Notes on conversion steps. |
| 118 | 122 | ||