aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-11-29 22:35:11 +0000
committerRichard M. Stallman2007-11-29 22:35:11 +0000
commit023df4cfe39ec4ee699e882c3a2219ce9da5807d (patch)
tree36422b401b537acfef6cd1edd22d2e4879c1282a
parentce1b7801e1320250c9bde1e2ace1db6ccd352179 (diff)
downloademacs-023df4cfe39ec4ee699e882c3a2219ce9da5807d.tar.gz
emacs-023df4cfe39ec4ee699e882c3a2219ce9da5807d.zip
(toggle-input-method-active): New var.
(toggle-input-method): Bind toggle-input-method-active to t. Error if it was already non-nil.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/international/mule-cmds.el8
2 files changed, 13 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3576d72bf1a..e94db35386c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12007-11-29 Richard Stallman <rms@gnu.org>
2
3 * international/mule-cmds.el (toggle-input-method-active): New var.
4 (toggle-input-method): Bind toggle-input-method-active to t.
5 Error if it was already non-nil.
6
12007-11-29 Glenn Morris <rgm@gnu.org> 72007-11-29 Glenn Morris <rgm@gnu.org>
2 8
3 * calendar/time-date.el (with-decoded-time-value): Doc fix. 9 * calendar/time-date.el (with-decoded-time-value): Doc fix.
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 6dd1bf07213..19663f594b9 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1492,6 +1492,9 @@ To deactivate it programmatically, use `inactivate-input-method'."
1492 (customize-mark-as-set 'default-input-method)) 1492 (customize-mark-as-set 'default-input-method))
1493 default-input-method) 1493 default-input-method)
1494 1494
1495(defvar toggle-input-method-active nil
1496 "Non-nil inside `toggle-input-method'.")
1497
1495(defun toggle-input-method (&optional arg interactive) 1498(defun toggle-input-method (&optional arg interactive)
1496 "Enable or disable multilingual text input method for the current buffer. 1499 "Enable or disable multilingual text input method for the current buffer.
1497Only one input method can be enabled at any time in a given buffer. 1500Only one input method can be enabled at any time in a given buffer.
@@ -1511,9 +1514,12 @@ When called interactively, the optional arg INTERACTIVE is non-nil,
1511which marks the variable `default-input-method' as set for Custom buffers." 1514which marks the variable `default-input-method' as set for Custom buffers."
1512 1515
1513 (interactive "P\np") 1516 (interactive "P\np")
1517 (if toggle-input-method-active
1518 (error "Recursive use of `toggle-input-method'"))
1514 (if (and current-input-method (not arg)) 1519 (if (and current-input-method (not arg))
1515 (inactivate-input-method) 1520 (inactivate-input-method)
1516 (let ((default (or (car input-method-history) default-input-method))) 1521 (let ((toggle-input-method-active t)
1522 (default (or (car input-method-history) default-input-method)))
1517 (if (and arg default (equal current-input-method default) 1523 (if (and arg default (equal current-input-method default)
1518 (> (length input-method-history) 1)) 1524 (> (length input-method-history) 1))
1519 (setq default (nth 1 input-method-history))) 1525 (setq default (nth 1 input-method-history)))