From 9a6a9fcbf8c38bbb772a9268be9fa8d7b60687b1 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 6 Feb 2025 17:05:01 -0800 Subject: [PATCH] Disable apheleia auto-format in awk buffers --- init.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index e61d1d7..8471b28 100644 --- a/init.el +++ b/init.el @@ -1394,13 +1394,18 @@ With PROJECT, give diagnostics for all buffers in the current project." :bind ("C-c o" . apheleia-format-buffer) :init (add-to-list 'auto-mode-alist `(,(rx "/.clang-format" eos) . yaml-ts-mode)) + (defun my/apheleia-disable-in-current-buffer () + (setq-local apheleia-inhibit t)) :config (with-eval-after-load 'apheleia (setf (alist-get 'java-mode apheleia-mode-alist) 'clang-format - (alist-get 'java-ts-mode apheleia-mode-alist) 'clang-format - (alist-get 'awk-mode apheleia-mode-alist nil t) nil)) + (alist-get 'java-ts-mode apheleia-mode-alist) 'clang-format)) (apheleia-global-mode +1)) +;; awk +(with-eval-after-load 'cc-mode + (add-hook 'awk-mode-hook #'my/apheleia-disable-in-current-buffer)) + ;; gud (use-package gud :demand t