emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/websocket b3a0153c0b 063/114: remove long line lambda


From: ELPA Syncer
Subject: [elpa] externals/websocket b3a0153c0b 063/114: remove long line lambda
Date: Wed, 15 Feb 2023 20:59:00 -0500 (EST)

branch: externals/websocket
commit b3a0153c0bc553892f8cf64a6dea9e8c54b70783
Author: Yuya Minami <yuya373@me.com>
Commit: Yuya Minami <yuya373@me.com>

    remove long line lambda
    
    it is easier to distinguish lambda dependency
---
 websocket.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/websocket.el b/websocket.el
index 01bbe6ea37..b7d62f45de 100644
--- a/websocket.el
+++ b/websocket.el
@@ -728,21 +728,24 @@ to the websocket protocol.
                             (websocket-outer-filter websocket output))))
     (set-process-sentinel
      conn
-     (lambda (process change)
-       (let ((websocket (process-get process :websocket)))
-         (websocket-debug websocket "State change to %s" change)
-         (let ((status (process-status process)))
-           (when (and nowait (eq status 'open))
-             (websocket-handshake url conn key protocols extensions 
custom-header-alist))
-
-           (when (and (member status '(closed failed exit signal))
-                      (not (eq 'closed (websocket-ready-state websocket))))
-             (websocket-try-callback 'websocket-on-close 'on-close 
websocket))))))
+     (websocket-sentinel url conn key protocols extensions custom-header-alist 
nowait))
     (set-process-query-on-exit-flag conn nil)
     (unless nowait
       (websocket-handshake url conn key protocols extensions 
custom-header-alist))
     websocket))
 
+(defun websocket-sentinel (url conn key protocols extensions 
custom-header-alist nowait)
+  #'(lambda (process change)
+      (let ((websocket (process-get process :websocket)))
+        (websocket-debug websocket "State change to %s" change)
+        (let ((status (process-status process)))
+          (when (and nowait (eq status 'open))
+            (websocket-handshake url conn key protocols extensions 
custom-header-alist))
+
+          (when (and (member status '(closed failed exit signal))
+                     (not (eq 'closed (websocket-ready-state websocket))))
+            (websocket-try-callback 'websocket-on-close 'on-close 
websocket))))))
+
 (defun websocket-handshake (url conn key protocols extensions 
custom-header-alist)
   (let ((url-struct (url-generic-parse-url url))
         (websocket (process-get conn :websocket)))



reply via email to

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