浏览代码

Update editoconfig hooks

master
10sr 6 年前
父节点
当前提交
077ed8aab7
签署人:: 10sr GPG 密钥 ID: 7BEC428194130EB2
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      emacs.el

+ 7
- 2
emacs.el 查看文件

@@ -716,17 +716,22 @@ found, otherwise returns nil."
'editorconfig-mode-apply t)))

(when (fboundp 'editorconfig-custom-majormode)
(add-hook 'editorconfig-custom-hooks
(add-hook 'editorconfig-after-apply-functions
'editorconfig-custom-majormode))

;; Add readonly=true to set read-only-mode
(add-hook 'editorconfig-custom-hooks
(add-hook 'editorconfig-after-apply-functions
(lambda (props)
(let ((r (gethash 'readonly props)))
(when (and (string= r "true")
(not buffer-read-only))
(read-only-mode 1)))))

(add-hook 'editorconfig-hack-properties-functions
'(lambda (props)
(when (derived-mode-p makefile-mode)
(puthash 'indent_style \"tab\" props))))

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


正在加载...
取消
保存