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 /lisp | |
| 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 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/composite.el | 42 |
2 files changed, 31 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3c95811a8fc..72e25487320 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2010-01-14 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * composite.el (auto-composition-mode): Make it a buffer local | ||
| 4 | variable (permanent-local). | ||
| 5 | (auto-composition-function): Set the default value to | ||
| 6 | auto-compose-chars. | ||
| 7 | (auto-composition-mode): Make it a simple function, not a minor | ||
| 8 | mode. | ||
| 9 | (global-auto-composition-mode): Likewise. | ||
| 10 | (turn-on-auto-composition-if-enabled): Delete it. | ||
| 11 | |||
| 1 | 2010-01-12 Michael Albinus <michael.albinus@gmx.de> | 12 | 2010-01-12 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 13 | ||
| 3 | * files.el (copy-directory): Compute target for recursive | 14 | * files.el (copy-directory): Compute target for recursive |
diff --git a/lisp/composite.el b/lisp/composite.el index ce7ea95800b..4e91945b1b6 100644 --- a/lisp/composite.el +++ b/lisp/composite.el | |||
| @@ -744,10 +744,14 @@ This function is the default value of `auto-composition-function' (which see)." | |||
| 744 | (setq func 'compose-gstring-for-terminal)) | 744 | (setq func 'compose-gstring-for-terminal)) |
| 745 | (funcall func gstring)))) | 745 | (funcall func gstring)))) |
| 746 | 746 | ||
| 747 | (make-variable-buffer-local 'auto-composition-mode) | ||
| 748 | (put 'auto-composition-mode 'permanent-local t) | ||
| 749 | |||
| 747 | (make-variable-buffer-local 'auto-composition-function) | 750 | (make-variable-buffer-local 'auto-composition-function) |
| 751 | (setq-default auto-composition-function 'auto-compose-chars) | ||
| 748 | 752 | ||
| 749 | ;;;###autoload | 753 | ;;;###autoload |
| 750 | (define-minor-mode auto-composition-mode | 754 | (defun auto-composition-mode (&optional arg) |
| 751 | "Toggle Auto Composition mode. | 755 | "Toggle Auto Composition mode. |
| 752 | With ARG, turn Auto Composition mode off if and only if ARG is a non-positive | 756 | With ARG, turn Auto Composition mode off if and only if ARG is a non-positive |
| 753 | number; if ARG is nil, toggle Auto Composition mode; anything else turns Auto | 757 | number; if ARG is nil, toggle Auto Composition mode; anything else turns Auto |
| @@ -758,29 +762,23 @@ by functions registered in `composition-function-table' (which see). | |||
| 758 | 762 | ||
| 759 | You can use `global-auto-composition-mode' to turn on | 763 | You can use `global-auto-composition-mode' to turn on |
| 760 | Auto Composition mode in all buffers (this is the default)." | 764 | Auto Composition mode in all buffers (this is the default)." |
| 761 | nil nil nil | 765 | (interactive "P") |
| 762 | (if noninteractive | 766 | (setq auto-composition-mode |
| 763 | (setq auto-composition-mode nil)) | 767 | (if arg |
| 764 | (cond (auto-composition-mode | 768 | (or (not (integerp arg)) (> arg 0)) |
| 765 | (setq auto-composition-function 'auto-compose-chars)) | 769 | (not auto-composition-mode)))) |
| 766 | (t | ||
| 767 | (setq auto-composition-function nil)))) | ||
| 768 | |||
| 769 | (defun turn-on-auto-composition-if-enabled () | ||
| 770 | (if enable-multibyte-characters | ||
| 771 | (auto-composition-mode 1))) | ||
| 772 | 770 | ||
| 773 | ;;;###autoload | 771 | ;;;###autoload |
| 774 | (define-global-minor-mode global-auto-composition-mode | 772 | (defun global-auto-composition-mode (&optional arg) |
| 775 | auto-composition-mode turn-on-auto-composition-if-enabled | 773 | "Toggle Auto-Composition mode in every possible buffer. |
| 776 | ;; This :extra-args' appears to be the result of a naive copy&paste | 774 | With prefix arg, turn Global-Auto-Composition mode on if and only if arg |
| 777 | ;; from global-font-lock-mode. | 775 | is positive. |
| 778 | ;; :extra-args (dummy) | 776 | See `auto-composition-mode' for more information on Auto-Composition mode." |
| 779 | :initialize 'custom-initialize-delay | 777 | (interactive "P") |
| 780 | :init-value (not noninteractive) | 778 | (setq-default auto-composition-mode |
| 781 | :group 'auto-composition | 779 | (if arg |
| 782 | :version "23.1") | 780 | (or (not (integerp arg)) (> arg 0)) |
| 783 | 781 | (not (default-value 'auto-composition-mode))))) | |
| 784 | (defalias 'toggle-auto-composition 'auto-composition-mode) | 782 | (defalias 'toggle-auto-composition 'auto-composition-mode) |
| 785 | 783 | ||
| 786 | 784 | ||