refactor(format): swap to string-blank-p & memq
This commit is contained in:
parent
7266c11366
commit
cdbf58a871
1 changed files with 3 additions and 2 deletions
|
@ -38,7 +38,7 @@ select buffers.")
|
|||
"Enable formatting on save in certain major modes.
|
||||
This is controlled by `+format-on-save-disabled-modes'."
|
||||
(or (eq major-mode 'fundamental-mode)
|
||||
(string-empty-p (string-trim (buffer-name)))
|
||||
(string-blank-p (buffer-name))
|
||||
(not (null (memq major-mode +format-on-save-disabled-modes)))))
|
||||
|
||||
|
||||
|
@ -46,13 +46,14 @@ This is controlled by `+format-on-save-disabled-modes'."
|
|||
(after! apheleia-core
|
||||
(add-to-list 'apheleia-inhibit-functions #'+format-inhibit-maybe-h)))
|
||||
|
||||
|
||||
;;
|
||||
;;; Hacks
|
||||
|
||||
(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 (member arg '(nil 1)))))
|
||||
(let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1)))))
|
||||
(funcall orig-fn)))
|
||||
|
||||
(add-hook!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue