-
Notifications
You must be signed in to change notification settings - Fork 171
Closed
Labels
Description
I would suggest some small improvements to the markdown-open
command. The version below will first save the buffer content using (save-buffer (buffer-file-name))
and then run the markdown-open-command
on the file.
(defun markdown-open ()
"Open file for the current buffer with `markdown-open-command'."
(interactive)
(if (not markdown-open-command)
(user-error "Variable `markdown-open-command' must be set")
(if (not buffer-file-name)
(user-error "Must be visiting a file")
(save-buffer (buffer-file-name))
(call-process markdown-open-command
nil nil nil buffer-file-name))))
For the time being you could advise the markdown-open
function:
(defadvice markdown-open (before my-markdown-save-and-open activate)
"Save buffer before open file for the current buffer."
(unless (buffer-file-name) (user-error "Must be visiting a file"))
(save-buffer (buffer-file-name)))