Skip to content

Commit

Permalink
tweak(prog): make ts-fold obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 16, 2023
1 parent b107371 commit ee7208a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
16 changes: 0 additions & 16 deletions modules/me-prog.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
;; 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 the used `ts-fold' fork uses the
;; built-in `treesit'
(when (+emacs-features-p 'tree-sitter)
(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)
;; TEMP: Normally, we don't have to hook it explicitly, but it seems that
;; `global-ts-fold-mode' isn't working correctly on `yaml-ts-mode'
:hook (yaml-ts-mode . ts-fold-mode)
:after treesit treesit-auto
:demand t
:init
(global-ts-fold-mode 1))

(use-package awk-ts-mode
:straight t
:when (+emacs-features-p 'tree-sitter))
Expand Down
8 changes: 1 addition & 7 deletions modules/obsolete/me-tree-sitter.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@

(use-package tree-sitter-langs
:straight t
:hook (minemacs-build-functions . tree-sitter-langs-install-grammars)
:preface
(+fn-inhibit-messages! tree-sitter-langs-install-grammars)
:after tree-sitter
:demand t)

(use-package ts-fold
:straight (:host github :repo "emacs-tree-sitter/ts-fold")
:after tree-sitter
:demand t
:init
(global-ts-fold-mode 1))


(provide 'obsolete/me-tree-sitter)

Expand Down
36 changes: 36 additions & 0 deletions modules/obsolete/me-ts-fold.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
;;; me-ts-fold.el --- Tree-sitter code folding -*- lexical-binding: t; -*-

;; Copyright (C) 2022-2023 Abdelhak Bougouffa

;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")

;;; Commentary:

;;; Code:

(if (not (+emacs-features-p 'tree-sitter))
(use-package ts-fold ; tree-sitter
:straight (:host github :repo "emacs-tree-sitter/ts-fold")
:after tree-sitter
:demand t
:init
(global-ts-fold-mode 1))

;; To avoid installing `tree-sitter' as the used `ts-fold' fork uses the
;; built-in `treesit'
(push 'tree-sitter straight-built-in-pseudo-packages)
(use-package ts-fold ; treesit
:straight (:host github :repo "abougouffa/ts-fold" :branch "andrew-sw/treesit-el-support")
:when (+emacs-features-p 'tree-sitter)
;; TEMP: Normally, we don't have to hook it explicitly, but it seems that
;; `global-ts-fold-mode' isn't working correctly on `yaml-ts-mode'
:hook (yaml-ts-mode . ts-fold-mode)
:after treesit treesit-auto
:demand t
:init
(global-ts-fold-mode 1)))


(provide 'obsolete/me-ts-fold)

;;; me-ts-fold.el ends here
1 change: 1 addition & 0 deletions skel/modules.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
;; '(obsolete/me-cov ; Show code coverage results (cov, ...)
;; obsolete/me-eaf ; EAF apps (browser, jupyter, file-sender, ...)
;; obsolete/me-evil-escape ; Escape without ESC (evil-escape, ...)
;; obsolete/me-ts-fold ; Code folding with tree-sitter
;; obsolete/me-flycheck ; Static checkers (flycheck, ...)
;; obsolete/me-lexic ; Offline dictionary using sdcv
;; obsolete/me-maxima ; Maxima CAS (maxima, imaxima)
Expand Down

0 comments on commit ee7208a

Please sign in to comment.