From f0c8290ae2bf41ddfcc1bd2fabcb5990012f6777 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 19 Jun 2025 19:41:37 +0200 Subject: [PATCH] fix(format): prefix arg inhibiting format-on-save We bind to basic-save-buffer in :config default (and save-buffer calls it too), so we advise that instead. However, this is a temporary solution because it casts way too wide a net. Probably better to add a new save-without-formatting keybind instead. Fix: #8420 --- modules/editor/format/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/editor/format/config.el b/modules/editor/format/config.el index 6eebb125d..4caa8f567 100644 --- a/modules/editor/format/config.el +++ b/modules/editor/format/config.el @@ -47,8 +47,8 @@ This is controlled by `+format-on-save-disabled-modes'." (defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg) "Make it so \\[save-buffer] with prefix arg inhibits reformatting." - :around #'save-buffer - (let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1))))) + :around #'basic-save-buffer + (let ((apheleia-inhibit (or apheleia-inhibit current-prefix-arg))) (funcall orig-fn))) ;; HACK: Apheleia suppresses notifications that the current buffer has