branch: externals/xelb
commit bddad0ed2e4fe01a35b8bab06a4bf69bc6c32465
Author: Chris Feng <[email protected]>
Commit: Chris Feng <[email protected]>
Eliminate compile warnings for Emacs 24
* el_client.el: Require eieio and xcb-types; do not use the forth
argument to `libxml-parse-xml-region'.
* xcb-types.el: Backport `cl--slot-descriptor-initform'.
---
el_client.el | 9 ++++++++-
xcb-types.el | 4 ++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/el_client.el b/el_client.el
index 06ca496..cdeb82d 100644
--- a/el_client.el
+++ b/el_client.el
@@ -41,8 +41,12 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
+(require 'eieio)
(require 'pp)
+;; Only used to eliminate compile warnings when distributed.
+(require 'xcb-types nil t)
+
;;;; Variables
(defconst xelb-excluded-replies<25 '(xcb:xkb:GetKbdByName~reply)
@@ -186,7 +190,10 @@ an `xelb-auto-padding' attribute."
result header)
(with-temp-buffer
(insert-file-contents file)
- (setq result (libxml-parse-xml-region (point-min) (point-max) nil t))
+ (setq result (libxml-parse-xml-region (point-min) (point-max)))
+ (unless (eq 'xcb (xelb-node-name result))
+ ;; There's an extra comment.
+ (setq result (xelb-node-subnode result)))
(cl-assert (eq 'xcb (xelb-node-name result)))
(setq header (xelb-node-attr result 'header))
(unless (string= header "xproto")
diff --git a/xcb-types.el b/xcb-types.el
index 421cee5..8d4e9a2 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -91,6 +91,10 @@
(unless (fboundp 'eieio-slot-descriptor-name)
(defsubst eieio-slot-descriptor-name (slot) (aref slot 0))))
+(eval-and-compile
+ (unless (fboundp 'cl--slot-descriptor-initform)
+ (defsubst cl--slot-descriptor-initform (slot) (aref slot 1))))
+
(eval-when-compile
(unless (fboundp 'cl--slot-descriptor-type)
(defsubst cl--slot-descriptor-type (slot) (aref slot 2))))