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

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

[elpa] externals/xelb 2eabf87: Minor fixes


From: Chris Feng
Subject: [elpa] externals/xelb 2eabf87: Minor fixes
Date: Sun, 27 Sep 2015 11:42:33 +0000

branch: externals/xelb
commit 2eabf872d0df120fbb208bc723f05b2fb7c4b135
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Minor fixes
    
    * el_client.el:
    * xcb-keysyms.el:
      Use the new syntax for number comparison
    
    * xcb-types.el:
      Fix use of eval-when-compile / eval-and-compile.
---
 el_client.el   |    2 +-
 xcb-keysyms.el |   20 ++++++++++----------
 xcb-types.el   |    9 ++++-----
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/el_client.el b/el_client.el
index 1657b6e..87a83e0 100644
--- a/el_client.el
+++ b/el_client.el
@@ -540,7 +540,7 @@ KeymapNotify event; instead, we handle this case in 
`xcb:unmarshal'."
 (defun xelb-parse-bit (node)
   "Parse <bit>."
   (let ((bit (string-to-number (xelb-node-subnode node))))
-    (cl-assert (and (<= 0 bit) (>= 31 bit)))
+    (cl-assert (<= 0 bit 31))
     (lsh 1 bit)))
 
 (defun xelb-parse-enumref (node)
diff --git a/xcb-keysyms.el b/xcb-keysyms.el
index fbf654a..bb12c9a 100644
--- a/xcb-keysyms.el
+++ b/xcb-keysyms.el
@@ -180,7 +180,7 @@ SHIFT LOCK is ignored."
                            0 2))))
     (if (and xcb:keysyms:num-lock-mask  ;not initialized
              (/= 0 (logand modifiers xcb:keysyms:num-lock-mask))
-             (<= #xff80 (elt group 1)) (>= #xffbe (elt group 1))) ;keypad
+             (<= #xff80 (elt group 1) #xffbe)) ;keypad
         (if (= mask 1) (elt group 0) (elt group 1))
       (pcase mask
         (0 (elt group 0))               ;SHIFT off, CAPS LOCK off
@@ -345,9 +345,9 @@ This function returns nil when it fails to convert an 
event."
                                               xcb:keysyms:-iso-function-keys))
                            ;; ISO function keys
                            (logior keysym #xfe00)))))))
-      (if (and (<= #x20 event) (>= #xff event)) ;Latin-1
+      (if (<= #x20 event #xff)          ;Latin-1
           (setq keysym event)
-        (when (and (<= #x100 event) (>= #x10ffff event)) ;Unicode
+        (when (<= #x100 event #x10ffff) ;Unicode
           (setq keysym (+ #x1000000 event)))))
     (when keysym
       `(,keysym
@@ -371,17 +371,17 @@ This function returns nil when it fails to convert an 
event."
 
 One may use MASK to provide modifier keys.  If ALLOW-MODIFIERS is non-nil,
 this function will also return symbols for pure modifiers keys."
-  (let ((event (cond ((and (<= #x20 keysym) (>= #xff keysym))
+  (let ((event (cond ((<= #x20 keysym #xff)
                       keysym)
-                     ((and (<= #xff00 keysym) (>= #xffff keysym))
+                     ((<= #xff00 keysym #xffff)
                       (aref xcb:keysyms:-function-keys (logand keysym #xff)))
-                     ((and (<= #x1000100 keysym) (>= #x110ffff keysym))
+                     ((<= #x1000100 keysym #x110ffff)
                       (- keysym #x1000000))
-                     ((and (<= 1 keysym) (>= 5 keysym)) ;ButtonPress assuemd
+                     ((<= 1 keysym 5)   ;ButtonPress assuemd
                       (intern-soft (format "down-mouse-%d" keysym)))
-                     ((and (<= #x1008ff00 keysym) (>= #x1008ffff keysym))
+                     ((<= #x1008ff00 keysym #x1008ffff)
                       (aref xcb:keysyms:-xf86-keys (logand keysym #xff)))
-                     ((and (<= #xfe00 keysym) (>= #xfeff keysym))
+                     ((<= #xfe00 keysym #xfeff)
                       (aref xcb:keysyms:-iso-function-keys
                             (logand keysym #xff))))))
     (when (and (not allow-modifiers)
@@ -402,7 +402,7 @@ this function will also return symbols for pure modifiers 
keys."
         (when (and (/= 0 (logand mask xcb:keysyms:shift-mask))
                    ;; Emacs only set shift bit for letters
                    (integerp (car (last event)))
-                   (<= ?A (car (last event))) (>= ?Z (car (last event))))
+                   (<= ?A (car (last event)) ?Z))
           (push 'shift event))
         (when (and xcb:keysyms:hyper-mask
                    (/= 0 (logand mask xcb:keysyms:hyper-mask)))
diff --git a/xcb-types.el b/xcb-types.el
index b6848dc..133a384 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -74,13 +74,11 @@
 
 (eval-and-compile
   (unless (fboundp 'eieio-slot-descriptor-name)
-    (eval-and-compile
-      (defsubst eieio-slot-descriptor-name (slot) (aref slot 0)))))
+    (defsubst eieio-slot-descriptor-name (slot) (aref slot 0))))
 
 (eval-when-compile
   (unless (fboundp 'cl--slot-descriptor-type)
-    (eval-when-compile
-      (defsubst cl--slot-descriptor-type (slot) (aref slot 2)))))
+    (defsubst cl--slot-descriptor-type (slot) (aref slot 2))))
 
 ;;;; Utility functions
 
@@ -245,7 +243,8 @@
   "Return the popcount of integer MASK."
   (apply #'+ (mapcar (lambda (i)
                        (logand (lsh mask i) 1))
-                     (number-sequence -31 0)))) ;32-bit number assumed (CARD32)
+                     ;; 32-bit number assumed (CARD32)
+                     (eval-when-compile (number-sequence -31 0)))))
 
 (defsubst xcb:-request-class->reply-class (request)
   "Return the reply class corresponding to the request class REQUEST."



reply via email to

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