瀏覽代碼

Add custom hook for readonly

master
10sr 6 年之前
父節點
當前提交
65474a9f7c
簽署人: 10sr GPG 金鑰 ID: 7BEC428194130EB2
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. +7
    -0
      emacs.el

+ 7
- 0
emacs.el 查看文件

@@ -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…
取消
儲存