diff --git a/modules/tools/editorconfig/config.el b/modules/tools/editorconfig/config.el index 5fb5bfa87..f98078c97 100644 --- a/modules/tools/editorconfig/config.el +++ b/modules/tools/editorconfig/config.el @@ -1,21 +1,5 @@ ;;; tools/editorconfig/config.el -*- lexical-binding: t; -*- -;; editorconfig cannot procure the correct settings for extension-less files. -;; Executable scripts with a shebang line, for example. So why not use Emacs' -;; major mode to drop editorconfig a hint? This is accomplished by temporarily -;; appending an extension to `buffer-file-name' when we talk to editorconfig. -(defvar +editorconfig-mode-alist - '((emacs-lisp-mode . "el") - (js2-mode . "js") - (perl-mode . "pl") - (php-mode . "php") - (python-mode . "py") - (ruby-mode . "rb") - (sh-mode . "sh")) - "An alist mapping major modes to extensions. Used by -`doom--editorconfig-smart-detection-a' to give editorconfig filetype hints.") - - ;; Handles whitespace (tabs/spaces) settings externally. This way projects can ;; specify their own formatting rules. (use-package! editorconfig @@ -30,20 +14,6 @@ (add-to-list 'editorconfig-exclude-regexps "\\.\\(zip\\|\\(doc\\|xls\\|ppt\\)x\\)\\'") - (defadvice! +editorconfig--smart-detection-a (fn) - "Retrieve the properties for the current file. If it doesn't have an -extension, try to guess one." - :around #'editorconfig-call-editorconfig-exec - (let ((buffer-file-name - (if (and (not (bound-and-true-p org-src-mode)) - (file-name-extension buffer-file-name)) - buffer-file-name - (format "%s%s" (buffer-file-name (buffer-base-buffer)) - (if-let (ext (alist-get major-mode +editorconfig-mode-alist)) - (concat "." ext) - ""))))) - (funcall fn))) - (add-hook! 'editorconfig-after-apply-functions (defun +editorconfig-disable-indent-detection-h (props) "Inhibit `dtrt-indent' if an explicit indent_style and indent_size is