Function: apheleia-formatters-mode-extension

apheleia-formatters-mode-extension is a natively compiled function defined in apheleia-utils.el.

Signature

(apheleia-formatters-mode-extension &optional FLAG)

Documentation

Get a file-extension based on the current major-mode.

If FLAG is set this function returns a list of FLAG and then the extension. Otherwise return the extension only.

Source Code

;; Defined in /nix/store/lwcwryzabcmvjcwwzzs65jrwf7p7d7cs-emacs-packages-deps/share/emacs/site-lisp/elpa/apheleia-20260915.1628/apheleia-utils.el
(defun apheleia-formatters-mode-extension (&optional flag)
  "Get a file-extension based on the current `major-mode'.
If FLAG is set this function returns a list of FLAG and then the extension.
Otherwise return the extension only."
  (when-let* ((ext
               (alist-get
                major-mode apheleia-formatters-mode-extension-assoc)))
    (if flag
        (list flag ext)
      ext)))