emacs/lisp/langs/icejam-lang-python.el
Maciej Szlosarczyk 118cf92a27
Some checks failed
/ Test config on 20 (push) Failing after 45s
Make loading faster by eliminating require blocks
2025-01-17 10:22:38 +02:00

37 lines
1.1 KiB
EmacsLisp

;;; python -- summary -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(declare-function icejam-set-lsp-capfs 'icejam-complete-at-point)
(declare-function lsp 'lsp-mode)
(declare-function column-enforce-n "column-enforce-mode" (number))
(eval-when-compile (defvar icejam-language-transient-alist))
(transient-define-prefix icejam-python-lang-menu ()
"Python Buffer Commands."
[""
["LSP"
("m" "iMenu" lsp-ui-imenu)]
["Buffer"
("r" "Reload" icejam-revert-buffer-no-confirm)
("f" "Format" lsp-format-buffer)
("i" "Indent" icejam-mark-and-indent-whole-buffer)
("e" "Show Errors" flymake-show-buffer-diagnostics)]]
[""
("q" "Quit" keyboard-quit)])
;; Add lookup for C-c l transient menu
(add-to-list
'icejam-language-transient-alist '(python-mode . icejam-python-lang-menu))
(defun icejam-lang-activate-python-mode ()
"Activate python mode."
(lsp)
(column-enforce-n 99)
;; Capf override
(icejam-set-lsp-capfs))
(add-hook 'python-mode-hook 'icejam-lang-activate-python-mode)
(provide 'icejam-lang-python)
;;; icejam-lang-python.el ends here