emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 4ee502c: Adjust previous jsonrpc change


From: João Távora
Subject: [Emacs-diffs] master 4ee502c: Adjust previous jsonrpc change
Date: Tue, 3 Jul 2018 04:03:40 -0400 (EDT)

branch: master
commit 4ee502ca9db022ef85c736888ec6d6b471e0332a
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Adjust previous jsonrpc change
    
    (nth 2) is probably a better alternative to caddr, and in Emacs 26.1
    we can pass 0 as :service to automatically find an available port.
    
    * lisp/jsonrpc.el (jsonrpc--call-deferred): Use cl-caddr.
    
    * test/lisp/jsonrpc-tests.el
    (jsonrpc--call-with-emacsrpc-fixture): Pass 0 as :service to when
    making the listen server.
---
 lisp/jsonrpc.el            | 7 +++----
 test/lisp/jsonrpc-tests.el | 6 +++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index add2285..b2ccea5 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -5,11 +5,11 @@
 ;; Author: João Távora <address@hidden>
 ;; Maintainer: João Távora <address@hidden>
 ;; Keywords: processes, languages, extensions
-;; Package-Requires: ((emacs "25.1"))
+;; Package-Requires: ((emacs "25.2"))
 ;; Version: 1.0.0
 
 ;; This is an Elpa :core package.  Don't use functionality that is not
-;; compatible with Emacs 25.1.
+;; compatible with Emacs 25.2.
 
 ;; 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
@@ -437,8 +437,7 @@ connection object, called when the process dies .")
   "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 (lambda (action) (car (cdr (cdr 
action))))
-                                          actions)))
+                                 ,(mapcar (apply-partially #'nth 2) actions)))
     (mapc #'funcall (mapcar #'car actions))))
 
 (defun jsonrpc--process-sentinel (proc change)
diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el
index 16986eb..1a84c30 100644
--- a/test/lisp/jsonrpc-tests.el
+++ b/test/lisp/jsonrpc-tests.el
@@ -48,7 +48,11 @@
           (setq listen-server
                 (make-network-process
                  :name "Emacs RPC server" :server t :host "localhost"
-                 :service 44444
+                 :service (if (version<= emacs-version "26.1")
+                              44444
+                            ;; 26.1 can automatically find ports if
+                            ;; one passes 0 here.
+                            0)
                  :log (lambda (listen-server client _message)
                         (push
                          (make-instance



reply via email to

[Prev in Thread] Current Thread [Next in Thread]