comparison lisp/international/quail.el @ 89293:f657319ddd9b

(quail-input-string-to-events): Don't generate compose-chars-after events.
author Kenichi Handa <handa@m17n.org>
date Thu, 07 Nov 2002 06:28:35 +0000
parents dfb403b5572b
children 2f877ed80fa6
comparison
equal deleted inserted replaced
89292:1bc1e30ea8d5 89293:f657319ddd9b
1265 (defun quail-error (&rest args) 1265 (defun quail-error (&rest args)
1266 (signal 'quail-error (apply 'format args))) 1266 (signal 'quail-error (apply 'format args)))
1267 1267
1268 (defun quail-input-string-to-events (str) 1268 (defun quail-input-string-to-events (str)
1269 "Convert input string STR to a list of events. 1269 "Convert input string STR to a list of events.
1270 Do so while interleaving with the following special events: 1270 If STR has `advice' text property, append the following special event:
1271 \(compose-last-chars LEN COMPONENTS) 1271 \(quail-advice STR)"
1272 \(quail-advice INPUT-STRING)" 1272 (let ((events (mapcar
1273 (let* ((events (mapcar 1273 (lambda (c)
1274 (lambda (c) 1274 ;; This gives us the chance to unify on input
1275 ;; This gives us the chance to unify on input 1275 ;; (e.g. using ucs-tables.el).
1276 ;; (e.g. using ucs-tables.el). 1276 (or (and translation-table-for-input
1277 ;; Fixme: Is this still useful? (See also mule-conf.el.) 1277 (aref translation-table-for-input c))
1278 (or (and translation-table-for-input 1278 c))
1279 (aref translation-table-for-input c)) 1279 str)))
1280 c))
1281 str))
1282 (len (length str))
1283 (idx len)
1284 composition from to)
1285 (while (and (> idx 0)
1286 (setq composition (find-composition idx 0 str t)))
1287 (setq from (car composition) to (nth 1 composition))
1288 (setcdr (nthcdr (1- to) events)
1289 (cons (list 'compose-last-chars (- to from)
1290 (and (not (nth 3 composition)) (nth 2 composition)))
1291 (nthcdr to events)))
1292 (setq idx (1- from)))
1293 (if (or (get-text-property 0 'advice str) 1280 (if (or (get-text-property 0 'advice str)
1294 (next-single-property-change 0 'advice str)) 1281 (next-single-property-change 0 'advice str))
1295 (setq events 1282 (setq events
1296 (nconc events (list (list 'quail-advice str))))) 1283 (nconc events (list (list 'quail-advice str)))))
1297 events)) 1284 events))