refactor(editorconfig): remove unused advice
editorconfig-call-editorconfig-exec was renamed+redesigned upstream. The advice can no longer be trivially repurposed, so I'm removing it. Ref: editorconfig/editorconfig-emacs@f8f1a899df
This commit is contained in:
parent
43870bf831
commit
41e81f67a7
1 changed files with 0 additions and 30 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue