diff options
| author | Kenichi Handa | 2010-01-14 12:44:36 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2010-01-14 12:44:36 +0900 |
| commit | d9a7c14092befb75995e75dc66d050af514443e6 (patch) | |
| tree | 08ac48393db87e623233cf089ef0f72474ae4fea /src | |
| parent | d1bf28dc12ef1a0f3cecbf78f38795db27b38574 (diff) | |
| download | emacs-d9a7c14092befb75995e75dc66d050af514443e6.tar.gz emacs-d9a7c14092befb75995e75dc66d050af514443e6.zip | |
Make auto-composition work on all buffers even if they are fundamental mode.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/composite.c | 12 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6e3fc4ff1c5..1b382cb5a53 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2010-01-14 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | Make auto-composition work on all buffers even if they are | ||
| 4 | fundamental mode. | ||
| 5 | |||
| 6 | * composite.c (Vauto_composition_mode): New variable. | ||
| 7 | (composition_compute_stop_pos): Check Vauto_composition_mode | ||
| 8 | instead of Vauto_composition_function. | ||
| 9 | (composition_adjust_point, Ffind_composition_internal): Likewise. | ||
| 10 | (syms_of_composite): Declare Lisp variable | ||
| 11 | "auto-composition-mode" here. | ||
| 12 | |||
| 1 | 2010-01-13 Kenichi Handa <handa@m17n.org> | 13 | 2010-01-13 Kenichi Handa <handa@m17n.org> |
| 2 | 14 | ||
| 3 | Display buffer name, etc. in mode line by composing correctly. | 15 | Display buffer name, etc. in mode line by composing correctly. |
diff --git a/src/composite.c b/src/composite.c index edebf1e3136..3c2bf409eed 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -157,6 +157,7 @@ Lisp_Object composition_hash_table; | |||
| 157 | Lisp_Object Vcompose_chars_after_function; | 157 | Lisp_Object Vcompose_chars_after_function; |
| 158 | 158 | ||
| 159 | Lisp_Object Qauto_composed; | 159 | Lisp_Object Qauto_composed; |
| 160 | Lisp_Object Vauto_composition_mode; | ||
| 160 | Lisp_Object Vauto_composition_function; | 161 | Lisp_Object Vauto_composition_function; |
| 161 | Lisp_Object Qauto_composition_function; | 162 | Lisp_Object Qauto_composition_function; |
| 162 | Lisp_Object Vcomposition_function_table; | 163 | Lisp_Object Vcomposition_function_table; |
| @@ -1039,7 +1040,7 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string) | |||
| 1039 | if (NILP (string) && PT > charpos && PT < endpos) | 1040 | if (NILP (string) && PT > charpos && PT < endpos) |
| 1040 | cmp_it->stop_pos = PT; | 1041 | cmp_it->stop_pos = PT; |
| 1041 | if (NILP (current_buffer->enable_multibyte_characters) | 1042 | if (NILP (current_buffer->enable_multibyte_characters) |
| 1042 | || ! FUNCTIONP (Vauto_composition_function)) | 1043 | || NILP (Vauto_composition_mode)) |
| 1043 | return; | 1044 | return; |
| 1044 | if (bytepos < 0) | 1045 | if (bytepos < 0) |
| 1045 | { | 1046 | { |
| @@ -1478,7 +1479,7 @@ composition_adjust_point (last_pt, new_pt) | |||
| 1478 | } | 1479 | } |
| 1479 | 1480 | ||
| 1480 | if (NILP (current_buffer->enable_multibyte_characters) | 1481 | if (NILP (current_buffer->enable_multibyte_characters) |
| 1481 | || ! FUNCTIONP (Vauto_composition_function)) | 1482 | || NILP (Vauto_composition_mode)) |
| 1482 | return new_pt; | 1483 | return new_pt; |
| 1483 | 1484 | ||
| 1484 | /* Next check the automatic composition. */ | 1485 | /* Next check the automatic composition. */ |
| @@ -1661,7 +1662,7 @@ See `find-composition' for more details. */) | |||
| 1661 | if (!find_composition (from, to, &start, &end, &prop, string)) | 1662 | if (!find_composition (from, to, &start, &end, &prop, string)) |
| 1662 | { | 1663 | { |
| 1663 | if (!NILP (current_buffer->enable_multibyte_characters) | 1664 | if (!NILP (current_buffer->enable_multibyte_characters) |
| 1664 | && FUNCTIONP (Vauto_composition_function) | 1665 | && ! NILP (Vauto_composition_mode) |
| 1665 | && find_automatic_composition (from, to, &start, &end, &gstring, | 1666 | && find_automatic_composition (from, to, &start, &end, &gstring, |
| 1666 | string)) | 1667 | string)) |
| 1667 | return list3 (make_number (start), make_number (end), gstring); | 1668 | return list3 (make_number (start), make_number (end), gstring); |
| @@ -1788,6 +1789,11 @@ The default value is the function `compose-chars-after'. */); | |||
| 1788 | Qauto_composition_function = intern_c_string ("auto-composition-function"); | 1789 | Qauto_composition_function = intern_c_string ("auto-composition-function"); |
| 1789 | staticpro (&Qauto_composition_function); | 1790 | staticpro (&Qauto_composition_function); |
| 1790 | 1791 | ||
| 1792 | DEFVAR_LISP ("auto-composition-mode", &Vauto_composition_mode, | ||
| 1793 | doc: /* Non-nil if Auto-Composition mode is enabled. | ||
| 1794 | Use the command `auto-composition-mode' to change this variable. */); | ||
| 1795 | Vauto_composition_mode = Qt; | ||
| 1796 | |||
| 1791 | DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function, | 1797 | DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function, |
| 1792 | doc: /* Function to call to compose characters automatically. | 1798 | doc: /* Function to call to compose characters automatically. |
| 1793 | This function is called from the display routine with four arguments: | 1799 | This function is called from the display routine with four arguments: |