Add lisp-ts-mode
This commit is contained in:
@@ -1668,12 +1668,11 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
|||||||
(add-to-list 'apheleia-formatters
|
(add-to-list 'apheleia-formatters
|
||||||
'(raco-fmt "raco" "fmt"
|
'(raco-fmt "raco" "fmt"
|
||||||
(apheleia-formatters-fill-column "--width")))
|
(apheleia-formatters-fill-column "--width")))
|
||||||
(add-to-list 'apheleia-mode-alist
|
|
||||||
'(racket-mode . lisp-indent))
|
|
||||||
(add-to-list 'apheleia-mode-alist
|
|
||||||
'(mhtml-ts-mode . prettier-html))
|
|
||||||
(setf (alist-get 'java-mode apheleia-mode-alist) 'clang-format
|
(setf (alist-get 'java-mode apheleia-mode-alist) 'clang-format
|
||||||
(alist-get 'java-ts-mode apheleia-mode-alist) 'clang-format))
|
(alist-get 'java-ts-mode apheleia-mode-alist) 'clang-format
|
||||||
|
(alist-get 'lisp-ts-mode apheleia-mode-alist) 'lisp-indent
|
||||||
|
(alist-get 'racket-mode apheleia-mode-alist) 'lisp-indent
|
||||||
|
(alist-get 'mhtml-ts-mode apheleia-mode-alist) 'prettier-html))
|
||||||
|
|
||||||
;; awk
|
;; awk
|
||||||
(with-eval-after-load 'cc-mode
|
(with-eval-after-load 'cc-mode
|
||||||
@@ -2425,22 +2424,37 @@ line in the block and manually deal with indentation."
|
|||||||
elisp-add-help-echo nil)
|
elisp-add-help-echo nil)
|
||||||
|
|
||||||
;; common lisp
|
;; common lisp
|
||||||
(use-package lisp-mode
|
(defun my/apheleia-sly-skip-function ()
|
||||||
:ensure nil
|
"`apheleia-skip-functions' to skip when sly is not running."
|
||||||
:hook (lisp-mode . my/-format-only-when-sly-running)
|
(or (not (bound-and-true-p sly-mode))
|
||||||
|
(not (sly-connected-p))))
|
||||||
|
(defun my/format-only-when-sly-running ()
|
||||||
|
"Make apheleia-mode format Lisp buffers only when sly is running."
|
||||||
|
(add-to-list (make-local-variable 'apheleia-skip-functions)
|
||||||
|
#'my/-apheleia-sly-skip-function))
|
||||||
|
(with-eval-after-load 'lisp-mode
|
||||||
|
(add-hook 'lisp-mode-hook #'my/format-only-when-sly-running))
|
||||||
|
|
||||||
|
;; lisp-ts-mode
|
||||||
|
(use-package lisp-ts-mode
|
||||||
|
:hook ((lisp-ts-mode . my/format-only-when-sly-running)
|
||||||
|
(lisp-ts-mode . rainbow-delimiters-mode)
|
||||||
|
(lisp-ts-mode . sly-editing-mode)
|
||||||
|
(lisp-ts-mode . lisp-ts-format-support-mode)
|
||||||
|
(lisp-ts-mode . auto-highlight-symbol-mode))
|
||||||
|
:custom
|
||||||
|
(lisp-ts-mode-format-rainbow-delimiters t)
|
||||||
:init
|
:init
|
||||||
(defun my/-apheleia-sly-skip-function ()
|
(add-to-list 'major-mode-remap-alist '(lisp-mode . lisp-ts-mode))
|
||||||
(or (not (bound-and-true-p sly-mode))
|
:config
|
||||||
(not (sly-connected-p))))
|
(setf (alist-get 'lisp-ts-mode font-lock-ignore)
|
||||||
(defun my/-format-only-when-sly-running ()
|
lisp-ts-mode-font-lock-ignore-keywords))
|
||||||
"Make apheleia-mode format lisp buffers only when sly is running."
|
|
||||||
(add-to-list (make-local-variable 'apheleia-skip-functions)
|
|
||||||
#'my/-apheleia-sly-skip-function)))
|
|
||||||
;; sly
|
;; sly
|
||||||
(use-package sly
|
(use-package sly
|
||||||
:bind (:map sly-mode-map
|
:bind (:map sly-mode-map
|
||||||
("C-c e" . my/diagnostic-at-point))
|
("C-c e" . my/diagnostic-at-point))
|
||||||
:autoload sly-connected-p
|
:autoload (sly-connected-p sly--lisp-indent-lisp-mode-hook sly-editing-mode)
|
||||||
:custom
|
:custom
|
||||||
(inferior-lisp-program "/usr/bin/sbcl")
|
(inferior-lisp-program "/usr/bin/sbcl")
|
||||||
:init
|
:init
|
||||||
|
|||||||
Reference in New Issue
Block a user