diff --git a/zotra.el b/zotra.el index c2315b7..41908a0 100644 --- a/zotra.el +++ b/zotra.el @@ -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 @@ -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*") @@ -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))))) @@ -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 @@ -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.