Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a customization for quarto preview to watch inputs #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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: 12 additions & 2 deletions quarto-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ disk output."
:group 'quarto
:type '(choice (string :tag "Shell command") (repeat (string)) function))

(defcustom quarto-preview-watch-inputs nil
"When nil, 'quarto-preview' does not automatically refresh the
preview when the input file is updated."
:group 'quarto
:type 'boolean)

;;; Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun quarto-pm--output-file-sniffer ()
Expand Down Expand Up @@ -221,10 +227,14 @@ To control whether or not to show the display, customize
process-environment)))
(make-process :name (format "quarto-preview-%s" buffer-file-name)
:buffer "*quarto-preview*"
:command (list quarto-command
:command (if quarto-preview-watch-inputs
(list quarto-command
"preview"
buffer-file-name)
(list quarto-command
"preview"
buffer-file-name
"--no-watch-inputs")))))
"--no-watch-inputs"))))))
(setq quarto-mode--preview-process process)
(with-current-buffer (process-buffer process)
(when quarto-preview-display-buffer
Expand Down