Function: markdown-open

markdown-open is an interactive and byte-compiled function defined in markdown-mode.el.

Signature

(markdown-open)

Documentation

Open file for the current buffer with markdown-open-command.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-open ()
  "Open file for the current buffer with `markdown-open-command'."
  (interactive)
  (unless markdown-open-command
    (user-error "Variable `markdown-open-command' must be set"))
  (if (stringp markdown-open-command)
      (if (not buffer-file-name)
          (user-error "Must be visiting a file")
        (save-buffer)
        (let ((exit-code (call-process markdown-open-command nil nil nil
                                       buffer-file-name)))
          ;; The exit code can be a signal description string, so don’t use ‘=          ;; or ‘zerop’.
          (unless (eq exit-code 0)
            (user-error "%s failed with exit code %s"
                        markdown-open-command exit-code))))
    (funcall markdown-open-command))
  nil)