Function: dired-vm

dired-vm is an interactive and byte-compiled function defined in dired-x.el.gz.

Signature

(dired-vm &optional READ-ONLY)

Documentation

Run VM on this file.

With optional prefix argument, visits the folder read-only. Otherwise obeys the value of dired-vm-read-only-folders.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dired-x.el.gz
(defun dired-vm (&optional read-only)
  "Run VM on this file.
With optional prefix argument, visits the folder read-only.
Otherwise obeys the value of `dired-vm-read-only-folders'."
  (interactive "P")
  (let ((dir (dired-current-directory))
        (fil (dired-get-filename)))
    (vm-visit-folder fil (or read-only
                             (eq t dired-vm-read-only-folders)
                             (and dired-vm-read-only-folders
                                  (not (file-writable-p fil)))))
    ;; So that pressing `v' inside VM does prompt within current directory:
    (setq-local vm-folder-directory dir)))