From 38360fbbb8eca28ba454d4777583c2d15fe91a69 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Mon, 16 Jan 2023 00:27:17 +0800 Subject: [PATCH] modify editorconfig config --- lisp/init-editorconfig.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/init-editorconfig.el b/lisp/init-editorconfig.el index 5f28f46..6cf1be4 100644 --- a/lisp/init-editorconfig.el +++ b/lisp/init-editorconfig.el @@ -3,13 +3,14 @@ (autoload 'editorconfig-mode "editorconfig" "" t) (defun creature/editorconfig-setup () + (editorconfig-mode 1) + ;; 修复通过打开文件启动该插件时打开的文件缩进配置不对 + (editorconfig-mode-apply) + (remove-hook 'find-file-hook #'creature/editorconfig-setup) + ;; 防止多次执行时因为定时器被清除而报错 (when (and (boundp 'creature/editorconfig-timer) (timerp creature/editorconfig-timer)) - (editorconfig-mode 1) - ;; 修复通过打开文件启动该插件时打开的文件缩进配置不对 - (editorconfig-mode-apply) - (remove-hook 'find-file-hook #'creature/editorconfig-setup) (cancel-timer creature/editorconfig-timer) (makunbound 'creature/editorconfig-timer)))