General refactor of modules

General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
This commit is contained in:
Henrik Lissner 2018-09-07 22:08:11 -04:00
parent 89b83f2457
commit c58077810d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
15 changed files with 59 additions and 57 deletions

View file

@ -29,7 +29,7 @@
(enh-ruby-mode enh-ruby-indent-level))
editorconfig-indentation-alist)))
(defun doom*editorconfig-smart-detection (orig-fn &rest args)
(defun doom*editorconfig-smart-detection (orig-fn)
"Retrieve the properties for the current file. If it doesn't have an
extension, try to guess one."
(let ((buffer-file-name
@ -40,12 +40,13 @@ extension, try to guess one."
(if-let* ((ext (cdr (assq major-mode +editorconfig-mode-alist))))
(concat "." ext)
"")))))
(apply orig-fn args)))
(funcall orig-fn)))
(advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)
(defun +editorconfig|disable-ws-butler-maybe (props)
"Disable `ws-butler-mode' if trim_trailing_whitespace is true."
(when (equal (gethash 'trim_trailing_whitespace props) "true")
(when (and (equal (gethash 'trim_trailing_whitespace props) "true")
(bound-and-true-p ws-butler-mode))
(ws-butler-mode -1)))
(add-hook 'editorconfig-custom-hooks #'+editorconfig|disable-ws-butler-maybe)