Skip to content

Commit

Permalink
Make cach refresh non blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
felko committed Jul 28, 2020
1 parent 9998209 commit 09e1f47
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions neuron-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,13 @@ Extract only the result itself, so the query type is lost."
"Regenerate the zettel cache and the title overlays in all neuron-mode buffers."
(interactive)
(neuron-check-if-zettelkasten-exists)
(neuron--rebuild-cache)
(dolist (buffer (neuron-list-buffers))
(with-current-buffer buffer (neuron--setup-overlays)))
(message "Regenerated zettel cache"))
(make-thread (lambda ()
(progn
(dolist (buffer (neuron-list-buffers))
(with-current-buffer buffer (neuron--setup-overlays)))
(neuron--rebuild-cache)
(message "Regenerated zettel cache")))
"neuron-refresh"))

(defun neuron--is-valid-id (id)
"Check whether the ID is a valid neuron zettel ID.
Expand Down Expand Up @@ -867,9 +870,9 @@ QUERY is an alist containing at least the query type and the URL."
(interactive)
(neuron-check-if-zettelkasten-exists)
(let ((address (format "%s:%d" neuron-rib-server-host neuron-rib-server-port)))
(if (neuron--run-rib-process "-ws" address)
(message "Started web application on %s" address)
(user-error "Failed to run rib server on %s" address))))
(if (neuron--run-rib-process "-ws" address)
(message "Started web application on %s" address)
(user-error "Failed to run rib server on %s" address))))

(defun neuron-rib-generate ()
"Do an one-off generation of the web interface of the zettelkasten."
Expand Down

0 comments on commit 09e1f47

Please sign in to comment.