diff options
author | Kirill Rogovoy <[email protected]> | 2021-07-22 20:13:59 +0300 |
---|---|---|
committer | Kirill Rogovoy <[email protected]> | 2021-07-22 20:13:59 +0300 |
commit | 60801f2fdaf9a94ceec8a365937c6d8ac8a4f802 (patch) | |
tree | 26643fefce76629956860dce17c3c19a28b9c48e /org-roam-ui.el | |
parent | e81659da02679735615f667750e0c3377483f093 (diff) |
Follow the current Emacs node in real time
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r-- | org-roam-ui.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el index fe012f6..9420bf3 100644 --- a/org-roam-ui.el +++ b/org-roam-ui.el @@ -95,15 +95,15 @@ ROWS is the sql result, while COLUMN-NAMES is the columns to use." res)) (defservlet* theme application/json () - (when (boundp 'doom-themes--colors) + (progn + (when (boundp 'doom-themes--colors) (let* - ((colors (butlast doom-themes--colors (- (length doom-themes--colors) 25))) - ui-theme (list nil)) - (progn - (dolist (color colors) - (push (cons (car color) (car (cdr color))) ui-theme)) - (insert (json-encode ui-theme)) - (httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*"))))) + ((colors (butlast doom-themes--colors (- (length doom-themes--colors) 25))) ui-theme (list nil)) + (progn + (dolist (color colors) (push (cons (car color) (car (cdr color))) ui-theme)) + (insert (json-encode ui-theme))))) + (httpd-send-header t "text/plain" 200 :Access-Control-Allow-Origin "*"))) + (defservlet* id/:id text/html () (let ((node (org-roam-populate (org-roam-node-create :id id))) @@ -116,10 +116,9 @@ ROWS is the sql result, while COLUMN-NAMES is the columns to use." (insert html-string))) (defservlet* current-node-id text/event-stream () - (insert (format "data: %s\n\n" + (insert (format "data: %s\n\n" org-roam-ui-current-node-id)) - (httpd-send-header t "text/event-stream" 200 :Access-Control-Allow-Origin "*") - ) + (httpd-send-header t "text/event-stream" 200 :Access-Control-Allow-Origin "*")) (defun org-roam-ui-update () "Track changes within Emacs to update Org-roam UI. |