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/composite.c | |
| 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/composite.c')
| -rw-r--r-- | src/composite.c | 12 |
1 files changed, 9 insertions, 3 deletions
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: |