diff --git a/lisp/fg42/deps.el b/lisp/fg42/deps.el index 844b5d5..88e3007 100644 --- a/lisp/fg42/deps.el +++ b/lisp/fg42/deps.el @@ -66,8 +66,6 @@ ninja-mode eldoc-cmake cmake-mode - pyenv-mode - pyvenv poetry lsp-pyright python-black diff --git a/lisp/fg42/editor.el b/lisp/fg42/editor.el index c966456..01ef21e 100644 --- a/lisp/fg42/editor.el +++ b/lisp/fg42/editor.el @@ -27,7 +27,9 @@ ;; Language support (require 'fg42/autocomplete) (require 'fg42/langs/cpp) - (require 'fg42/langs/verilog)) + (require 'fg42/langs/verilog) + (require 'fg42/langs/python) + (require 'fg42/langs/elisp)) (require 'server) diff --git a/lisp/fg42/help.el b/lisp/fg42/help.el new file mode 100644 index 0000000..73fc55a --- /dev/null +++ b/lisp/fg42/help.el @@ -0,0 +1,46 @@ +;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*- +;; +;; Copyright (c) 2010-2024 Sameer Rahmani & Contributors +;; +;; Author: Sameer Rahmani +;; URL: https://devheroes.codes/FG42/FG42 +;; Version: 3.0.0 +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; +;;; Commentary: +;;; Code: + +;; emacs --batch --eval=(require 'ox-texinfo) --eval=(find-file "README.org\") --eval=(org-texinfo-export-to-info) +(require ox-texinfo) + +(org-texinfo-export-to-info) + +(defun build-manual () + "Build FG42's manual." + (interactive) + (with-temp-buffer + (find-file (file-name-concat (expand-file-name fg42-home) "docs/fg42.org")) + (org-texinfo-export-to-info))) + + +(defun fg42-manual () + "Show FG42's manual." + (interactive) + ;; TODO: move this to the init script + (add-to-list 'Info-default-directory-list (file-name-concat (expand-file-name fg42-home) "docs/")) + (info "(fg42)")) + +(provide 'fg42/help) +;;; help.el ends here diff --git a/lisp/fg42/langs/python.el b/lisp/fg42/langs/python.el new file mode 100644 index 0000000..c8ccad2 --- /dev/null +++ b/lisp/fg42/langs/python.el @@ -0,0 +1,60 @@ +;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*- +;; +;; Copyright (c) 2010-2024 Sameer Rahmani & Contributors +;; +;; Author: Sameer Rahmani +;; URL: https://devheroes.codes/FG42/FG42 +;; Version: 3.0.0 +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; +;;; Commentary: +;;; Code: +(eval-when-compile + (require 'fpkg)) + + +(use! python-black + "This cube reformats python code using black formatter tool." + :commands (python-black-on-save-mode + python-black-buffer + python-black-region + python-black-statement) + :hook (python-mode . python-black-on-save-mode)) + + +(use! poetry + "Poetry support for FG42. To use it, just use `M-x poetry'." + :config + (setq poetry-tracking-strategy 'switch-buffer) + :hook (python-mode . poetry-tracking-mode)) + + +(use! python-ts-mode + "Python setup. We're using treesitter version of python mode." + :init + ;; Remap the standard python mode + (add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode)) + + :config + (setq python-indent-guess-indent-offset-verbose nil) + + :hook + (python-ts-mode . eglot-ensure) + (python-ts-mode . company-mode) + (python-ts-mode . flyspell-prog-mode)) + + +(provide 'fg42/langs/python) +;;; python.el ends here