Skip to content

Commit

Permalink
Enable lexical-binding and disable flycheck-checkdoc in PP output buf…
Browse files Browse the repository at this point in the history
…fers
  • Loading branch information
pkryger committed Dec 12, 2024
1 parent 2424f87 commit 9e8b33d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .ci/unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ ${EMACS} -Q --batch \
exordium-spell-check nil)
(load-file "'"${EMACS_DIR}"'/init.el")
(load-file "'"${EMACS_DIR}"'/modules/init-bde-style.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-elisp.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-forge.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-util.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-highlight.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-lib.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-require.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-highlight.t.el")
(load-file "'"${EMACS_DIR}"'/modules/init-util.t.el")
(let ((print-level 50)
(eval-expression-print-level 50)
(eval-expression-print-length 1000)
Expand Down
17 changes: 16 additions & 1 deletion modules/init-elisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
(use-package elisp-mode
:ensure nil
:defer t
:functions (exordium--pp-last-sexp-filter-quote)
:init

(defun exordium--pp-output-setup ()
"Enable `lexical-binding' and disable `flycheck-checkdoc' in PP output buffers."
(when (string-match-p (rx "*Pp " (or "Eval" "Macroexpand") " Output*")
(buffer-name))
(when (boundp 'flycheck-disabled-checkers)
(add-to-list 'flycheck-disabled-checkers 'emacs-lisp-checkdoc))
(goto-char (point-min))
(insert ";; -*- lexical-binding: t -*-\n\n")
(goto-char (point-min))
(setq-local lexical-binding t)))
:bind
(:map emacs-lisp-mode-map
("M-C-g" . #'helm-imenu)
Expand All @@ -34,7 +47,9 @@
("C-c C-M-e" . #'pp-macroexpand-last-sexp)
("M-." . #'xref-find-definitions)
("M-," . #'xref-go-back)
("M-r" . #'xref-find-references)))
("M-r" . #'xref-find-references))
:hook
(emacs-lisp-mode . exordium--pp-output-setup))

(use-package elisp-mode
:ensure nil
Expand Down

0 comments on commit 9e8b33d

Please sign in to comment.