diff options
| author | João Távora | 2018-07-02 15:57:24 +0100 |
|---|---|---|
| committer | João Távora | 2018-07-02 17:30:35 +0100 |
| commit | 332f4656b019b58fed1de6e35769e83ff190908d (patch) | |
| tree | a22f02d90e7b073bcd0208d14d6e349b5bf874e6 /lisp | |
| parent | ee3e432300054ca488896e39fca57b10d733330a (diff) | |
| download | emacs-332f4656b019b58fed1de6e35769e83ff190908d.tar.gz emacs-332f4656b019b58fed1de6e35769e83ff190908d.zip | |
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')
| -rw-r--r-- | lisp/jsonrpc.el | 10 |
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 @@ | |||
| 5 | ;; Author: João Távora <joaotavora@gmail.com> | 5 | ;; Author: João Távora <joaotavora@gmail.com> |
| 6 | ;; Maintainer: João Távora <joaotavora@gmail.com> | 6 | ;; Maintainer: João Távora <joaotavora@gmail.com> |
| 7 | ;; Keywords: processes, languages, extensions | 7 | ;; Keywords: processes, languages, extensions |
| 8 | ;; Package-Requires: ((emacs "26.1")) | 8 | ;; Package-Requires: ((emacs "25.1")) |
| 9 | ;; Version: 1.0.0 | 9 | ;; Version: 1.0.0 |
| 10 | 10 | ||
| 11 | ;; This is an Elpa :core package. Don't use functionality that is not | 11 | ;; This is an Elpa :core package. Don't use functionality that is not |
| 12 | ;; compatible with Emacs 26.1. | 12 | ;; compatible with Emacs 25.1. |
| 13 | 13 | ||
| 14 | ;; This program is free software; you can redistribute it and/or modify | 14 | ;; This program is free software; you can redistribute it and/or modify |
| 15 | ;; it under the terms of the GNU General Public License as published by | 15 | ;; it under the terms of the GNU General Public License as published by |
| @@ -132,7 +132,7 @@ immediately." | |||
| 132 | ;;; | 132 | ;;; |
| 133 | (cl-defmacro jsonrpc-lambda (cl-lambda-list &body body) | 133 | (cl-defmacro jsonrpc-lambda (cl-lambda-list &body body) |
| 134 | (declare (indent 1) (debug (sexp &rest form))) | 134 | (declare (indent 1) (debug (sexp &rest form))) |
| 135 | (let ((e (gensym "jsonrpc-lambda-elem"))) | 135 | (let ((e (cl-gensym "jsonrpc-lambda-elem"))) |
| 136 | `(lambda (,e) (apply (cl-function (lambda ,cl-lambda-list ,@body)) ,e)))) | 136 | `(lambda (,e) (apply (cl-function (lambda ,cl-lambda-list ,@body)) ,e)))) |
| 137 | 137 | ||
| 138 | (defun jsonrpc-events-buffer (connection) | 138 | (defun jsonrpc-events-buffer (connection) |
| @@ -436,7 +436,9 @@ connection object, called when the process dies .") | |||
| 436 | (defun jsonrpc--call-deferred (connection) | 436 | (defun jsonrpc--call-deferred (connection) |
| 437 | "Call CONNECTION's deferred actions, who may again defer themselves." | 437 | "Call CONNECTION's deferred actions, who may again defer themselves." |
| 438 | (when-let ((actions (hash-table-values (jsonrpc--deferred-actions connection)))) | 438 | (when-let ((actions (hash-table-values (jsonrpc--deferred-actions connection)))) |
| 439 | (jsonrpc--debug connection `(:maybe-run-deferred ,(mapcar #'caddr actions))) | 439 | (jsonrpc--debug connection `(:maybe-run-deferred |
| 440 | ,(mapcar (lambda (action) (car (cdr (cdr action)))) | ||
| 441 | actions))) | ||
| 440 | (mapc #'funcall (mapcar #'car actions)))) | 442 | (mapc #'funcall (mapcar #'car actions)))) |
| 441 | 443 | ||
| 442 | (defun jsonrpc--process-sentinel (proc change) | 444 | (defun jsonrpc--process-sentinel (proc change) |