Mercurial > emacs
diff lisp/composite.el @ 107617:c5f9e4613394
Merge from mainline.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 16 Jan 2010 06:57:09 -0500 |
parents | 0d5d2e53a07c |
children | 823c35a2846d 80012eb6c2a3 |
line wrap: on
line diff
--- a/lisp/composite.el Sat Jan 09 11:27:11 2010 -0500 +++ b/lisp/composite.el Sat Jan 16 06:57:09 2010 -0500 @@ -1,7 +1,7 @@ ;;; composite.el --- support character composition ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009 +;; 2008, 2009, 2010 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 @@ -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)