docs(format): set-formatter!: escape quotes in docstring

This commit is contained in:
Henrik Lissner 2023-09-14 17:29:41 +02:00
parent 0b2e6d7070
commit 3191349182
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -24,8 +24,8 @@ If you're trying to override this, ensure that you wrap the call in `after!' and
whichever package sets the initial formatter. See the ':editor format' README
for more.
For more information on how to structure the list to be
compatible, see `apheleia--run-formatter-function'.
For more information on how to structure the list to be compatible, see
`apheleia--run-formatter-function'.
MODES is a major mode, a list thereof, or a list of two-element sublists with
the structure: (MAJOR-MODE FORM). FORM is evaluated when the buffer is formatted
@ -37,42 +37,41 @@ and its return value serves two purposes:
list of shell arguments via the `mode-result' variable.
Basic examples:
(set-formatter! 'asmfmt \"asmfmt\" :modes '(asm-mode nasm-mode))
(set-formatter! 'black \"black -q -\")
(set-formatter! 'html-tidy \"tidy -q -indent\" :modes '(html-mode web-mode))
(set-formatter! \\='asmfmt \"asmfmt\" :modes \\='(asm-mode nasm-mode))
(set-formatter! \\='black \"black -q -\")
(set-formatter! \\='html-tidy \"tidy -q -indent\" :modes \\='(html-mode web-mode))
Advanced examples:
(set-formatter!
'clang-format
'(\"clang-format\"
\\='clang-format
\\='(\"clang-format\"
(\"-assume-filename=%S\" (or buffer-file-name mode-result \"\")))
:modes
'((c-mode \".c\")
\\='((c-mode \".c\")
(c++-mode \".cpp\")
(java-mode \".java\")
(objc-mode \".m\")
(protobuf-mode \".proto\")))
(set-formatter! 'html-tidy
'(\"tidy\" \"-q\" \"-indent\"
(\"-xml\" (memq major-mode '(nxml-mode xml-mode))))
(set-formatter! \\='html-tidy
\\='(\"tidy\" \"-q\" \"-indent\"
(\"-xml\" (memq major-mode \\='(nxml-mode xml-mode))))
:modes
'(html-mode
\\='(html-mode
(web-mode (and (equal \"none\" web-mode-engine)
(car (member web-mode-content-type '(\"xml\" \"html\")))))))
(car (member web-mode-content-type \\='(\"xml\" \"html\")))))))
(set-formatter! 'html-tidy ; overwrite predefined html-tidy formatter
'(\"tidy\" \"-q\" \"-indent\"
(set-formatter! \\='html-tidy ; overwrite predefined html-tidy formatter
\\='(\"tidy\" \"-q\" \"-indent\"
\"--tidy-mark\" \"no\"
\"--drop-empty-elements\" \"no\"
\"--show-body-only\" \"auto\"
(\"--indent-spaces\" \"%d\" tab-width)
(\"--indent-with-tabs\" \"%s\" (if indent-tabs-mode \"yes\" \"no\"))
(\"-xml\" (memq major-mode '(nxml-mode xml-mode)))))
(\"-xml\" (memq major-mode \\='(nxml-mode xml-mode)))))
(set-formatter! 'elm-format
\"elm-format --yes --stdin\")
"
(set-formatter! \\='elm-format
\"elm-format --yes --stdin\")"
(declare (indent defun))
(cl-check-type name symbol)
(after! apheleia-core