aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dir-locals.el18
-rw-r--r--portal/lib/portal_ws.ml4
2 files changed, 15 insertions, 7 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 31be82f..3c3c196 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,5 +1,13 @@
-((nil
- (eval
- . (let ((opam-share (car (process-lines "opam" "var" "share"))))
- (when (and opam-share (file-directory-p opam-share))
- (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share)))))))
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((jinx-dir-local-words . "Lwt")
+ (eval . (let
+ ((opam-share
+ (car
+ (process-lines "opam" "var" "share"))))
+ (when
+ (and opam-share
+ (file-directory-p opam-share))
+ (add-to-list 'load-path
+ (expand-file-name "emacs/site-lisp" opam-share))))))))
diff --git a/portal/lib/portal_ws.ml b/portal/lib/portal_ws.ml
index 5377ed9..fbdced7 100644
--- a/portal/lib/portal_ws.ml
+++ b/portal/lib/portal_ws.ml
@@ -14,7 +14,6 @@ let ws_endpoint (domain : string) =
this constructor (Node.js), there should be some sort of polyfill.
Lastly, if [domain] doesn't provide a well-formed Web-host Metadata file, the function throws an exception. *)
-
let+ host_meta = Js_of_ocaml_lwt.XmlHttpRequest.perform_raw_url (well_known_of domain)
in let i = Xmlm.make_input (`String (0, host_meta.content))
(* This ugly function extracts the href element from a Link tag's attributes if it's a websocket. *)
@@ -37,7 +36,8 @@ let ws_endpoint (domain : string) =
| None -> failwith (domain ^ "doesn't advertise a WebSocket endpoint via Web-host Metadata.")
let ws_stream (url : string) =
- (** [ws_stream url] returns a stream (and its push function) that talk with the websocket located at [url].
+ (** [ws_stream url] returns an Lwt stream (and its push function) communicating with the websocket located at [url]
+ using the XMPP protocol.
Pushing [None] closes the websocket.