Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions zotra.el
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ or zotra-server."
This is only relevant when `zotra-backend' is either citoid,
translation-server or zotra-server."
:group 'zotra
:type 'string)
:type '(boolean))


(defcustom zotra-cli-command
Expand Down Expand Up @@ -293,7 +293,7 @@ If SILENT-ERROR is nil and the command fails, raise a user-error."
(funcall response-handler response-code output))
output))


(defvar zotra-local-server-cmd nil)
(defvar zotra-local-server-process nil)
(defvar zotra-local-server-process-directory nil)
(defvar zotra-local-server-process-buffer-name "*zotra-local-server*")
Expand All @@ -317,8 +317,10 @@ If SILENT-ERROR is nil and the command fails, raise a user-error."
(get-buffer-create
zotra-local-server-process-buffer-name))
:noquery t
:command (list "npm" "start" "--prefix"
zotra-local-server-directory)))
:command (if zotra-local-server-cmd
(list zotra-local-server-cmd "server")
(list "npm" "start" "--prefix")
zotra-local-server-directory)))
(setq zotra-local-server-process-directory
zotra-local-server-directory)
(sleep-for 2)))))
Expand All @@ -331,7 +333,7 @@ If SILENT-ERROR is nil and the command fails, raise a user-error."

;; For `zotra-server', `translation-server' and `zotra-cli' backends
(defun zotra-contact-server (data content-type endpoint &optional param)
(cond
(cond
((member zotra-backend '(translation-server zotra-server))
(zotra-retrieve-synchronously
(concat zotra-server-path "/" endpoint
Expand Down Expand Up @@ -437,7 +439,7 @@ This function does NOT run the hooks in `zotra-after-get-bibtex-entry-hook'."
(t
(zotra-get-entry-from-json
(zotra-get-json data endpoint) entry-format))))


(defun zotra-query-url-or-search-string (&optional url-or-search-string)
"Ask the user where to get bibliographic data from.
Expand Down