summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2010-01-14 12:44:36 +0900
committerKenichi Handa <handa@m17n.org>2010-01-14 12:44:36 +0900
commitd9a7c14092befb75995e75dc66d050af514443e6 (patch)
tree08ac48393db87e623233cf089ef0f72474ae4fea /src
parentd1bf28dc12ef1a0f3cecbf78f38795db27b38574 (diff)
downloademacs-d9a7c14092befb75995e75dc66d050af514443e6.tar.gz
Make auto-composition work on all buffers even if they are fundamental mode.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/composite.c12
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 @@
+2010-01-14 Kenichi Handa <handa@m17n.org>
+
+ Make auto-composition work on all buffers even if they are
+ fundamental mode.
+
+ * composite.c (Vauto_composition_mode): New variable.
+ (composition_compute_stop_pos): Check Vauto_composition_mode
+ instead of Vauto_composition_function.
+ (composition_adjust_point, Ffind_composition_internal): Likewise.
+ (syms_of_composite): Declare Lisp variable
+ "auto-composition-mode" here.
+
2010-01-13 Kenichi Handa <handa@m17n.org>
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;
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: