summaryrefslogtreecommitdiff
path: root/editors/tamago/files/patch-egg.el
blob: ad417ebeec3ff7a1790191b87033449067c508fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- egg.el.orig	2015-01-31 19:24:09.000000000 +0900
+++ egg.el	2015-01-31 19:48:25.000000000 +0900
@@ -167,16 +167,22 @@
 	  (setq egg-modefull-mode t)
 	  (its-define-select-keys egg-modefull-map))
       (setq egg-modeless-mode t))
-    (setq inactivate-current-input-method-function 'egg-mode)
+    (set (if (boundp 'deactivate-current-input-method-function)
+	     'deactivate-current-input-method-function
+	   'inactivate-current-input-method-function)
+	 'egg-mode)
     (setq describe-current-input-method-function 'egg-help)
-    (make-local-hook 'input-method-activate-hook)
+    (if (fboundp 'make-local-hook)
+      (eval '(make-local-hook 'input-method-activate-hook)))
     (add-hook 'input-method-activate-hook 'its-set-mode-line-title nil t)
     (if (eq (selected-window) (minibuffer-window))
 	(add-hook 'minibuffer-exit-hook 'egg-exit-from-minibuffer))
     (run-hooks 'egg-mode-hook)))
 
 (defun egg-exit-from-minibuffer ()
-  (inactivate-input-method)
+  (if (boundp 'deactivate-input-method)
+      (deactivate-input-method)
+    (inactivate-input-method))
   (if (<= (minibuffer-depth) 1)
       (remove-hook 'minibuffer-exit-hook 'egg-exit-from-minibuffer)))
 
@@ -184,7 +190,10 @@
 
 (defun egg-self-insert-char ()
   (interactive)
-  (its-start last-command-char (and (eq last-command 'egg-use-context)
+  (its-start (if (boundp 'last-command-event)
+		 last-command-event
+	       last-command-char)
+	     (and (eq last-command 'egg-use-context)
 				    egg-context)))
 
 (defun egg-remove-all-text-properties (from to &optional object)