branch: elpa/typst-ts-mode
commit 2cca29e649f8d453d3195c1f8d0acdd4a0f20376
Author: meowking <mr.meowk...@posteo.com>
Commit: meowking <mr.meowk...@posteo.com>

    fix(typst-ts-watch): start-process issue
---
 typst-ts-compile.el    |  6 +-----
 typst-ts-editing.el    |  5 +++--
 typst-ts-variables.el  | 11 +++++++++--
 typst-ts-watch-mode.el | 12 ++++++------
 4 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/typst-ts-compile.el b/typst-ts-compile.el
index cb030d61dc..b070b78eef 100644
--- a/typst-ts-compile.el
+++ b/typst-ts-compile.el
@@ -64,7 +64,7 @@ If BUFFER is nil, it means use the current buffer.
 CHECK: non-nil mean check the file existence.
 Return nil if the BUFFER has not associated file or the there is
 no compiled pdf file when CHECK is non-nil."
-  (when-let ((typst-file (buffer-file-name buffer)))
+  (when-let* ((typst-file (buffer-file-name buffer)))
     (let ((res (concat (file-name-as-directory typst-ts-output-directory) 
(file-name-base typst-file) ".pdf")))
       (if check
           (when (file-exists-p res)
@@ -90,10 +90,6 @@ Assuming the compile output file name is in default style."
   (interactive)
   (typst-ts-compile t))
 
-(defcustom typst-ts-mode-preview-function 'browse-url
-  "Function that opens PDF documents for preview."
-  :type 'function)
-
 ;;;###autoload
 (defun typst-ts-preview (&optional buffer)
   "Preview the typst document output.
diff --git a/typst-ts-editing.el b/typst-ts-editing.el
index b5c0bb168b..03ba96ec78 100644
--- a/typst-ts-editing.el
+++ b/typst-ts-editing.el
@@ -24,6 +24,7 @@
 
 (require 'outline)
 (require 'typst-ts-core)
+(require 'typst-ts-variables)
 (require 'seq)
 
 (defun typst-ts-mode-heading-up ()
@@ -487,8 +488,8 @@ When using prefix argument ARG, 
`typst-ts-mode-electric-return' is nil,
                      (call-interactively global-ret-function))
                  (call-interactively global-ret-function))))))
         (node (typst-ts-core-parent-util-type
-                   (typst-ts-core-get-parent-of-node-at-bol-nonwhite)
-                   "item" t t)))
+               (typst-ts-core-get-parent-of-node-at-bol-nonwhite)
+               "item" t t)))
     (cond
      ((or (not typst-ts-mode-electric-return) arg) (funcall default-call))
      ((and node (eolp))
diff --git a/typst-ts-variables.el b/typst-ts-variables.el
index dbc8d51ff1..5d99585819 100644
--- a/typst-ts-variables.el
+++ b/typst-ts-variables.el
@@ -85,6 +85,13 @@ The compile options will be passed to the end of
   :type 'string
   :group 'typst-ts)
 
+
+(defcustom typst-ts-mode-preview-function 'browse-url
+  "Function that opens PDF documents for preview."
+  :type 'function
+  :group 'typst-ts)
+
+
 (defcustom typst-ts-compile-before-compilation-hook nil
   "Hook runs after compile."
   :type 'hook
@@ -101,11 +108,11 @@ the current buffer."
 
 ;;; Watch Mode 
=================================================================
 
-(defcustom typst-ts-watch-options ""
+(defcustom typst-ts-watch-options '()
   "User defined compile options for `typst-ts-watch'.
 The compile options will be passed to the
 `<typst-executable> watch <current-file>' sub-command."
-  :type 'string
+  :type '(list string)
   :group 'typst-ts-watch)
 
 (defcustom typst-ts-watch-process-name "*Typst-Watch*"
diff --git a/typst-ts-watch-mode.el b/typst-ts-watch-mode.el
index 4482d33133..90fd03b80e 100644
--- a/typst-ts-watch-mode.el
+++ b/typst-ts-watch-mode.el
@@ -91,13 +91,13 @@ PROC: process; OUTPUT: new output from PROC."
       (read-only-mode -1)))
   (set-process-filter
    (apply
-    start-process
+    #'start-process
     typst-ts-watch-process-name typst-ts-watch-process-buffer-name
-    (format "%s watch %s %s %s"
-            typst-ts-compile-executable-location
-            (file-name-nondirectory buffer-file-name)
-            (typst-ts-compile-get-result-pdf-filename)
-            typst-ts-watch-options))
+    typst-ts-compile-executable-location
+    "watch"
+    (file-name-nondirectory buffer-file-name)
+    (typst-ts-compile-get-result-pdf-filename)
+    typst-ts-watch-options)
    'typst-ts-watch--process-filter)
   (message "Start Watch"))
 

Reply via email to