Function: find-file-read-only

find-file-read-only is an interactive and byte-compiled function defined in files.el.gz.

Signature

(find-file-read-only FILENAME &optional WILDCARDS)

Documentation

Edit file FILENAME but don't allow changes.

Like C-x C-f (find-file), but marks buffer as read-only. Use C-x C-q (read-only-mode) to permit editing.

View in manual

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun find-file-read-only (filename &optional wildcards)
  "Edit file FILENAME but don't allow changes.
Like \\[find-file], but marks buffer as read-only.
Use \\[read-only-mode] to permit editing."
  (interactive
   (find-file-read-args "Find file read-only: "
                        (confirm-nonexistent-file-or-buffer)))
  (find-file--read-only #'find-file filename wildcards))