From 68a2c75bbc0725ccd83cec77f28afb8d87efdf74 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 6 Aug 2022 10:48:00 +0200 Subject: [PATCH] Emacs: Only format C++ buffers in source trees with .clang-format file --- .config/emacs/config/development.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/emacs/config/development.org b/.config/emacs/config/development.org index 74fed82..3f50c7d 100644 --- a/.config/emacs/config/development.org +++ b/.config/emacs/config/development.org @@ -229,7 +229,9 @@ Language Server Protocol. (list (if (and (eq major-mode 'c++-mode) (bound-and-true-p lsp-mode) - (project-current)) + (or + (locate-dominating-file "." ".clang-format") + (locate-dominating-file "." "_clang-format"))) t nil)))) (when (car lsp-in-cpp-project-cache)