Enable read-only-mode in package files
These files shouldn't be modified directly.
This commit is contained in:
parent
ed69d580fb
commit
08bfd5879a
2 changed files with 11 additions and 1 deletions
|
@ -148,3 +148,12 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
||||||
" "
|
" "
|
||||||
(default-value 'flycheck-emacs-lisp-check-form)
|
(default-value 'flycheck-emacs-lisp-check-form)
|
||||||
")"))))
|
")"))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +emacs-lisp|read-only-packages ()
|
||||||
|
"Enable `read-only-mode' if a package source file is opened.
|
||||||
|
|
||||||
|
Packages are in `doom-packages-dir'. They shouldn't be modified directly."
|
||||||
|
(when-let* ((filename (buffer-file-name (buffer-base-buffer))))
|
||||||
|
(when (file-in-directory-p filename doom-packages-dir)
|
||||||
|
(read-only-mode +1))))
|
||||||
|
|
|
@ -50,7 +50,8 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
||||||
rainbow-delimiters-mode
|
rainbow-delimiters-mode
|
||||||
highlight-quoted-mode
|
highlight-quoted-mode
|
||||||
;; initialization
|
;; initialization
|
||||||
+emacs-lisp|extend-imenu))
|
+emacs-lisp|extend-imenu
|
||||||
|
+emacs-lisp|read-only-packages))
|
||||||
|
|
||||||
;; Flycheck's two emacs-lisp checkers produce a *lot* of false positives in
|
;; Flycheck's two emacs-lisp checkers produce a *lot* of false positives in
|
||||||
;; emacs configs, so we disable `emacs-lisp-checkdoc' and reduce the
|
;; emacs configs, so we disable `emacs-lisp-checkdoc' and reduce the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue