[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 8eb72a2739 25/27: Convert JSON advice for Emacs
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 8eb72a2739 25/27: Convert JSON advice for Emacs 28 to prefixed functions |
Date: |
Sat, 5 Mar 2022 04:57:28 -0500 (EST) |
branch: externals/compat
commit 8eb72a2739bf76aa9ec535627e0f8de63901f7ae
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Convert JSON advice for Emacs 28 to prefixed functions
---
compat-28.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/compat-28.el b/compat-28.el
index 278245aae5..70966389af 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -163,7 +163,7 @@ If COUNT is non-nil and a natural number, the function will
(declare-function json-serialize nil (object &rest args))
(declare-function json-parse-string nil (string &rest args))
-(compat-advise json-serialize (object &rest args)
+(compat-defun json-serialize (object &rest args)
"Handle top-level JSON values."
:cond (condition-case err
;; Use `random' to prevent byte compiler from optimising
@@ -174,13 +174,13 @@ If COUNT is non-nil and a natural number, the function
will
;; have to check if an error was raised that the function
;; was not defined.
(void-function (eq (cadr err) 'json-serialize)))
- :realname compat--json-serialize-handle-tlo
+ :prefix t
:min-version "27"
(if (or (listp object) (vectorp object))
- (apply oldfun object args)
+ (apply #'json-serialize object args)
(substring (json-serialize (list object)) 1 -1)))
-(compat-advise json-insert (object &rest args)
+(compat-defun json-insert (object &rest args)
"Handle top-level JSON values."
:cond (condition-case err
;; Use `random' to prevent byte compiler from optimising
@@ -191,13 +191,13 @@ If COUNT is non-nil and a natural number, the function
will
;; have to check if an error was raised that the function
;; was not defined.
(void-function (eq (cadr err) 'json-serialize)))
- :realname compat--json-insert-handle-tlo
+ :prefix t
:min-version "27"
(if (or (listp object) (vectorp object))
- (apply oldfun object args)
- (insert (apply #'compat--json-serialize-handle-tlo oldfun object args))))
+ (apply #'json-insert object args)
+ (insert (apply #'compat-json-serialize object args))))
-(compat-advise json-parse-string (string &rest args)
+(compat-defun json-parse-string (string &rest args)
"Handle top-level JSON values."
:cond (condition-case err
;; Use `random' to prevent byte compiler from optimising
@@ -208,16 +208,16 @@ If COUNT is non-nil and a natural number, the function
will
;; we have to check if an error was raised that the function
;; was not defined.
(void-function (eq (cadr err) 'json-parse-error)))
- :realname compat--json-parse-string-handle-tlo
+ :prefix t
:min-version "27"
(if (string-match-p "\\`[[:space:]]*[[{]" string)
- (apply oldfun string args)
+ (apply #'json-parse-string string args)
;; Wrap the string in an array, and extract the value back using
;; `elt', to ensure that no matter what the value of `:array-type'
;; is we can access the first element.
- (elt (apply oldfun (concat "[" string "]") args) 0)))
+ (elt (apply #'json-parse-string (concat "[" string "]") args) 0)))
-(compat-advise json-parse-buffer (&rest args)
+(compat-defun json-parse-buffer (&rest args)
"Handle top-level JSON values."
:cond (condition-case err
;; Use `random' to prevent byte compiler from optimising
@@ -228,10 +228,10 @@ If COUNT is non-nil and a natural number, the function
will
;; we have to check if an error was raised that the function
;; was not defined.
(void-function (eq (cadr err) 'json-parse-error)))
- :realname compat--json-parse-buffer-handle-tlo
+ :prefix t
:min-version "27"
(if (looking-at-p "[[:space:]]*[[{]")
- (apply oldfun args)
+ (apply #'json-parse-buffer args)
(catch 'escape
(atomic-change-group
(with-syntax-table
@@ -244,7 +244,7 @@ If COUNT is non-nil and a natural number, the function will
(insert "[")
(forward-sexp 1)
(insert "]"))))
- (throw 'escape (elt (apply oldfun args) 0))))))
+ (throw 'escape (elt (apply #'json-parse-buffer args) 0))))))
;;;; xfaces.c
- [elpa] externals/compat c4893fa014 15/27: Document bufferpos-to-filepos as not implemented, (continued)
- [elpa] externals/compat c4893fa014 15/27: Document bufferpos-to-filepos as not implemented, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 35072b3d25 22/27: Fix if-let and add tests, ELPA Syncer, 2022/03/05
- [elpa] externals/compat ece91a5b89 03/27: Add function-put, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 9034bcc0ac 05/27: Fix broken markup in some deftest docstrings, ELPA Syncer, 2022/03/05
- [elpa] externals/compat c8bc47b671 18/27: Add replace-string-in-region, ELPA Syncer, 2022/03/05
- [elpa] externals/compat a92aec7251 19/27: Add file-modes-number-to-symbolic, ELPA Syncer, 2022/03/05
- [elpa] externals/compat ba2918d6d3 21/27: Add file-backup-file-names, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 15ca463a9e 20/27: Document that null-device and path-separator are not implemented, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 6b14d5fa3b 24/27: Exclude the generated manual from the repository, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 63ac5dd347 16/27: Add assoc-delete-all, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 8eb72a2739 25/27: Convert JSON advice for Emacs 28 to prefixed functions,
ELPA Syncer <=
- [elpa] externals/compat 9fa3fbab8a 27/27: Fix (provide) in compat-tests.el, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 5514de45e1 26/27: Rewrite test macros to generate more individual tests, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 212f8c7c77 17/27: Add color-values-from-color-spec, ELPA Syncer, 2022/03/05
- [elpa] externals/compat 158edd3161 23/27: Mark all currently untested functions, ELPA Syncer, 2022/03/05