diff options
author | Kenichi Handa <handa@m17n.org> | 2010-01-14 12:44:36 +0900 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2010-01-14 12:44:36 +0900 |
commit | d9a7c14092befb75995e75dc66d050af514443e6 (patch) | |
tree | 08ac48393db87e623233cf089ef0f72474ae4fea /src/composite.c | |
parent | d1bf28dc12ef1a0f3cecbf78f38795db27b38574 (diff) | |
download | emacs-d9a7c14092befb75995e75dc66d050af514443e6.tar.gz |
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; Lisp_Object Vcompose_chars_after_function; Lisp_Object Qauto_composed; +Lisp_Object Vauto_composition_mode; Lisp_Object Vauto_composition_function; Lisp_Object Qauto_composition_function; Lisp_Object Vcomposition_function_table; @@ -1039,7 +1040,7 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string) if (NILP (string) && PT > charpos && PT < endpos) cmp_it->stop_pos = PT; if (NILP (current_buffer->enable_multibyte_characters) - || ! FUNCTIONP (Vauto_composition_function)) + || NILP (Vauto_composition_mode)) return; if (bytepos < 0) { @@ -1478,7 +1479,7 @@ composition_adjust_point (last_pt, new_pt) } if (NILP (current_buffer->enable_multibyte_characters) - || ! FUNCTIONP (Vauto_composition_function)) + || NILP (Vauto_composition_mode)) return new_pt; /* Next check the automatic composition. */ @@ -1661,7 +1662,7 @@ See `find-composition' for more details. */) if (!find_composition (from, to, &start, &end, &prop, string)) { if (!NILP (current_buffer->enable_multibyte_characters) - && FUNCTIONP (Vauto_composition_function) + && ! NILP (Vauto_composition_mode) && find_automatic_composition (from, to, &start, &end, &gstring, string)) return list3 (make_number (start), make_number (end), gstring); @@ -1788,6 +1789,11 @@ The default value is the function `compose-chars-after'. */); Qauto_composition_function = intern_c_string ("auto-composition-function"); staticpro (&Qauto_composition_function); + DEFVAR_LISP ("auto-composition-mode", &Vauto_composition_mode, + doc: /* Non-nil if Auto-Composition mode is enabled. +Use the command `auto-composition-mode' to change this variable. */); + Vauto_composition_mode = Qt; + DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function, doc: /* Function to call to compose characters automatically. This function is called from the display routine with four arguments: |