Add the ability to build the docs from cubes docstrings
This commit is contained in:
parent
f52425825a
commit
db967c38f3
|
@ -43,4 +43,7 @@ website/*~
|
||||||
#*#
|
#*#
|
||||||
|
|
||||||
emacs.d/
|
emacs.d/
|
||||||
build/
|
build/
|
||||||
|
|
||||||
|
docs/site/orgs/cubes/
|
||||||
|
**/*/sitemap.inc
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -86,4 +86,4 @@ dummy-x:
|
||||||
Xephyr -br -ac -noreset -screen 800x600 :1
|
Xephyr -br -ac -noreset -screen 800x600 :1
|
||||||
.PHONY: test-wm
|
.PHONY: test-wm
|
||||||
test-wm:
|
test-wm:
|
||||||
DISPLAY=:1 FG42_WM=true FG42_V3=true fg42-wm
|
DISPLAY=:1 FG42_WM=true FG42_V3=true ./fg42-wm
|
||||||
|
|
3
build.el
3
build.el
|
@ -98,6 +98,9 @@ PARAMS:
|
||||||
(cond
|
(cond
|
||||||
((string= command "docs")
|
((string= command "docs")
|
||||||
(do-command
|
(do-command
|
||||||
|
(require 'fpkg)
|
||||||
|
(fpkg/use dash)
|
||||||
|
|
||||||
(require 'fg42/build/docs)
|
(require 'fg42/build/docs)
|
||||||
(fg42/build-docs build-dir)))
|
(fg42/build-docs build-dir)))
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
(require 'cubes/irc)
|
(require 'cubes/irc)
|
||||||
(require 'cubes/terminal)
|
(require 'cubes/terminal)
|
||||||
(require 'cubes/java)
|
(require 'cubes/java)
|
||||||
|
(require 'cubes/python)
|
||||||
(require 'cubes/snippets)
|
(require 'cubes/snippets)
|
||||||
(require 'cubes/org)
|
(require 'cubes/org)
|
||||||
(require 'cubes/git)
|
(require 'cubes/git)
|
||||||
|
@ -49,20 +50,28 @@
|
||||||
(t
|
(t
|
||||||
:background "#bd93f9" :height 0.1 :box nil))))
|
:background "#bd93f9" :height 0.1 :box nil))))
|
||||||
|
|
||||||
(defvar global-font-size 14)
|
(defvar global-font-size 10)
|
||||||
|
|
||||||
|
|
||||||
(setq lsp-clients-clangd-executable "/home/lxsameer/usr/lib/llvm-13rc2/bin/clangd")
|
(setq lsp-clients-clangd-executable "/home/lxsameer/usr/lib/llvm-13rc2/bin/clangd")
|
||||||
(defconst LLVM_DIR "/home/lxsameer/src/serene/llvm-project")
|
(defconst LLVM_DIR "/home/lxsameer/src/serene/llvm-project")
|
||||||
(defconst llvm-config-dir (concat LLVM_DIR "/llvm/utils/emacs/"))
|
(defconst llvm-config-dir (concat LLVM_DIR "/llvm/utils/emacs/"))
|
||||||
|
(defconst mlir-config-dir (concat LLVM_DIR "/mlir/utils/emacs/"))
|
||||||
|
|
||||||
(add-hook 'c++-mode-hook (lambda ()
|
(add-hook 'c++-mode-hook (lambda ()
|
||||||
(load (concat llvm-config-dir "emacs.el"))
|
(load (concat llvm-config-dir "emacs.el"))
|
||||||
(load (concat llvm-config-dir "llvm-mode.el"))
|
(load (concat llvm-config-dir "llvm-mode.el"))
|
||||||
(load (concat llvm-config-dir "tablegen-mode.el"))))
|
(load (concat llvm-config-dir "tablegen-mode.el"))))
|
||||||
|
|
||||||
|
(autoload 'mlir-mode (concat mlir-config-dir "mlir-mode") "Code highlighting for MLIR" t)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.mlir\\'" . mlir-mode))
|
||||||
|
|
||||||
|
|
||||||
|
(autoload 'llvm-mode (concat llvm-config-dir "llvm-mode") "Code highlighting for LLVMIR" t)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.llvmir\\'" . llvm-mode))
|
||||||
|
|
||||||
|
(autoload 'tablegen-mode (concat llvm-config-dir "tablegen-mode") "Code highlighting for tablegen" t)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.td\\'" . tablegen-mode))
|
||||||
|
|
||||||
;; =========== FG42 stuff ===============================
|
;; =========== FG42 stuff ===============================
|
||||||
;; (use-flags wm font-icons cursor-type
|
;; (use-flags wm font-icons cursor-type
|
||||||
|
@ -74,6 +83,7 @@
|
||||||
(use-flags
|
(use-flags
|
||||||
(fg42/merge-with-default-flags
|
(fg42/merge-with-default-flags
|
||||||
wm
|
wm
|
||||||
|
python
|
||||||
golang
|
golang
|
||||||
rcirc
|
rcirc
|
||||||
vterm
|
vterm
|
||||||
|
@ -96,6 +106,7 @@
|
||||||
(use-flags
|
(use-flags
|
||||||
(fg42/merge-with-default-flags
|
(fg42/merge-with-default-flags
|
||||||
wm
|
wm
|
||||||
|
-python
|
||||||
-golang
|
-golang
|
||||||
rcirc
|
rcirc
|
||||||
vterm
|
vterm
|
||||||
|
@ -122,6 +133,7 @@
|
||||||
(fg42/company-cube)
|
(fg42/company-cube)
|
||||||
(fg42/lsp-cube)
|
(fg42/lsp-cube)
|
||||||
(fg42/c++-cube)
|
(fg42/c++-cube)
|
||||||
|
(fg42/python-cube)
|
||||||
(fg42/yaml-cube)
|
(fg42/yaml-cube)
|
||||||
(fg42/flycheck-cube)
|
(fg42/flycheck-cube)
|
||||||
(fg42/org-cube)
|
(fg42/org-cube)
|
||||||
|
@ -148,5 +160,7 @@
|
||||||
;;(global-set-key (kbd "C-,") 'previous-line)
|
;;(global-set-key (kbd "C-,") 'previous-line)
|
||||||
;;(global-set-key (kbd "C-.") 'next-line)
|
;;(global-set-key (kbd "C-.") 'next-line)
|
||||||
|
|
||||||
|
(set-face-attribute 'region nil :background "#888")
|
||||||
|
|
||||||
(provide '.fg42)
|
(provide '.fg42)
|
||||||
;;; .fg42.v3.el ends here
|
;;; .fg42.v3.el ends here
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
;;; AllCubes --- An index to use import all the cubes at once -*- lexical-binding: t; -*-
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2010-2021 Sameer Rahmani & Contributors
|
||||||
|
;;
|
||||||
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
;; URL: https://gitlab.com/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 <http://www.gnu.org/licenses/>.
|
||||||
|
;;
|
||||||
|
;;; Commentary:
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'fg42/flags)
|
||||||
|
(require 'cubes/editor)
|
||||||
|
(require 'cubes/elisp)
|
||||||
|
(require 'cubes/region-expansion)
|
||||||
|
(require 'cubes/wm)
|
||||||
|
(require 'cubes/modeline)
|
||||||
|
(require 'cubes/autocompletion)
|
||||||
|
(require 'cubes/golang)
|
||||||
|
(require 'cubes/project)
|
||||||
|
(require 'cubes/irc)
|
||||||
|
(require 'cubes/terminal)
|
||||||
|
(require 'cubes/java)
|
||||||
|
(require 'cubes/python)
|
||||||
|
(require 'cubes/snippets)
|
||||||
|
(require 'cubes/org)
|
||||||
|
(require 'cubes/git)
|
||||||
|
(require 'cubes/bookmark)
|
||||||
|
(require 'cubes/terraform)
|
||||||
|
|
||||||
|
(provide 'cubes/all)
|
||||||
|
;;; all.el ends here
|
|
@ -25,7 +25,8 @@
|
||||||
(require 'fg42/cube)
|
(require 'fg42/cube)
|
||||||
|
|
||||||
(defcube fg42/flycheck-cube
|
(defcube fg42/flycheck-cube
|
||||||
(:docs "cubes/fg42/flycheck-cube.org"
|
"This cube adds the `flycheck' support to fg42."
|
||||||
|
(:title "Flycheck cube"
|
||||||
:flag flycheck)
|
:flag flycheck)
|
||||||
(fpkg/use flycheck
|
(fpkg/use flycheck
|
||||||
:defer ()
|
:defer ()
|
||||||
|
@ -34,13 +35,15 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/yaml-cube
|
(defcube fg42/yaml-cube
|
||||||
(:docs "cubes/fg42/prog-cubes.org"
|
"Yaml Support"
|
||||||
|
(:title "Yaml Support"
|
||||||
:no-flag t)
|
:no-flag t)
|
||||||
(fpkg/use yaml-mode))
|
(fpkg/use yaml-mode))
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/lsp-cube
|
(defcube fg42/lsp-cube
|
||||||
(:docs "cubes/fg42/lsp-cube.org"
|
"LSP cube"
|
||||||
|
(:title "LSP cube"
|
||||||
:flag lsp)
|
:flag lsp)
|
||||||
|
|
||||||
(fpkg/use lsp-mode
|
(fpkg/use lsp-mode
|
||||||
|
@ -55,7 +58,8 @@
|
||||||
(add-hook 'lsp-mode-hook 'lsp-ui-mode)))
|
(add-hook 'lsp-mode-hook 'lsp-ui-mode)))
|
||||||
|
|
||||||
(defcube fg42/cmake-cube
|
(defcube fg42/cmake-cube
|
||||||
(:docs "cubes/fg42/cpp-cube.org"
|
"Cmake cube"
|
||||||
|
(:title "CMake cube"
|
||||||
:flag-default t
|
:flag-default t
|
||||||
:flag cmake)
|
:flag cmake)
|
||||||
|
|
||||||
|
@ -64,7 +68,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/c++-cube
|
(defcube fg42/c++-cube
|
||||||
(:docs "cubes/fg42/cpp-cube.org"
|
"C++ cube"
|
||||||
|
(:title "C++ cube"
|
||||||
:no-flag t)
|
:no-flag t)
|
||||||
(fg42/cmake-cube)
|
(fg42/cmake-cube)
|
||||||
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
|
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
|
||||||
|
@ -78,7 +83,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/company-cube
|
(defcube fg42/company-cube
|
||||||
(:docs "cubes/fg42/company-cube.org"
|
"Auto complete using company mode"
|
||||||
|
(:title "Company cube"
|
||||||
:flag company)
|
:flag company)
|
||||||
|
|
||||||
(fpkg/use company
|
(fpkg/use company
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/bookmark-cube
|
(defcube fg42/bookmark-cube
|
||||||
(:docs "cubes/fg42/bookmark-cube.org"
|
"bookmark cube"
|
||||||
|
(:title "cubes/fg42/bookmark-cube.org"
|
||||||
:flag bookmark
|
:flag bookmark
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/pinentry-cube
|
(defcube fg42/pinentry-cube
|
||||||
(:docs "cubes/fg42/pinentry-cube.org"
|
"Pinentry cube with setup the =pinentry= program to be used within FG42."
|
||||||
|
(:title "Pinentry cube"
|
||||||
:flag pinentry
|
:flag pinentry
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
(fpkg/use pinentry
|
(fpkg/use pinentry
|
||||||
|
@ -44,7 +45,8 @@
|
||||||
(pinentry-start))))
|
(pinentry-start))))
|
||||||
|
|
||||||
(defcube fg42/imenu-cube
|
(defcube fg42/imenu-cube
|
||||||
(:docs "cubes/fg42/imenu-cube.org"
|
"Imenu support"
|
||||||
|
(:title "Imenu cube"
|
||||||
:flag imenu
|
:flag imenu
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
(fpkg/use imenu-list
|
(fpkg/use imenu-list
|
||||||
|
@ -53,7 +55,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/exec-path-cube
|
(defcube fg42/exec-path-cube
|
||||||
(:docs "cubes/fg42/exec-path-cube.org"
|
"This cube fixes the =exec-path-from-shell= issue on MacOS."
|
||||||
|
(:title "Exec path cube"
|
||||||
:flag exec-path-from-shell
|
:flag exec-path-from-shell
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
(fpkg/use exec-path-from-shell
|
(fpkg/use exec-path-from-shell
|
||||||
|
@ -63,7 +66,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/hl-cube
|
(defcube fg42/hl-cube
|
||||||
(:docs "cubes/fg42/hl-path-cube.org"
|
"This cube highlight the curret line."
|
||||||
|
(:title "Current line highlight cube"
|
||||||
:flag hl-line
|
:flag hl-line
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
(require 'hl-line)
|
(require 'hl-line)
|
||||||
|
@ -71,7 +75,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/cursor-cube
|
(defcube fg42/cursor-cube
|
||||||
(:docs "cubes/fg42/cursor-cube.org"
|
"This cube controls the shape of the cursor."
|
||||||
|
(:title "Cursor cube"
|
||||||
:flag cursor-type
|
:flag cursor-type
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
(let ((ctype (or (plist-get fg42/cursor-cube-params :type) 'box))
|
(let ((ctype (or (plist-get fg42/cursor-cube-params :type) 'box))
|
||||||
|
@ -82,9 +87,9 @@
|
||||||
(set-default 'cursor-type ctype)
|
(set-default 'cursor-type ctype)
|
||||||
(set-cursor-color ccolor)))))
|
(set-cursor-color ccolor)))))
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/buffer-navigation-cube
|
(defcube fg42/buffer-navigation-cube
|
||||||
(:docs "cubes/fg42/buffer-navigation-cube.org"
|
"This cube controls the different aspect of buffer navigation"
|
||||||
|
(:title "Buffer navigation cube"
|
||||||
:flag buffer-navigation
|
:flag buffer-navigation
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
@ -93,7 +98,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/window-navigation-cube
|
(defcube fg42/window-navigation-cube
|
||||||
(:docs "cubes/fg42/window-navigation-cube.org"
|
"This cube controls the different aspect of buffer navigation"
|
||||||
|
(:title "Window navigation cube"
|
||||||
:flag window-navigation
|
:flag window-navigation
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
@ -102,7 +108,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/font-cube
|
(defcube fg42/font-cube
|
||||||
(:docs "cubes/fg42/font-cube.org"
|
"This cube controls the font configuration of *FG42*"
|
||||||
|
(:title "Font Cube"
|
||||||
:no-flag t
|
:no-flag t
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
@ -116,8 +123,11 @@
|
||||||
|
|
||||||
(set-face-attribute 'default t :font font)))
|
(set-face-attribute 'default t :font font)))
|
||||||
|
|
||||||
(defcube fg42/dracula-theme-cube
|
|
||||||
(:docs "cubes/fg42/dracula-theme-cube.org"
|
;TODO: Replace this cube with a `theme-cube'
|
||||||
|
(defcube fg42/dracula-theme-cubez
|
||||||
|
"Replace this with a theme cube"
|
||||||
|
(:title "Dracula theme"
|
||||||
:no-flag t)
|
:no-flag t)
|
||||||
(require 'fg42/themes)
|
(require 'fg42/themes)
|
||||||
|
|
||||||
|
@ -137,7 +147,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/selectrum-cube
|
(defcube fg42/selectrum-cube
|
||||||
(:docs "cubes/fg42/editor-cube.org"
|
"This cube adds support for `selectrum' to FG42"
|
||||||
|
(:title "Selectrum cube"
|
||||||
:flag selectrum
|
:flag selectrum
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
(fpkg/use selectrum
|
(fpkg/use selectrum
|
||||||
|
@ -161,7 +172,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/editor-cube
|
(defcube fg42/editor-cube
|
||||||
(:docs "cubes/fg42/editor-cube.org"
|
"This is a meta cube that sets up the basic functionalities of an Editor"
|
||||||
|
(:title "Editor cube"
|
||||||
:no-flag t)
|
:no-flag t)
|
||||||
|
|
||||||
(fpkg/use rainbow-delimiters
|
(fpkg/use rainbow-delimiters
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/elisp-cube
|
(defcube fg42/elisp-cube
|
||||||
(:docs "cubes/fg42/elisp-cube.org"
|
"Elisp cube"
|
||||||
|
(:title "cubes/fg42/elisp-cube.org"
|
||||||
:no-flag t)
|
:no-flag t)
|
||||||
|
|
||||||
(fpkg/use rainbow-delimiters
|
(fpkg/use rainbow-delimiters
|
||||||
|
|
|
@ -34,33 +34,34 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/fm-cube
|
(defcube fg42/fm-cube
|
||||||
(:docs "cubes/fg42/fm-cube.org"
|
"file manager"
|
||||||
:flag fm
|
(:title "cubes/fg42/fm-cube.org"
|
||||||
:flag-default t)
|
:flag fm
|
||||||
|
:flag-default t)
|
||||||
|
|
||||||
;; Linux only
|
;; Linux only
|
||||||
;; TODO: change this to support OS X
|
;; TODO: change this to support OS X
|
||||||
(setq dired-listing-switches "-lFaGh1v --group-directories-first")
|
(setq dired-listing-switches "-lFaGh1v --group-directories-first")
|
||||||
|
|
||||||
;; Show directories first
|
;; Show directories first
|
||||||
(setq ls-lisp-dirs-first t)
|
(setq ls-lisp-dirs-first t)
|
||||||
|
|
||||||
(setq dired-recursive-copies 'always)
|
(setq dired-recursive-copies 'always)
|
||||||
(setq dired-recursive-deletes 'always)
|
(setq dired-recursive-deletes 'always)
|
||||||
|
|
||||||
(define-key dired-mode-map (kbd "E") 'fg42/dired-external-open)
|
(define-key dired-mode-map (kbd "E") 'fg42/dired-external-open)
|
||||||
(fpkg/use dired+)
|
(fpkg/use dired+)
|
||||||
(add-to-list 'dired-mode-hook
|
(add-to-list 'dired-mode-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(require 'dired-x)
|
(require 'dired-x)
|
||||||
(require 'dired-aux)))
|
(require 'dired-aux)))
|
||||||
|
|
||||||
(when-flag async
|
(when-flag async
|
||||||
(dired-async-mode 1))
|
(dired-async-mode 1))
|
||||||
|
|
||||||
(fpkg/use dired-narrow
|
(fpkg/use dired-narrow
|
||||||
:bind (:map dired-mode-map
|
:bind (:map dired-mode-map
|
||||||
("/" . dired-narrow))))
|
("/" . dired-narrow))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'cubes/fm)
|
(provide 'cubes/fm)
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/git-cube
|
(defcube fg42/git-cube
|
||||||
(:docs "cubes/fg42/git-cube.org"
|
"Git cube"
|
||||||
|
(:title "cubes/fg42/git-cube.org"
|
||||||
:flag git
|
:flag git
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
(autoload-cube 'fg42/initialize-golang "golang/core.el" "Initalize the go mode.")
|
(autoload-cube 'fg42/initialize-golang "golang/core.el" "Initalize the go mode.")
|
||||||
|
|
||||||
(defcube fg42/golang-cube
|
(defcube fg42/golang-cube
|
||||||
(:docs "cubes/fg42/golang-cube.org"
|
"Golang support cube for fg42."
|
||||||
:flag golang)
|
(:title "Golang cube" :flag golang)
|
||||||
|
|
||||||
(fpkg/use go-mode
|
(fpkg/use go-mode
|
||||||
:defer t
|
:defer t
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/rcirc-cube
|
(defcube fg42/rcirc-cube
|
||||||
(:docs "cubes/fg42/rcirc-cube.org"
|
"IRC cube"
|
||||||
|
(:title "cubes/fg42/rcirc-cube.org"
|
||||||
:flag rcirc)
|
:flag rcirc)
|
||||||
(autoload-cube 'fg42/rcirc-connect "irc/core.el" "Connect to IRC via RCIRC." t)
|
(autoload-cube 'fg42/rcirc-connect "irc/core.el" "Connect to IRC via RCIRC." t)
|
||||||
(defun fg42/connect-to-irc ()
|
(defun fg42/connect-to-irc ()
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/gradle-cube
|
(defcube fg42/gradle-cube
|
||||||
(:docs "cubes/fg42/java-cube.org"
|
"Gradle support"
|
||||||
|
(:title "cubes/fg42/java-cube.org"
|
||||||
:flag gradle
|
:flag gradle
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
@ -41,7 +42,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/java-cube
|
(defcube fg42/java-cube
|
||||||
(:docs "cubes/fg42/java-cube.org"
|
"Java cube"
|
||||||
|
(:title "cubes/fg42/java-cube.org"
|
||||||
:flag java
|
:flag java
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
;; TODO: Break this into two cubes
|
;; TODO: Break this into two cubes
|
||||||
(defcube fg42/modeline-cube
|
(defcube fg42/modeline-cube
|
||||||
(:docs "cubes/fg42/modeline-cube.org"
|
"Modeline cube"
|
||||||
|
(:title "cubes/fg42/modeline-cube.org"
|
||||||
:flag smart-mode-line
|
:flag smart-mode-line
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
(require 'fg42/cube)
|
(require 'fg42/cube)
|
||||||
|
|
||||||
(defcube fg42/org-cube
|
(defcube fg42/org-cube
|
||||||
(:docs "cubes/fg42/org-cube.org"
|
"Org cube"
|
||||||
|
(:title "cubes/fg42/org-cube.org"
|
||||||
:flag org
|
:flag org
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/projectile-cube
|
(defcube fg42/projectile-cube
|
||||||
(:docs "cubes/fg42/projectile-cube.org"
|
"Projectile Cube"
|
||||||
|
(:title "cubes/fg42/projectile-cube.org"
|
||||||
:flag projectile
|
:flag projectile
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
;;; PythonCubes --- The Python cubes for FG42 -*- lexical-binding: t; -*-
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2010-2021 Sameer Rahmani & Contributors
|
||||||
|
;;
|
||||||
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
||||||
|
;; URL: https://gitlab.com/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 <http://www.gnu.org/licenses/>.
|
||||||
|
;;
|
||||||
|
;;; Commentary:
|
||||||
|
;;; Code:
|
||||||
|
(require 'fpkg)
|
||||||
|
(require 'fg42/cube)
|
||||||
|
(require 'fg42/utils)
|
||||||
|
|
||||||
|
|
||||||
|
(defun fg42/py-workon-project-venv ()
|
||||||
|
"Call pyenv-workon with the current projectile project name.
|
||||||
|
This will return the full path of the associated virtual
|
||||||
|
environment found in $WORKON_HOME, or nil if the environment does
|
||||||
|
not exist."
|
||||||
|
(require 'pyenv)
|
||||||
|
(let ((pname (projectile-project-name)))
|
||||||
|
(pyvenv-workon pname)
|
||||||
|
(if (file-directory-p pyvenv-virtual-env)
|
||||||
|
pyvenv-virtual-env
|
||||||
|
(pyvenv-deactivate))))
|
||||||
|
|
||||||
|
|
||||||
|
(defun fg42/py-auto-lsp ()
|
||||||
|
"Turn on lsp mode in a Python project with some automated logic.
|
||||||
|
Try to automatically determine which pyenv virtual environment to
|
||||||
|
activate based on the project name, using
|
||||||
|
`dd/py-workon-project-venv'. If successful, call `lsp'. If we
|
||||||
|
cannot determine the virtualenv automatically, first call the
|
||||||
|
interactive `pyvenv-workon' function before `lsp'"
|
||||||
|
(interactive)
|
||||||
|
(let ((pvenv (fg42/py-workon-project-venv)))
|
||||||
|
(if pvenv
|
||||||
|
(lsp)
|
||||||
|
(progn
|
||||||
|
(call-interactively #'pyvenv-workon)
|
||||||
|
(lsp)))))
|
||||||
|
|
||||||
|
|
||||||
|
(defcube fg42/python-cube
|
||||||
|
"Python support cube."
|
||||||
|
(:title "Python cube"
|
||||||
|
:flag python)
|
||||||
|
|
||||||
|
(fpkg/use pyvenv
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(setenv "WORKON_HOME" "~/.pyenv/versions"))
|
||||||
|
|
||||||
|
(when-flag lsp
|
||||||
|
(with-eval-after-load "lsp"
|
||||||
|
(lsp-register-custom-settings
|
||||||
|
'(("pyls.plugins.pyls_mypy.enabled" t t)
|
||||||
|
("pyls.plugins.flake8.enabled" t t)
|
||||||
|
("pyls.plugins.pyls_mypy.live_mode" nil t)
|
||||||
|
("pyls.plugins.pyls_black.enabled" t t)
|
||||||
|
("pyls.plugins.pyls_isort.enabled" t t)))
|
||||||
|
(add-hook 'python-mode #'fg42/py-auto-lsp))))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'cubes/python)
|
||||||
|
;;; python.el ends here
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/region-expansion-cube
|
(defcube fg42/region-expansion-cube
|
||||||
(:docs "cubes/fg42/region-expansion.org")
|
"RE cube"
|
||||||
|
(:title "cubes/fg42/region-expansion.org")
|
||||||
|
|
||||||
(fpkg/use expand-region
|
(fpkg/use expand-region
|
||||||
:bind ("C-=" . er/expand-region)))
|
:bind ("C-=" . er/expand-region)))
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
(require 'fg42/cube)
|
(require 'fg42/cube)
|
||||||
|
|
||||||
(defcube fg42/yasnippet-cube
|
(defcube fg42/yasnippet-cube
|
||||||
(:docs "cubes/fg42/yasnippet-cube.org"
|
"Yasnippet cube"
|
||||||
|
(:title "cubes/fg42/yasnippet-cube.org"
|
||||||
:flag yasnippet
|
:flag yasnippet
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
(require 'fg42/cube)
|
(require 'fg42/cube)
|
||||||
|
|
||||||
(defcube fg42/vterm-cube
|
(defcube fg42/vterm-cube
|
||||||
(:docs "cubes/fg42/vterm-cube.org"
|
"Vterm cube"
|
||||||
|
(:title "cubes/fg42/vterm-cube.org"
|
||||||
:flag vterm)
|
:flag vterm)
|
||||||
(let ((_shell (or (plist-get fg42/vterm-cube-params :shell)
|
(let ((_shell (or (plist-get fg42/vterm-cube-params :shell)
|
||||||
(getenv "SHELL"))))
|
(getenv "SHELL"))))
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/terraform-cube
|
(defcube fg42/terraform-cube
|
||||||
(:docs "cubes/fg42/terraform-cube.org"
|
"terraform cube"
|
||||||
|
(:title "cubes/fg42/terraform-cube.org"
|
||||||
:flag terraform
|
:flag terraform
|
||||||
:flag-default t)
|
:flag-default t)
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,9 @@
|
||||||
|
|
||||||
|
|
||||||
(defcube fg42/wm-cube
|
(defcube fg42/wm-cube
|
||||||
(:docs "cubes/fg42/wm-cube.org"
|
"This cube will setup *FG42* to act as a window manager."
|
||||||
:no-flag t)
|
(:title "Window manager cube"
|
||||||
|
:no-flag t)
|
||||||
|
|
||||||
(if-flag wm
|
(if-flag wm
|
||||||
(when-wm
|
(when-wm
|
||||||
|
|
|
@ -29,16 +29,24 @@
|
||||||
(require 'fg42/utils)
|
(require 'fg42/utils)
|
||||||
|
|
||||||
|
|
||||||
(defmacro defcube (cube-name props &rest body)
|
(defvar fg42/available-cubes '()
|
||||||
"Define a cube with the given CUBE-NAME, a list of PROPS and a BODY."
|
"A list of all the registered cubes.")
|
||||||
(declare (indent defun))
|
|
||||||
|
|
||||||
|
(defmacro defcube (cube-name docs props &rest body)
|
||||||
|
"Define a cube with the given CUBE-NAME, a list of PROPS, DOCS and a BODY."
|
||||||
|
(declare (indent defun) (doc-string 2))
|
||||||
|
|
||||||
;; Make sure that props is a plist and contains the `:docs' key
|
;; Make sure that props is a plist and contains the `:docs' key
|
||||||
;; TODO: Maybe use `cl-check-type' here
|
;; TODO: Maybe use `cl-check-type' here
|
||||||
(when (not (plist-get props :docs))
|
(when (not (stringp docs))
|
||||||
(error "Missing docs key for '%s' cube" cube-name))
|
(error "Missing docstring for '%s' cube" cube-name))
|
||||||
|
|
||||||
(let ((cube-name-internal (intern (format "%s-internal" cube-name)))
|
(when (not (plist-get props :title))
|
||||||
|
(error "Missing :titel key for '%s' cube" cube-name))
|
||||||
|
|
||||||
|
(let ((complete-props (plist-put props :docs docs))
|
||||||
|
(cube-name-internal (intern (format "%s-internal" cube-name)))
|
||||||
(params-var (intern (format "%s-params" cube-name)))
|
(params-var (intern (format "%s-params" cube-name)))
|
||||||
(active-var (intern (format "%s-active-p" cube-name)))
|
(active-var (intern (format "%s-active-p" cube-name)))
|
||||||
(pre-lang-server-up-hook (intern (format "%s-pre-lang-server-up-hook" cube-name)))
|
(pre-lang-server-up-hook (intern (format "%s-pre-lang-server-up-hook" cube-name)))
|
||||||
|
@ -56,6 +64,8 @@
|
||||||
(flag-conflict (plist-get props :conflicts-with))
|
(flag-conflict (plist-get props :conflicts-with))
|
||||||
(no-flag? (or (plist-get props :no-flag) ())))
|
(no-flag? (or (plist-get props :no-flag) ())))
|
||||||
|
|
||||||
|
(add-to-list 'fg42/available-cubes cube-name)
|
||||||
|
|
||||||
`(progn
|
`(progn
|
||||||
|
|
||||||
;; Create a new flag for each cube to control the cubes systemwide.
|
;; Create a new flag for each cube to control the cubes systemwide.
|
||||||
|
@ -134,7 +144,10 @@
|
||||||
;; Otherwise check for the flag to be active
|
;; Otherwise check for the flag to be active
|
||||||
(if-flag ,flag-var
|
(if-flag ,flag-var
|
||||||
(,cube-name-internal params)
|
(,cube-name-internal params)
|
||||||
(message "The flag for '%s' cube is disabled. Skiping." ,(symbol-name cube-name))))))))
|
(message "The flag for '%s' cube is disabled. Skiping." ,(symbol-name cube-name)))))
|
||||||
|
|
||||||
|
;; Set the symbol-plist of the cube-name to its props
|
||||||
|
(setplist ',cube-name ',complete-props))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'fg42/cube)
|
(provide 'fg42/cube)
|
||||||
|
|
2
dev.org
2
dev.org
|
@ -37,7 +37,7 @@ On the first level, I should feel comfortable with it.
|
||||||
or other maintenance jobs
|
or other maintenance jobs
|
||||||
|
|
||||||
* Tasks
|
* Tasks
|
||||||
|
** TODO =fpkg/use= doesn't work with =:init=
|
||||||
** TODO Add a =:default= key to the cube indicating whether it should be enabled by default or not
|
** TODO Add a =:default= key to the cube indicating whether it should be enabled by default or not
|
||||||
** TODO Reformat the modeline
|
** TODO Reformat the modeline
|
||||||
** TODO Create a macro similar to =with-ability= to run a block of code only if the given cube was active
|
** TODO Create a macro similar to =with-ability= to run a block of code only if the given cube was active
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#+TITLE: FG42, The ultimate editor for true believers
|
|
||||||
|
|
||||||
- [[file:categories/nil.org][<<<title>>>]]
|
|
||||||
- [[file:tags/index.org][Tags]]
|
|
||||||
- [[file:categories/index.org][Categories]]
|
|
||||||
- [[file:index.org][The little nest of mine]]
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#+SETUPFILE: ../../../config.org
|
||||||
|
#+OPTIONS: toc:nil
|
||||||
|
#+TITLE: <<<:title>>>
|
||||||
|
#+PAGE: true
|
||||||
|
|
||||||
|
<<<:docs>>>
|
Loading…
Reference in New Issue