From 11e5140b98ceb69513903096dc9c8d9fab4a6dac Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 13 Feb 2018 19:42:31 -0500 Subject: [PATCH] Fix editorconfig file ext 'guesser' in org-edit-src buffers Fixes editorconfig not correctly guessing style settings in org-edit-src buffers. --- core/core-editor.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index b70117ada..1e4d36367 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -136,12 +136,13 @@ fundamental-mode) for performance sake." "Retrieve the properties for the current file. If it doesn't have an extension, try to guess one." (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 (format "%s%s" buffer-file-name - (let ((ext (cdr (assq major-mode doom-editorconfig-mode-alist)))) - (or (and ext (concat "." ext)) - "")))))) + (if-let* ((ext (cdr (assq major-mode doom-editorconfig-mode-alist)))) + (concat "." ext) + ""))))) (apply orig-fn args))) (advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)