@@ -1075,12 +1075,12 @@ update the buffer containing the preview and return the buffer."
1075
1075
:type 'function)
1076
1076
1077
1077
(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
1079
1079
export by setting to 'delete-on-export, when quitting
1080
1080
`markdown-live-preview-mode' by setting to 'delete-on-destroy, or not at all
1081
1081
when nil."
1082
1082
:group 'markdown
1083
- :type 'symbol)
1083
+ :type '( symbol :validate markdown-live-preview-validate-delete-export) )
1084
1084
1085
1085
(defcustom markdown-live-preview-idle-delay 1
1086
1086
"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."
5296
5296
5297
5297
;;; Live Preview ===============================================================
5298
5298
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
+
5299
5306
(defvar markdown-live-preview-view-buffer nil
5300
5307
"Buffer used to preview markdown output in
5301
5308
`markdown-live-preview-sync-export' and `markdown-live-preview-async-export'.")
@@ -5545,8 +5552,8 @@ output buffer in another window."
5545
5552
(defun markdown-live-preview-re-export ()
5546
5553
(interactive)
5547
5554
"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."
5550
5557
(when markdown-live-preview-source-buffer
5551
5558
(with-current-buffer markdown-live-preview-source-buffer
5552
5559
(if markdown-live-preview-current-buffer-sync-async
0 commit comments