Mercurial > emacs
comparison lisp/composite.el @ 90656:a85e3683b64f
(terminal-composition-modification): New function.
(terminal-composition-function): Create composition with the above
modification function.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 10 Nov 2006 06:34:30 +0000 |
parents | 042336f13176 |
children | 6588c6259dfb |
comparison
equal
deleted
inserted
replaced
90655:f1396baff620 | 90656:a85e3683b64f |
---|---|
425 ;;(def-edebug-spec save-buffer-state let) | 425 ;;(def-edebug-spec save-buffer-state let) |
426 ) | 426 ) |
427 | 427 |
428 (put 'save-buffer-state 'lisp-indent-function 1) | 428 (put 'save-buffer-state 'lisp-indent-function 1) |
429 | 429 |
430 ;; This function is called when a composition created by | |
431 ;; terminal-composition-function is partially modified. | |
432 (defun terminal-composition-modification (from to) | |
433 (terminal-composition-function from)) | |
434 | |
430 (defun terminal-composition-function (pos &optional string) | 435 (defun terminal-composition-function (pos &optional string) |
431 "General composition function used on terminal. | 436 "General composition function used on terminal. |
432 Non-spacing characters are composed with the preceding spacing | 437 Non-spacing characters are composed with the preceding spacing |
433 character. All non-spacing characters has this function in | 438 character. All non-spacing characters has this function in |
434 `terminal-composition-function-table'." | 439 `terminal-composition-function-table'." |
439 (setq pos (1+ pos)) | 444 (setq pos (1+ pos)) |
440 (while (and (< pos (point-max)) | 445 (while (and (< pos (point-max)) |
441 (= (aref char-width-table (char-after pos)) 0)) | 446 (= (aref char-width-table (char-after pos)) 0)) |
442 (setq pos (1+ pos))) | 447 (setq pos (1+ pos))) |
443 (if (and (>= from (point-min)) | 448 (if (and (>= from (point-min)) |
444 (= (aref (symbol-name (get-char-code-property (char-after from) | 449 (= (aref (symbol-name (get-char-code-property |
445 'general-category)) | 450 (char-after from) |
446 0) | 451 'general-category)) 0) ?L)) |
447 ?L)) | |
448 (compose-region from pos (buffer-substring from pos)) | 452 (compose-region from pos (buffer-substring from pos)) |
449 (compose-region (1+ from) pos | 453 (compose-region (1+ from) pos |
450 (concat " " (buffer-substring (1+ from) pos)))) | 454 (concat " " (buffer-substring (1+ from) pos)) |
455 'terminal-composition-modification)) | |
451 pos))) | 456 pos))) |
452 | 457 |
453 (defvar terminal-composition-function-table | 458 (defvar terminal-composition-function-table |
454 (let ((table (make-char-table nil))) | 459 (let ((table (make-char-table nil))) |
455 (map-char-table | 460 (map-char-table |