Skip to content

Commit 850a4c1

Browse files
author
Danny McClanahan
committed
small fixes
1 parent 881898a commit 850a4c1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

markdown-mode.el

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,12 +1075,12 @@ update the buffer containing the preview and return the buffer."
10751075
:type 'function)
10761076

10771077
(defcustom markdown-live-preview-delete-export 'delete-on-destroy
1078-
"Delete exported html file when using `markdown-live-preview-sync-export' on every
1078+
"Delete exported html file when using `markdown-live-preview-mode' on every
10791079
export by setting to 'delete-on-export, when quitting
10801080
`markdown-live-preview-mode' by setting to 'delete-on-destroy, or not at all
10811081
when nil."
10821082
:group 'markdown
1083-
:type 'symbol)
1083+
:type '(symbol :validate markdown-live-preview-validate-delete-export))
10841084

10851085
(defcustom markdown-live-preview-idle-delay 1
10861086
"Delay to wait idle before refreshing `markdown-live-preview-mode' output."
@@ -5296,6 +5296,13 @@ current filename, but with the extension removed and replaced with .html."
52965296

52975297
;;; Live Preview ===============================================================
52985298

5299+
(defun markdown-live-preview-validate-delete-export (widget)
5300+
(let ((sym (widget-value widget)))
5301+
(unless (memq sym '(delete-on-export delete-on-destroy nil))
5302+
(widget-put widget :error (format "Invalid value: '%s'"
5303+
(symbol-name sym)))
5304+
widget)))
5305+
52995306
(defvar markdown-live-preview-view-buffer nil
53005307
"Buffer used to preview markdown output in
53015308
`markdown-live-preview-sync-export' and `markdown-live-preview-async-export'.")
@@ -5545,8 +5552,8 @@ output buffer in another window."
55455552
(defun markdown-live-preview-re-export ()
55465553
(interactive)
55475554
"If the current buffer is a buffer displaying the exported version of a
5548-
`markdown-live-preview-mode' buffer, call `markdown-live-preview-sync-export'
5549-
and update this buffer's contents."
5555+
`markdown-live-preview-mode' buffer, call `markdown-live-preview-async-export'
5556+
or `markdown-live-preview-sync-export' and update this buffer's contents."
55505557
(when markdown-live-preview-source-buffer
55515558
(with-current-buffer markdown-live-preview-source-buffer
55525559
(if markdown-live-preview-current-buffer-sync-async

0 commit comments

Comments
 (0)