Conform many modules to new conventions

This commit is contained in:
Henrik Lissner 2019-07-23 12:30:47 +02:00
parent 20e2aa0b18
commit c795a988e6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
26 changed files with 161 additions and 165 deletions

View file

@ -98,7 +98,7 @@ Stolen shamelessly from go-mode"
(if fmt (cons (intern fmt) t))))
;;;###autoload
(defun +format*probe (orig-fn)
(defun +format-probe-a (orig-fn)
"Use `+format-with' instead, if it is set."
(if +format-with
(list +format-with t)
@ -119,7 +119,7 @@ formatted text, ERRORS are any errors in string format, and FIRST-DIFF is the
position of the first change in the buffer.
See `+format/buffer' for the interactive version of this function, and
`+format|buffer' to use as a `before-save-hook' hook."
`+format-buffer-h' to use as a `before-save-hook' hook."
(if (not formatter)
'no-formatter
(let ((f-function (gethash formatter format-all--format-table))
@ -228,12 +228,12 @@ is selected)."
;; Hooks
;;;###autoload
(defun +format|enable-on-save ()
(defun +format-enable-on-save-h ()
"Enables formatting on save."
(add-hook 'before-save-hook #'+format|buffer nil t))
(add-hook 'before-save-hook #'+format-buffer-h nil t))
;;;###autoload
(defalias '+format|buffer #'+format/buffer
(defalias '+format-buffer-h #'+format/buffer
"Format the source code in the current buffer with minimal feedback.
Meant for `before-save-hook'.")

View file

@ -25,7 +25,7 @@ Indentation is always preserved when formatting regions.")
;;
;;; Bootstrap
(defun +format|enable-on-save-maybe ()
(defun +format-enable-on-save-maybe-h ()
"Enable formatting on save in certain major modes.
This is controlled by `+format-on-save-enabled-modes'."
@ -39,7 +39,7 @@ This is controlled by `+format-on-save-enabled-modes'."
(format-all-mode +1)))
(when (featurep! +onsave)
(add-hook 'after-change-major-mode-hook #'+format|enable-on-save-maybe))
(add-hook 'after-change-major-mode-hook #'+format-enable-on-save-maybe-h))
;;
@ -47,7 +47,7 @@ This is controlled by `+format-on-save-enabled-modes'."
;; Allow a specific formatter to be used by setting `+format-with', either
;; buffer-locally or let-bound.
(advice-add #'format-all--probe :around #'+format*probe)
(advice-add #'format-all--probe :around #'+format-probe-a)
;; Doom uses a modded `format-all-buffer', which
;; 1. Enables partial reformatting (while preserving leading indentation),