diff options
| author | Kenichi Handa | 2008-06-26 04:17:19 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-06-26 04:17:19 +0000 |
| commit | 3617b1eb8da69a836148741cd35a7d8ec59191af (patch) | |
| tree | 8889d2bbc8aac3c059979fb8df41d38f33d4b532 | |
| parent | e889393b2e5594a11a55147bb99ef1d0cc3c91f6 (diff) | |
| download | emacs-3617b1eb8da69a836148741cd35a7d8ec59191af.tar.gz emacs-3617b1eb8da69a836148741cd35a7d8ec59191af.zip | |
(terminal-composition-base-character-p): New
funciton.
(terminal-composition-function): Use
terminal-composition-base-character-p. Include the base character
in the composition.
(auto-compose-chars): Don't check font-object for terminal
display.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/composite.el | 20 |
2 files changed, 24 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76728eca4b8..0dcebf8ca69 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2008-06-26 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * composite.el (terminal-composition-base-character-p): New | ||
| 4 | funciton. | ||
| 5 | (terminal-composition-function): Use | ||
| 6 | terminal-composition-base-character-p. Include the base character | ||
| 7 | in the composition. | ||
| 8 | (auto-compose-chars): Don't check font-object for terminal | ||
| 9 | display. | ||
| 10 | |||
| 1 | 2008-06-26 Glenn Morris <rgm@gnu.org> | 11 | 2008-06-26 Glenn Morris <rgm@gnu.org> |
| 2 | 12 | ||
| 3 | * calendar/calendar.el (calendar-date-echo-text): Doc fix. | 13 | * calendar/calendar.el (calendar-date-echo-text): Doc fix. |
diff --git a/lisp/composite.el b/lisp/composite.el index 3106f726ed5..0d4912be747 100644 --- a/lisp/composite.el +++ b/lisp/composite.el | |||
| @@ -436,26 +436,32 @@ See also the documentation of `auto-composition-mode'.") | |||
| 436 | 436 | ||
| 437 | (put 'save-buffer-state 'lisp-indent-function 1) | 437 | (put 'save-buffer-state 'lisp-indent-function 1) |
| 438 | 438 | ||
| 439 | (defsubst terminal-composition-base-character-p (ch) | ||
| 440 | (not (memq (get-char-code-property ch 'general-category) | ||
| 441 | '(Mn Mc Me Zs Zl Zp Cc Cf Cs)))) | ||
| 442 | |||
| 439 | (defun terminal-composition-function (from to font-object string) | 443 | (defun terminal-composition-function (from to font-object string) |
| 440 | "General composition function used on terminal. | 444 | "General composition function used on terminal. |
| 441 | Non-spacing characters are composed with the preceding spacing | 445 | Non-spacing characters are composed with the preceding spacing |
| 442 | character. All non-spacing characters has this function in | 446 | character. All non-spacing characters has this function in |
| 443 | `terminal-composition-function-table'." | 447 | `terminal-composition-function-table'." |
| 444 | (let ((pos (1+ from))) | 448 | (let ((pos from)) |
| 445 | (if string | 449 | (if string |
| 446 | (progn | 450 | (progn |
| 447 | (while (and (< pos to) | 451 | (while (and (< pos to) |
| 448 | (= (aref char-width-table (aref string pos)) 0)) | 452 | (= (aref char-width-table (aref string pos)) 0)) |
| 449 | (setq pos (1+ pos))) | 453 | (setq pos (1+ pos))) |
| 450 | (if (> from 0) | 454 | (if (and (> from 0) |
| 455 | (terminal-composition-base-character-p (aref string (1- from)))) | ||
| 451 | (compose-string string (1- from) pos) | 456 | (compose-string string (1- from) pos) |
| 452 | (compose-string string from pos | 457 | (compose-string string from pos |
| 453 | (concat " " (buffer-substring from pos))))) | 458 | (concat " " (buffer-substring from pos))))) |
| 454 | (while (and (< pos to) | 459 | (while (and (< pos to) |
| 455 | (= (aref char-width-table (char-after pos)) 0)) | 460 | (= (aref char-width-table (char-after pos)) 0)) |
| 456 | (setq pos (1+ pos))) | 461 | (setq pos (1+ pos))) |
| 457 | (if (> from (point-min)) | 462 | (if (and (> from (point-min)) |
| 458 | (compose-region (1- from) pos (buffer-substring from pos)) | 463 | (terminal-composition-base-character-p (char-after pos))) |
| 464 | (compose-region (1- from) pos) | ||
| 459 | (compose-region from pos | 465 | (compose-region from pos |
| 460 | (concat " " (buffer-substring from pos))))) | 466 | (concat " " (buffer-substring from pos))))) |
| 461 | pos)) | 467 | pos)) |
| @@ -496,7 +502,8 @@ This function is the default value of `auto-composition-function' (which see)." | |||
| 496 | (elt (aref table ch)) | 502 | (elt (aref table ch)) |
| 497 | font-obj newpos) | 503 | font-obj newpos) |
| 498 | (when (and elt | 504 | (when (and elt |
| 499 | (setq font-obj (font-at from window string))) | 505 | (or (not (display-graphic-p)) |
| 506 | (setq font-obj (font-at from window string)))) | ||
| 500 | (if (functionp elt) | 507 | (if (functionp elt) |
| 501 | (setq newpos (funcall elt from to font-obj string)) | 508 | (setq newpos (funcall elt from to font-obj string)) |
| 502 | (while (and elt | 509 | (while (and elt |
| @@ -517,7 +524,8 @@ This function is the default value of `auto-composition-function' (which see)." | |||
| 517 | (elt (aref table ch)) | 524 | (elt (aref table ch)) |
| 518 | func pattern font-obj newpos) | 525 | func pattern font-obj newpos) |
| 519 | (when (and elt | 526 | (when (and elt |
| 520 | (setq font-obj (font-at from window))) | 527 | (or (not (display-graphic-p)) |
| 528 | (setq font-obj (font-at from window)))) | ||
| 521 | (if (functionp elt) | 529 | (if (functionp elt) |
| 522 | (setq newpos (funcall elt from to font-obj nil)) | 530 | (setq newpos (funcall elt from to font-obj nil)) |
| 523 | (goto-char from) | 531 | (goto-char from) |