[uim-commit] r2682 - trunk/emacs
ekato at freedesktop.org
ekato at freedesktop.org
Wed Dec 21 20:31:34 PST 2005
Author: ekato
Date: 2005-12-21 20:31:29 -0800 (Wed, 21 Dec 2005)
New Revision: 2682
Modified:
trunk/emacs/uim-el-agent.c
trunk/emacs/uim-el-agent.h
trunk/emacs/uim-var.el
trunk/emacs/uim.el
Log:
2005-12-20 Konosuke Watanabe
* Sync uim-el 0.0.6-beta4 (bug #5284).
* emacs/uim-el-agent.c (cmd_label) : New.
(check_prop) : Rename to check_prop_list_label().
(check_prop_list_label) : Renamed from check_prop().
(process_command) : Handle "LABEL".
* emacs/uim-el-agent.h : Remove check_prop().
* emacs/uim-var.el : Update version.
(uim-send-recv-again) : New.
* emacs/uim.el (uim-update-im-label) : New.
(uim-process-agent-output) : Update IM label again at the end.
Modified: trunk/emacs/uim-el-agent.c
===================================================================
--- trunk/emacs/uim-el-agent.c 2005-12-21 06:03:05 UTC (rev 2681)
+++ trunk/emacs/uim-el-agent.c 2005-12-22 04:31:29 UTC (rev 2682)
@@ -247,6 +247,20 @@
static int
+cmd_label(int context_id)
+{
+
+ if (current == NULL)
+ return -1;
+ else
+ output_prop_list(current->prop, current->im);
+
+ return 1;
+}
+
+
+
+static int
cmd_error(void)
{
return -1;
@@ -264,7 +278,7 @@
static void
-check_prop(void)
+check_prop_list_label(void)
{
if (current == NULL) return;
@@ -325,10 +339,12 @@
ret = cmd_getenc(opt); /* for debug */
else if (strcmp(cmd, "PROP") == 0)
ret = cmd_prop(cid, opt);
+ else if (strcmp(cmd, "LABEL") == 0)
+ ret = cmd_label(cid);
else
ret = cmd_error();
- check_prop();
+ check_prop_list_label();
check_default_engine();
@@ -477,8 +493,9 @@
if (ukey.key >= 0) {
/* key input is received by requested context */
ret = uim_press_key(current->context, ukey.key, ukey.mod);
- uim_release_key(current->context , ukey.key, ukey.mod);
+ uim_release_key(current->context, ukey.key, ukey.mod);
+
if (ret > 0) {
/* uim did not process the key */
@@ -528,7 +545,7 @@
a_printf(" ( n ) ");
}
- check_prop();
+ check_prop_list_label();
check_default_engine();
Modified: trunk/emacs/uim-el-agent.h
===================================================================
--- trunk/emacs/uim-el-agent.h 2005-12-21 06:03:05 UTC (rev 2681)
+++ trunk/emacs/uim-el-agent.h 2005-12-22 04:31:29 UTC (rev 2682)
@@ -62,7 +62,6 @@
static int cmd_prop(int context_id, const char *prop);
static int cmd_error(void);
-static void check_prop(void);
static void check_default_engine(void);
static int process_command(int serial, int cid, char *cmd);
Modified: trunk/emacs/uim-var.el
===================================================================
--- trunk/emacs/uim-var.el 2005-12-21 06:03:05 UTC (rev 2681)
+++ trunk/emacs/uim-var.el 2005-12-22 04:31:29 UTC (rev 2682)
@@ -34,7 +34,7 @@
;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
-(defconst uim-el-version "0.0.6-beta3")
+(defconst uim-el-version "0.0.6-beta4")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -232,6 +232,8 @@
;; hook called after reset key map
(defvar uim-reset-keymap-hook nil)
+(defvar uim-send-recv-again nil)
+
(defvar uim-last-key-vector nil
"Recent key vector.")
Modified: trunk/emacs/uim.el
===================================================================
--- trunk/emacs/uim.el 2005-12-21 06:03:05 UTC (rev 2681)
+++ trunk/emacs/uim.el 2005-12-22 04:31:29 UTC (rev 2682)
@@ -278,6 +278,13 @@
;;
+;; Update IM label
+;;
+(defun uim-update-im-label ()
+ (uim-do-send-recv-cmd (format "%d LABEL" uim-context-id)))
+
+
+;;
;; Overwrite properties of current context
;;
(defun uim-prop-activate (proplist)
@@ -1167,6 +1174,12 @@
(when (or uim-preedit-displayed uim-candidate-displayed)
(goto-char uim-preedit-cursor))
+ (if (not uim-send-recv-again)
+ (when label
+ (setq uim-send-recv-again t)
+ (uim-update-im-label))
+ (setq uim-send-recv-again nil))
+
))
More information about the uim-commit
mailing list