[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xml-rpc e4002b8502 40/64: Really fix struct detection.
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/xml-rpc e4002b8502 40/64: Really fix struct detection. |
Date: |
Fri, 31 Dec 2021 20:11:08 -0500 (EST) |
branch: elpa/xml-rpc
commit e4002b8502686215642919eccd9afa2e8203d590
Author: Michael Alan Dorman <mdorman@ironicdesign.com>
Commit: Michael Alan Dorman <mdorman@ironicdesign.com>
Really fix struct detection.
Commit aa0953b2d4ef1b983bc54357b56af63cab4309b9 claimed to improve
detection of structs, but actually broke xml-rpc's ability to encode
anything other than simple "text" -> "text" maps: anything else, arrays,
dates, nested structs---all of which are perfectly reasonable according
to the xml-rpc standard---would cause `xml-rpc-value-structp` to return
`nil`.
In other words:
(xml-rpc-value-structp '(("bar" . "foo")))
=> t
(xml-rpc-value-structp '(("bar" :datetime (12345 12345))))
=> nil
This change introduces a `xml-rpc-valuep` function that will recognize
any sort of xml-rpc value, and then hooks that in place of the clearly
erroneous `(not (listp (cdr curval)))`.
---
xml-rpc.el | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/xml-rpc.el b/xml-rpc.el
index 984ebe9408..33dc07d933 100644
--- a/xml-rpc.el
+++ b/xml-rpc.el
@@ -252,6 +252,20 @@ Set it higher to get some info in the *Messages* buffer"
"A list of extra headers to send with the next request.
Should be an assoc list of headers/contents. See `url-request-extra-headers'")
+(defsubst xml-rpc-valuep (value)
+ "Return t if VALUE is any sort of xml-rpc structure.
+
+Return nil otherwise."
+ (or (xml-rpc-value-intp value)
+ (xml-rpc-value-doublep value)
+ (xml-rpc-value-stringp value)
+ (xml-rpc-value-structp value)
+ (xml-rpc-value-arrayp value)
+ (xml-rpc-value-vectorp value)
+ (xml-rpc-value-booleanp value)
+ (xml-rpc-value-datetimep value)
+ (xml-rpc-value-base64p value)))
+
;;
;; Value type handling functions
;;
@@ -281,7 +295,7 @@ Should be an assoc list of headers/contents. See
`url-request-extra-headers'")
(setq curval (car-safe vals))
(consp curval)
(stringp (car-safe curval))
- (not (listp (cdr curval)))))
+ (xml-rpc-valuep (cdr curval))))
(setq vals (cdr-safe vals)))
result)))
- [nongnu] elpa/xml-rpc c20aa6359a 29/64: bump version for continued development, (continued)
- [nongnu] elpa/xml-rpc c20aa6359a 29/64: bump version for continued development, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 25c380cab0 28/64: Update release notes, tag 1.6.8, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 3b4ac0ebf2 24/64: update urls, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 4b21d27d35 25/64: Eliminate xemacs compile warning, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 643bbfb5da 30/64: * Apply link from http://rix3.8.je/2009/12/15/emacs%E7%9A%84weblogger1-4-4%E7%9A%84wordpress-patch/, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 79e74a969d 21/64: Some minor housekeeping, bump xml-rpc.el version., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc f862301b46 27/64: connection close! connection close!, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 445fc70355 33/64: point to upstream in comments, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 8f624f8b96 44/64: Merge pull request #8 from larsmagne/master, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 4fd5a03a36 36/64: xml-rpc.el: fix up callbacks for post emacs20!, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc e4002b8502 40/64: Really fix struct detection.,
Stefan Kangas <=
- [nongnu] elpa/xml-rpc 0ab093d601 42/64: Bump version number, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 47007ef094 54/64: Merge pull request #14 from skangas/libxml-parse-xml-region, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc ff1e22959f 50/64: Merge pull request #16 from skangas/byte-compiler-warnings, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc bd359a86b1 47/64: Use libxml-parse-xml-region when available, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 31890fef63 60/64: Remove versions that don't have skip-unless, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc a2cb50528c 57/64: Tidy up a bit; remove code that shouldn't be needed in modern emacs, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc eb50e8b116 62/64: formatting, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc a876849b45 59/64: Merge pull request #18 from skangas/fix-unit-test, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 8020ccd176 64/64: Badge++ and version bump, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc f87fef0844 10/64: Override timezone-parse-date with a version that understands the ISO8601 Basic format. (xml-rpc-value-structp): Struct test should look for consp instead of lists of a certain size. (xml-rpc-value-datetimep): Use :datetime keyword to specify data type and eliminate confusion between time structs and lists. (xml-rpc-xml-list-to-value): Grok <i4> element in addition to <int>. Return dateTime values with :datetime keyword. (xml-rpc-datetime-to-string): New function to format datetime objects. (xml-rpc-value-to-xml-list): Add handling for datetime., Stefan Kangas, 2021/12/31