summaryrefslogtreecommitdiff
path: root/lisp/jsonrpc.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2018-07-02 15:57:24 +0100
committerJoão Távora <joaotavora@gmail.com>2018-07-02 17:30:35 +0100
commit332f4656b019b58fed1de6e35769e83ff190908d (patch)
treea22f02d90e7b073bcd0208d14d6e349b5bf874e6 /lisp/jsonrpc.el
parentee3e432300054ca488896e39fca57b10d733330a (diff)
downloademacs-332f4656b019b58fed1de6e35769e83ff190908d.tar.gz
Make lisp/jsonrpc.el work with Emacs 25.1
* jsonrpc.el (Package-Requires): Require Emacs 25.1 (jsonrpc-lambda): Use cl-gensym. (jsonrpc--call-deferred): Caddr doesn't exist in emacs 25.1. * jsonrpc-tests.el (jsonrpc--call-with-emacsrpc-fixture): New function. (jsonrpc--with-emacsrpc-fixture): Use it. (deferred-action-complex-tests): Adjust test for Emacs 25.1
Diffstat (limited to 'lisp/jsonrpc.el')
-rw-r--r--lisp/jsonrpc.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index b77db716015..add2285bbe4 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -5,11 +5,11 @@
;; Author: João Távora <joaotavora@gmail.com>
;; Maintainer: João Távora <joaotavora@gmail.com>
;; Keywords: processes, languages, extensions
-;; Package-Requires: ((emacs "26.1"))
+;; Package-Requires: ((emacs "25.1"))
;; Version: 1.0.0
;; This is an Elpa :core package. Don't use functionality that is not
-;; compatible with Emacs 26.1.
+;; compatible with Emacs 25.1.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -132,7 +132,7 @@ immediately."
;;;
(cl-defmacro jsonrpc-lambda (cl-lambda-list &body body)
(declare (indent 1) (debug (sexp &rest form)))
- (let ((e (gensym "jsonrpc-lambda-elem")))
+ (let ((e (cl-gensym "jsonrpc-lambda-elem")))
`(lambda (,e) (apply (cl-function (lambda ,cl-lambda-list ,@body)) ,e))))
(defun jsonrpc-events-buffer (connection)
@@ -436,7 +436,9 @@ connection object, called when the process dies .")
(defun jsonrpc--call-deferred (connection)
"Call CONNECTION's deferred actions, who may again defer themselves."
(when-let ((actions (hash-table-values (jsonrpc--deferred-actions connection))))
- (jsonrpc--debug connection `(:maybe-run-deferred ,(mapcar #'caddr actions)))
+ (jsonrpc--debug connection `(:maybe-run-deferred
+ ,(mapcar (lambda (action) (car (cdr (cdr action))))
+ actions)))
(mapc #'funcall (mapcar #'car actions))))
(defun jsonrpc--process-sentinel (proc change)