391 |
,@body |
,@body |
392 |
(unless modified |
(unless modified |
393 |
(restore-buffer-modified-p nil)))) |
(restore-buffer-modified-p nil)))) |
|
(put 'save-buffer-state 'lisp-indent-function 1) |
|
394 |
;; Fixme: This makes bootstrapping fail with this error. |
;; Fixme: This makes bootstrapping fail with this error. |
395 |
;; Symbol's function definition is void: eval-defun |
;; Symbol's function definition is void: eval-defun |
396 |
;;(def-edebug-spec save-buffer-state let) |
;;(def-edebug-spec save-buffer-state let) |
397 |
) |
) |
398 |
|
|
399 |
|
(put 'save-buffer-state 'lisp-indent-function 1) |
400 |
|
|
401 |
(defun auto-compose-chars (pos string) |
(defun auto-compose-chars (pos string) |
402 |
"Compose characters after the buffer position POS. |
"Compose characters after the buffer position POS. |
403 |
If STRING is non-nil, it is a string, and POS is an index into the string. |
If STRING is non-nil, it is a string, and POS is an index into the string. |
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-excursion |
(save-match-data |
409 |
(save-restriction |
(let ((start pos) |
410 |
(save-match-data |
(limit (if string (length string) (point-max))) |
411 |
(let ((start pos) |
ch func newpos) |
412 |
(limit (next-single-property-change pos 'auto-composed string)) |
(setq limit (or (text-property-any pos limit 'auto-composed t string) |
413 |
ch func newpos) |
limit)) |
414 |
(if limit |
(catch 'tag |
415 |
(setq limit (1+ limit)) |
(if string |
416 |
(setq limit (if string (length string) (point-max)))) |
(while (< pos limit) |
417 |
(catch 'tag |
(setq ch (aref string pos)) |
418 |
(if string |
(if (= ch ?\n) |
419 |
(while (< pos limit) |
(throw 'tag nil)) |
420 |
(setq ch (aref string pos) |
(setq func (aref composition-function-table ch)) |
421 |
pos (1+ pos)) |
(if (and (functionp func) |
422 |
(if (= ch ?\n) |
(setq newpos (funcall func pos string)) |
423 |
(throw 'tag nil)) |
(> newpos pos)) |
424 |
(setq func (aref composition-function-table ch)) |
(setq pos newpos) |
425 |
(if (and (functionp func) |
(setq pos (1+ pos)))) |
426 |
(setq newpos (funcall func (1- pos) string)) |
(while (< pos limit) |
427 |
(> newpos pos)) |
(setq ch (char-after pos)) |
428 |
(setq pos newpos))) |
(if (= ch ?\n) |
429 |
(while (< pos limit) |
(throw 'tag nil)) |
430 |
(setq ch (char-after pos) |
(setq func (aref composition-function-table ch)) |
431 |
pos (1+ pos)) |
(if (and (functionp func) |
432 |
(if (= ch ?\n) |
(setq newpos (funcall func pos string)) |
433 |
(throw 'tag nil)) |
(> newpos pos)) |
434 |
(setq func (aref composition-function-table ch)) |
(setq pos newpos) |
435 |
(if (and (functionp func) |
(setq pos (1+ pos)))))) |
436 |
(setq newpos (funcall func (1- pos) string)) |
(put-text-property start pos 'auto-composed t string))))) |
|
(> newpos pos)) |
|
|
(setq pos newpos))))) |
|
|
(put-text-property start pos 'auto-composed t string))))))) |
|
437 |
|
|
438 |
(setq auto-composition-function 'auto-compose-chars) |
(setq auto-composition-function 'auto-compose-chars) |
439 |
|
|