Function: markdown-open

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

Signature

(markdown-open)

Documentation

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

Key Bindings

markdown-mode-command-map o markdown-mode-map C-c C-c o

Source Code

;; Defined in /nix/store/p33zgg95aglc47pl6zlgs43vki0snxf8-emacs-packages-deps/share/emacs/site-lisp/elpa/markdown-mode-20260827.909/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)