Skip to content

Commit

Permalink
tweak: rewrite conditional package installs
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jun 23, 2023
1 parent cb5686a commit da579e7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 41 deletions.
6 changes: 2 additions & 4 deletions modules/me-eaf.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

;;; Code:

(when (+emacs-features-p 'lucid)
;; EAF don't work on LUCID, a.k.a. XEmacs.
(add-to-list 'minemacs-disabled-packages 'eaf))

(use-package eaf
:straight (:host github :repo "emacs-eaf/emacs-application-framework" :files (:defaults "*"))
:hook (minemacs-build-functions . eaf-install-and-update)
;; EAF don't work on LUCID, a.k.a. XEmacs.
:when (not (+emacs-features-p 'lucid))
:init
(+map! "oo" #'eaf-open)
;; Evil integration doesn't work, start `eaf-mode' in `emacs-state'.
Expand Down
7 changes: 2 additions & 5 deletions modules/me-lisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@

;;; Code:

(unless (+emacs-features-p 'modules)
(add-to-list 'minemacs-disabled-packages 'parinfer-rust-mode))

(use-package parinfer-rust-mode
:straight t
:when (eq sys/arch 'x86_64)
:when (and (+emacs-features-p 'modules) (eq sys/arch 'x86_64))
:custom
(parinfer-rust-library-directory (concat minemacs-local-dir "parinfer-rust/"))
(parinfer-rust-auto-download (eq sys/arch 'x86_64))
:hook emacs-lisp-mode clojure-mode scheme-mode lisp-mode racket-mode hy-mode
:hook emacs-lisp-mode clojure-mode scheme-mode common-lisp-mode lisp-mode racket-mode hy-mode
:config
(defvar-local +parinter-rust--was-enabled-p nil)

Expand Down
68 changes: 36 additions & 32 deletions modules/me-prog.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,43 @@

;;; Code:

(if (not (+emacs-features-p 'tree-sitter))
;; Use the external `tree-sitter' module
(+load minemacs-modules-dir "obsolete/me-tree-sitter.el")
(unless (+emacs-features-p 'tree-sitter)
;; Use the external `tree-sitter' module
(+load minemacs-modules-dir "obsolete/me-tree-sitter.el"))

;; Use built-in `treesit' when available
(use-package treesit
:straight (:type built-in)
:custom
(treesit-font-lock-level 4))

(use-package treesit-auto
:straight (:host github :repo "renzmann/treesit-auto")
:hook (minemacs-after-startup . global-treesit-auto-mode)
:hook (minemacs-build-functions . treesit-auto-install-all)
:custom
(treesit-auto-install 'prompt)
:config
;; Install all languages when calling `treesit-auto-install-all'
(setq treesit-language-source-alist (treesit-auto--build-treesit-source-alist)))

;; To avoid installing `tree-sitter' as this fork uses the built-in `treesit'
(push 'tree-sitter straight-built-in-pseudo-packages)

(use-package ts-fold
:straight (:host github :repo "abougouffa/ts-fold" :branch "andrew-sw/treesit-el-support")
:after treesit treesit-auto
:hook (minemacs-after-startup . global-ts-fold-mode))

(use-package combobulate
:straight t
:hook python-ts-mode js-ts-mode css-ts-mode yaml-ts-mode typescript-ts-mode tsx-ts-mode
:custom
(combobulate-key-prefix "C-c o")))
;; Use built-in `treesit' when available
(use-package treesit
:straight (:type built-in)
:when (+emacs-features-p 'tree-sitter)
:custom
(treesit-font-lock-level 4))

(use-package treesit-auto
:straight (:host github :repo "renzmann/treesit-auto")
:when (+emacs-features-p 'tree-sitter)
:hook (minemacs-after-startup . global-treesit-auto-mode)
:hook (minemacs-build-functions . treesit-auto-install-all)
:custom
(treesit-auto-install 'prompt)
:config
;; Install all languages when calling `treesit-auto-install-all'
(setq treesit-language-source-alist (treesit-auto--build-treesit-source-alist)))

;; To avoid installing `tree-sitter' as this fork uses the built-in `treesit'
(push 'tree-sitter straight-built-in-pseudo-packages)

(use-package ts-fold
:straight (:host github :repo "abougouffa/ts-fold" :branch "andrew-sw/treesit-el-support")
:when (+emacs-features-p 'tree-sitter)
:after treesit treesit-auto
:hook (minemacs-after-startup . global-ts-fold-mode))

(use-package combobulate
:straight t
:when (+emacs-features-p 'tree-sitter)
:hook python-ts-mode js-ts-mode css-ts-mode yaml-ts-mode typescript-ts-mode tsx-ts-mode
:custom
(combobulate-key-prefix "C-c o"))

(use-package hideif
:straight (:type built-in)
Expand Down

0 comments on commit da579e7

Please sign in to comment.