405 |
|
|
406 |
This function is the default value of `auto-composition-function' (which see)." |
This function is the default value of `auto-composition-function' (which see)." |
407 |
(save-buffer-state nil |
(save-buffer-state nil |
408 |
(save-match-data |
(save-excursion |
409 |
(let ((start pos) |
(save-match-data |
410 |
(limit (if string (length string) (point-max))) |
(let ((start pos) |
411 |
ch func newpos) |
(limit (if string (length string) (point-max))) |
412 |
(setq limit (or (text-property-any pos limit 'auto-composed t string) |
ch func newpos) |
413 |
limit)) |
(setq limit (or (text-property-any pos limit 'auto-composed t string) |
414 |
(catch 'tag |
limit)) |
415 |
(if string |
(catch 'tag |
416 |
|
(if string |
417 |
|
(while (< pos limit) |
418 |
|
(setq ch (aref string pos)) |
419 |
|
(if (= ch ?\n) |
420 |
|
(throw 'tag nil)) |
421 |
|
(setq func (aref composition-function-table ch)) |
422 |
|
(if (and (functionp func) |
423 |
|
(setq newpos (funcall func pos string)) |
424 |
|
(> newpos pos)) |
425 |
|
(setq pos newpos) |
426 |
|
(setq pos (1+ pos)))) |
427 |
(while (< pos limit) |
(while (< pos limit) |
428 |
(setq ch (aref string pos)) |
(setq ch (char-after pos)) |
429 |
(if (= ch ?\n) |
(if (= ch ?\n) |
430 |
(throw 'tag nil)) |
(throw 'tag nil)) |
431 |
(setq func (aref composition-function-table ch)) |
(setq func (aref composition-function-table ch)) |
433 |
(setq newpos (funcall func pos string)) |
(setq newpos (funcall func pos string)) |
434 |
(> newpos pos)) |
(> newpos pos)) |
435 |
(setq pos newpos) |
(setq pos newpos) |
436 |
(setq pos (1+ pos)))) |
(setq pos (1+ pos)))))) |
437 |
(while (< pos limit) |
(put-text-property start pos 'auto-composed t string)))))) |
|
(setq ch (char-after pos)) |
|
|
(if (= ch ?\n) |
|
|
(throw 'tag nil)) |
|
|
(setq func (aref composition-function-table ch)) |
|
|
(if (and (functionp func) |
|
|
(setq newpos (funcall func pos string)) |
|
|
(> newpos pos)) |
|
|
(setq pos newpos) |
|
|
(setq pos (1+ pos)))))) |
|
|
(put-text-property start pos 'auto-composed t string))))) |
|
438 |
|
|
439 |
(setq auto-composition-function 'auto-compose-chars) |
(setq auto-composition-function 'auto-compose-chars) |
440 |
|
|