emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pyim 2366e18: * pyim-common.el (pyim-add-unread-command


From: ELPA Syncer
Subject: [elpa] externals/pyim 2366e18: * pyim-common.el (pyim-add-unread-command-events): Ugly fix #402 again.
Date: Sun, 4 Jul 2021 08:57:16 -0400 (EDT)

branch: externals/pyim
commit 2366e180d3dc63752a27ae480582b44019909728
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    * pyim-common.el (pyim-add-unread-command-events): Ugly fix #402 again.
---
 pyim-common.el | 44 +++++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/pyim-common.el b/pyim-common.el
index 5b04450..cfc18b2 100644
--- a/pyim-common.el
+++ b/pyim-common.el
@@ -181,27 +181,29 @@ duplicates.  When RESET is non-nil, the events in
 `unread-command-events' are first discarded.
 
 This function is a fork of `quail-add-unread-command-events'."
-  (when reset
-    (setq unread-command-events nil))
-  (setq unread-command-events
-        (if (characterp key)
-            (cons
-             (if window-system
-                 (cons 'no-record key)
-               ;; FIXME: When user use Xshell or MobaXTerm, error "<no-record>
-               ;; is undefined" will be exist, this may be not a pyim's bug.
-               ;; but I do not know how to solve this problem, so I do this 
ugly
-               ;; hack, and wait others help ...
-               ;; 1. https://github.com/tumashu/pyim/issues/402
-               ;; 2. 
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=bd5c7404195e45f11946b4e0933a1f8b697d8b87
-               key)
-             unread-command-events)
-          (append (mapcan (lambda (e)
-                            (list (if window-system
-                                      (cons 'no-record e)
-                                    e)))
-                          (append key nil))
-                  unread-command-events))))
+  (let ((ssh-run-p (or (getenv "SSH_CLIENT")
+                       (getenv "SSH_TTY"))))
+    (when reset
+      (setq unread-command-events nil))
+    (setq unread-command-events
+          (if (characterp key)
+              (cons
+               (if ssh-run-p
+                   ;; FIXME: When user use Xshell or MobaXTerm, error 
"<no-record>
+                   ;; is undefined" will be exist, this may be not a pyim's 
bug.
+                   ;; but I do not know how to solve this problem, so I do 
this ugly
+                   ;; hack, and wait others help ...
+                   ;; 1. https://github.com/tumashu/pyim/issues/402
+                   ;; 2. 
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=bd5c7404195e45f11946b4e0933a1f8b697d8b87x
+                   key
+                 (cons 'no-record key))
+               unread-command-events)
+            (append (mapcan (lambda (e)
+                              (list (if ssh-run-p
+                                        e
+                                      (cons 'no-record e))))
+                            (append key nil))
+                    unread-command-events)))))
 
 ;; * Footer
 (provide 'pyim-common)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]