Mercurial > emacs
comparison lisp/international/mule-cmds.el @ 87098:ec0ef12211d9
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-943
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 06 Dec 2007 00:46:18 +0000 |
parents | 2cce56fd7361 42b98dfc31f6 |
children | f322e8d4c5e3 53108e6cea98 |
comparison
equal
deleted
inserted
replaced
87097:781256628613 | 87098:ec0ef12211d9 |
---|---|
1490 (setq default-input-method input-method) | 1490 (setq default-input-method input-method) |
1491 (when interactive | 1491 (when interactive |
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. |
1497 Only one input method can be enabled at any time in a given buffer. | 1500 Only one input method can be enabled at any time in a given buffer. |
1498 | 1501 |
1499 The normal action is to enable an input method if none was | 1502 The normal action is to enable an input method if none was |
1509 | 1512 |
1510 When called interactively, the optional arg INTERACTIVE is non-nil, | 1513 When called interactively, the optional arg INTERACTIVE is non-nil, |
1511 which marks the variable `default-input-method' as set for Custom buffers." | 1514 which 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))) |
1520 (activate-input-method | 1526 (activate-input-method |
1521 (if (or arg (not default)) | 1527 (if (or arg (not default)) |