emacs: replace projectile integrations with project.el variants

This commit is contained in:
2026-05-06 15:10:28 -07:00
parent 34793d7075
commit f6b2a1ae8c
2 changed files with 69 additions and 55 deletions

View File

@@ -58,8 +58,8 @@ think its pretty awesome!
([[https://github.com/IvanMalison/emit#compose][README]]) ([[https://github.com/IvanMalison/emit#compose][README]])
+ [[Add a blacklist to a major mode]] + [[Add a blacklist to a major mode]]
** Configuration of My Own Packages ** Configuration of My Own Packages
- [[term-projectile][term-projectile]] and [[term-manager][term-manager]] - [[term-project][term-project]] and [[term-manager][term-manager]]
- [[org-projectile][org-projectile]] - [[org-project-capture][org-project-capture]]
- [[multi-line][multi-line]] - [[multi-line][multi-line]]
- [[github-search][github-search]] - [[github-search][github-search]]
- [[flimenu][flimenu]] - [[flimenu][flimenu]]
@@ -1758,7 +1758,6 @@ bind-key and global-set-key forms.
(use-package project (use-package project
:ensure nil :ensure nil
:demand t :demand t
:bind (("C-c 7" . project-shell))
:bind-keymap :bind-keymap
("C-c p" . project-prefix-map) ("C-c p" . project-prefix-map)
:custom :custom
@@ -1985,14 +1984,14 @@ bind-key and global-set-key forms.
`(defun ,(intern (concat "imalison:embark-project-file-" (symbol-name command))) (filepath) `(defun ,(intern (concat "imalison:embark-project-file-" (symbol-name command))) (filepath)
(imalison:embark-project-act-for-file filepath (,command)))) (imalison:embark-project-act-for-file filepath (,command))))
(imalison:build-embark-project-for-file project-shell) (imalison:build-embark-project-for-file term-project-forward)
(imalison:build-embark-project-for-file magit-status) (imalison:build-embark-project-for-file magit-status)
(imalison:build-embark-project-for-file consult-ripgrep) (imalison:build-embark-project-for-file consult-ripgrep)
(setq embark-prompter #'embark-keymap-prompter) (setq embark-prompter #'embark-keymap-prompter)
(define-key embark-general-map (kbd "t") (define-key embark-general-map (kbd "t")
#'imalison:embark-project-file-project-shell) #'imalison:embark-project-file-term-project-forward)
(define-key embark-general-map (kbd "m") (define-key embark-general-map (kbd "m")
#'imalison:embark-project-file-magit-status) #'imalison:embark-project-file-magit-status)
@@ -2006,7 +2005,7 @@ bind-key and global-set-key forms.
(defvar-keymap imalison:project-embark-map (defvar-keymap imalison:project-embark-map
:doc "Keymap for actions on projects" :doc "Keymap for actions on projects"
"m" #'imalison:embark-project-file-magit-status "m" #'imalison:embark-project-file-magit-status
"t" #'imalison:embark-project-file-project-shell "t" #'imalison:embark-project-file-term-project-forward
"s" #'imalison:embark-project-file-consult-ripgrep))) "s" #'imalison:embark-project-file-consult-ripgrep)))
(use-package embark-consult (use-package embark-consult
@@ -3467,19 +3466,20 @@ in term-mode. This makes term-mode 1000% more useful
(advice-add (advice-add
'term-manager-default-build-term :after 'imalison:set-escape-char))) 'term-manager-default-build-term :after 'imalison:set-escape-char)))
#+END_SRC #+END_SRC
** term-projectile ** term-project
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package term-projectile (use-package term-project
:disabled t :ensure (term-project :files ("term-project.el")
:host github :repo "colonelpanic8/term-manager")
:bind ("C-c 7" . imalison:term-hydra-global/body) :bind ("C-c 7" . imalison:term-hydra-global/body)
:commands :commands
(term-projectile-backward (term-project-backward
term-projectile-create-new term-project-create-new
term-projectile-create-new-default-directory term-project-default-directory-backward
term-projectile-default-directory-backward term-project-default-directory-create-new
term-projectile-default-directory-forward term-project-default-directory-forward
term-projectile-forward term-project-forward
term-projectile-switch) term-project-switch)
:config :config
(progn (progn
(use-package term-manager-eat (use-package term-manager-eat
@@ -3487,37 +3487,51 @@ in term-mode. This makes term-mode 1000% more useful
:ensure :ensure
(term-manager-eat :files ("term-manager-eat.el") (term-manager-eat :files ("term-manager-eat.el")
:host github :repo "colonelpanic8/term-manager")) :host github :repo "colonelpanic8/term-manager"))
(setq term-projectile-term-manager (term-projectile :build-term 'term-manager-eat-build-term)) (require 'term-manager-eat)
(defun term-project-get-symbol-for-buffer (buffer)
"Get the project root symbol for BUFFER, falling back to its directory."
(term-project-maybe-intern
(with-current-buffer buffer
(if (or (derived-mode-p 'term-mode)
(derived-mode-p 'eat-mode))
default-directory
(imalison:project-root)))))
(setq term-project-term-manager
(term-project :build-term 'term-manager-eat-build-term))
(term-manager-enable-eat-buffer-renaming-and-reindexing
term-project-term-manager)
(emit-prefix-selector imalison:term (emit-prefix-selector imalison:term
term-projectile-forward term-project-forward
term-projectile-create-new) term-project-create-new)
(defvar imalison:term-hydra-original-default-directory) (defvar imalison:term-hydra-original-default-directory)
(defhydra imalison:term-hydra-default-directory (defhydra imalison:term-hydra-default-directory
(:body-pre (:body-pre
(term-projectile-default-directory-forward-restored)) (term-project-default-directory-forward-restored))
"term - default-directory" "term - default-directory"
("s" term-projectile-switch-to "Switch to existing") ("s" term-project-switch-to "Switch to existing")
("f" term-projectile-default-directory-forward-restored "Forward for current directory terminals") ("f" term-project-default-directory-forward-restored "Forward for current directory terminals")
("b" term-projectile-default-directory-backward-restored "Backward for current directory terminals") ("b" term-project-default-directory-backward-restored "Backward for current directory terminals")
("c" term-projectile-default-directory-create-new-restored "Create new current directory terminal") ("c" term-project-default-directory-create-new-restored "Create new current directory terminal")
("d" term-projectile-default-directory-forward-restored "Switch/Create default directory terminal") ("d" term-project-default-directory-forward-restored "Switch/Create default directory terminal")
("g" imalison:term-hydra-global/body-restored "Switch/Create global terminal" :exit t) ("g" imalison:term-hydra-global/body-restored "Switch/Create global terminal" :exit t)
("p" imalison:term-hydra-projectile/body-restored "Switch/Create project terminal" :exit t)) ("p" imalison:term-hydra-project/body-restored "Switch/Create project terminal" :exit t))
(defhydra imalison:term-hydra-projectile (defhydra imalison:term-hydra-project
(:body-pre (:body-pre
(progn (progn
(term-projectile-forward-restored))) (term-project-forward-restored)))
"term - projectile" "term - project"
("s" term-projectile-switch-to "Switch to existing") ("s" term-project-switch-to "Switch to existing")
("f" term-projectile-forward-restored "Forward for project terminals") ("f" term-project-forward-restored "Forward for project terminals")
("b" term-projectile-backward-restored "Backward for project terminals") ("b" term-project-backward-restored "Backward for project terminals")
("c" term-projectile-create-new-restored "Create new project terminal") ("c" term-project-create-new-restored "Create new project terminal")
("d" imalison:term-hydra-default-directory/body-restored "Switch/Create default directory terminal" :exit t) ("d" imalison:term-hydra-default-directory/body-restored "Switch/Create default directory terminal" :exit t)
("g" imalison:term-hydra-global/body-restored "Switch/Create global terminal" :exit t) ("g" imalison:term-hydra-global/body-restored "Switch/Create global terminal" :exit t)
("p" term-projectile-forward-restored "Switch/Create project terminal")) ("p" term-project-forward-restored "Switch/Create project terminal"))
(defhydra imalison:term-hydra-global (defhydra imalison:term-hydra-global
@@ -3525,31 +3539,31 @@ in term-mode. This makes term-mode 1000% more useful
(progn (setq imalison:term-hydra-original-default-directory (progn (setq imalison:term-hydra-original-default-directory
default-directory))) default-directory)))
"term - global" "term - global"
("s" term-projectile-switch-to "Switch to existing") ("s" term-project-switch-to "Switch to existing")
("f" term-projectile-global-forward-restored "Forward for project terminals") ("f" term-project-global-forward-restored "Forward for project terminals")
("b" term-projectile-global-backward-restored "Backward for project terminals") ("b" term-project-global-backward-restored "Backward for project terminals")
("c" term-projectile-global-create-new-restored "Create new project terminal") ("c" term-project-global-create-new-restored "Create new project terminal")
("d" imalison:term-hydra-default-directory/body-restored "Switch/Create default directory terminal" :exit t) ("d" imalison:term-hydra-default-directory/body-restored "Switch/Create default directory terminal" :exit t)
("g" term-projectile-global-forward-restored "Switch/Create global terminal") ("g" term-project-global-forward-restored "Switch/Create global terminal")
("p" imalison:term-hydra-projectile/body-restored "Switch/Create project terminal" :exit t)) ("p" imalison:term-hydra-project/body-restored "Switch/Create project terminal" :exit t))
(mapcar (lambda (term-projectile-function) (mapcar (lambda (term-project-function)
(defalias (imalison:concat-symbols term-projectile-function '-restored) (defalias (imalison:concat-symbols term-project-function '-restored)
(lambda (&rest args) (lambda (&rest args)
(interactive) (interactive)
(let ((default-directory imalison:term-hydra-original-default-directory)) (let ((default-directory imalison:term-hydra-original-default-directory))
(apply term-projectile-function args))))) (apply term-project-function args)))))
'(term-projectile-default-directory-forward '(term-project-default-directory-forward
term-projectile-default-directory-backward term-project-default-directory-backward
term-projectile-default-directory-create-new term-project-default-directory-create-new
term-projectile-forward term-project-forward
term-projectile-backward term-project-backward
term-projectile-create-new term-project-create-new
term-projectile-global-forward term-project-global-forward
term-projectile-global-backward term-project-global-backward
term-projectile-global-create-new term-project-global-create-new
imalison:term-hydra-global/body imalison:term-hydra-global/body
imalison:term-hydra-projectile/body imalison:term-hydra-project/body
imalison:term-hydra-default-directory/body)))) imalison:term-hydra-default-directory/body))))
#+END_SRC #+END_SRC
** crux ** crux

View File

@@ -979,8 +979,8 @@ alphanumeric characters only."
:defer 2 :defer 2
:config :config
(progn (progn
(use-package org-projectile (setq org-project-capture-default-backend
:disabled t) (make-instance 'org-project-capture-project-backend))
(setq org-project-capture-strategy (setq org-project-capture-strategy
(make-instance 'org-project-capture-combine-strategies (make-instance 'org-project-capture-combine-strategies
:strategies (list (make-instance 'org-project-capture-single-file-strategy) :strategies (list (make-instance 'org-project-capture-single-file-strategy)