emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99320: Make auto-composition work on


From: Kenichi Handa
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99320: Make auto-composition work on all buffers even if they are fundamental mode.
Date: Thu, 14 Jan 2010 12:56:00 +0900
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99320 [merge]
committer: Kenichi Handa  <address@hidden>
branch nick: trunk
timestamp: Thu 2010-01-14 12:56:00 +0900
message:
  Make auto-composition work on all buffers even if they are fundamental mode.
modified:
  etc/ChangeLog
  etc/NEWS
  lisp/ChangeLog
  lisp/composite.el
  src/ChangeLog
  src/composite.c
=== modified file 'etc/ChangeLog'
--- a/etc/ChangeLog     2010-01-13 08:35:10 +0000
+++ b/etc/ChangeLog     2010-01-14 03:54:04 +0000
@@ -1,3 +1,7 @@
+2010-01-14  Kenichi Handa  <address@hidden>
+
+       * NEWS: Describe the change of auto-composition-mode.
+
 2010-01-12  Glenn Morris  <address@hidden>
 
        * CONTRIBUTE, NEWS: Use bug-gnu-emacs rather than emacs-pretest-bug

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2010-01-12 05:11:05 +0000
+++ b/etc/NEWS  2010-01-14 03:44:36 +0000
@@ -122,6 +122,11 @@
 ** Function arguments in *Help* buffers are now shown in upper-case.
 Customize `help-downcase-arguments' to t to show them in lower-case.
 
+** Delete Auto Composition Mode.  Now the variable
+`auto-composition-mode' is simply a buffer local variable.  The
+commands `auto-composition-mode' and `global-auto-composition-mode'
+still works as before.
+
 
 * Editing Changes in Emacs 23.2
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-01-13 23:25:01 +0000
+++ b/lisp/ChangeLog    2010-01-14 03:54:04 +0000
@@ -1,3 +1,13 @@
+2010-01-14  Kenichi Handa  <address@hidden>
+
+       * composite.el (auto-composition-mode): Make it a buffer local
+       variable (permanent-local).
+       (auto-composition-function): Set the default value to
+       auto-compose-chars.
+       (auto-composition-mode): Make it a simple function, not a minor
+       mode.
+       (global-auto-composition-mode): Likewise.
+       (turn-on-auto-composition-if-enabled): Delete it.
 2010-01-13  Karl Fogel  <address@hidden>
 
        * bookmark.el (bookmark-bmenu-execute-deletions): Doc fix (Bug#5276).

=== modified file 'lisp/composite.el'
--- a/lisp/composite.el 2010-01-13 08:35:10 +0000
+++ b/lisp/composite.el 2010-01-14 03:54:04 +0000
@@ -744,10 +744,14 @@
          (setq func 'compose-gstring-for-terminal))
       (funcall func gstring))))
 
+(make-variable-buffer-local 'auto-composition-mode)
+(put 'auto-composition-mode 'permanent-local t)
+
 (make-variable-buffer-local 'auto-composition-function)
+(setq-default auto-composition-function 'auto-compose-chars)
 
 ;;;###autoload
-(define-minor-mode auto-composition-mode
+(defun auto-composition-mode (&optional arg)
   "Toggle Auto Composition mode.
 With ARG, turn Auto Composition mode off if and only if ARG is a non-positive
 number; if ARG is nil, toggle Auto Composition mode; anything else turns Auto
@@ -758,29 +762,23 @@
 
 You can use `global-auto-composition-mode' to turn on
 Auto Composition mode in all buffers (this is the default)."
-  nil nil nil
-  (if noninteractive
-      (setq auto-composition-mode nil))
-  (cond (auto-composition-mode
-        (setq auto-composition-function 'auto-compose-chars))
-       (t
-        (setq auto-composition-function nil))))
-
-(defun turn-on-auto-composition-if-enabled ()
-  (if enable-multibyte-characters
-      (auto-composition-mode 1)))
+  (interactive "P")
+  (setq auto-composition-mode
+       (if arg
+           (or (not (integerp arg)) (> arg 0))
+         (not auto-composition-mode))))
 
 ;;;###autoload
-(define-global-minor-mode global-auto-composition-mode
-  auto-composition-mode turn-on-auto-composition-if-enabled
-  ;; This :extra-args' appears to be the result of a naive copy&paste
-  ;; from global-font-lock-mode.
-  ;; :extra-args (dummy)
-  :initialize 'custom-initialize-delay
-  :init-value (not noninteractive)
-  :group 'auto-composition
-  :version "23.1")
-
+(defun global-auto-composition-mode (&optional arg)
+  "Toggle Auto-Composition mode in every possible buffer.
+With prefix arg, turn Global-Auto-Composition mode on if and only if arg
+is positive.
+See `auto-composition-mode' for more information on Auto-Composition mode."
+  (interactive "P")
+  (setq-default auto-composition-mode
+               (if arg
+                   (or (not (integerp arg)) (> arg 0))
+                 (not (default-value 'auto-composition-mode)))))
 (defalias 'toggle-auto-composition 'auto-composition-mode)
 
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-01-13 18:35:36 +0000
+++ b/src/ChangeLog     2010-01-14 03:54:04 +0000
@@ -1,3 +1,15 @@
+2010-01-14  Kenichi Handa  <address@hidden>
+
+       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  Chong Yidong  <address@hidden>
 
        * xterm.c (x_term_init): Avoid garbage-collecting the new terminal

=== modified file 'src/composite.c'
--- a/src/composite.c   2010-01-13 08:35:10 +0000
+++ b/src/composite.c   2010-01-14 03:54:04 +0000
@@ -157,6 +157,7 @@
 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 @@
   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 @@
     }
 
   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 @@
   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 @@
   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:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]