Browse Source

Add custom hook for readonly

master
10sr 6 years ago
parent
commit
65474a9f7c
Signed by: 10sr GPG Key ID: 7BEC428194130EB2
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      emacs.el

+ 7
- 0
emacs.el View File

@@ -643,6 +643,13 @@ found, otherwise returns nil."
(add-hook 'editorconfig-custom-hooks
'editorconfig-custom-majormode))

(add-hook 'editorconfig-custom-hooks
(lambda (props)
(let ((r (gethash 'readonly props)))
(when (and (string= r "true")
(not buffer-read-only))
(read-only-mode 1)))))

;; (when (fboundp 'editorconfig-charset-extras)
;; (add-hook 'editorconfig-custom-hooks
;; 'editorconfig-charset-extras))


Loading…
Cancel
Save