emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] scratch/editorconfig-cc 0a319fab78 033/351: Add global minor mo


From: Stefan Monnier
Subject: [nongnu] scratch/editorconfig-cc 0a319fab78 033/351: Add global minor mode
Date: Thu, 13 Jun 2024 18:38:38 -0400 (EDT)

branch: scratch/editorconfig-cc
commit 0a319fab7845153a91fbd12ff1174f2808e2ed2c
Author: 10sr <8slashes+git@gmail.com>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Add global minor mode
---
 editorconfig.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/editorconfig.el b/editorconfig.el
index f362ea7061..488b6aa882 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -132,6 +132,16 @@ property emacs_linum to decide whether to show line 
numbers on the left
         (funcall hook props)))
       (display-warning :error "EditorConfig core program is not available.  
Styles will not be applied."))))
 
+;;;###autoload
+(define-minor-mode edconf-mode
+  "Toggle EditorConfig feature."
+  :global t
+  :lighter ""
+  (if edconf-mode
+    (add-hook 'find-file-hook
+      'edconf-find-file-hook)
+    (remove-hook 'find-file-hook
+      'edconf-find-file-hook)))
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("/\\.editorconfig\\'" . conf-unix-mode))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]