Fix editorconfig file ext 'guesser' in org-edit-src buffers

Fixes editorconfig not correctly guessing style settings in org-edit-src
buffers.
This commit is contained in:
Henrik Lissner 2018-02-13 19:42:31 -05:00
parent e79942de2e
commit 11e5140b98
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -136,12 +136,13 @@ fundamental-mode) for performance sake."
"Retrieve the properties for the current file. If it doesn't have an "Retrieve the properties for the current file. If it doesn't have an
extension, try to guess one." extension, try to guess one."
(let ((buffer-file-name (let ((buffer-file-name
(if (file-name-extension buffer-file-name) (if (and (not (bound-and-true-p org-src-mode))
(file-name-extension buffer-file-name))
buffer-file-name buffer-file-name
(format "%s%s" buffer-file-name (format "%s%s" buffer-file-name
(let ((ext (cdr (assq major-mode doom-editorconfig-mode-alist)))) (if-let* ((ext (cdr (assq major-mode doom-editorconfig-mode-alist))))
(or (and ext (concat "." ext)) (concat "." ext)
"")))))) "")))))
(apply orig-fn args))) (apply orig-fn args)))
(advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection) (advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)