Skip to content

Commit

Permalink
feat: replace ibuffer-project with projection-ibuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Feb 22, 2024
1 parent 12872d2 commit baaa638
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
16 changes: 5 additions & 11 deletions modules/me-project.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,18 @@
"p" #'consult-project-extra-find
"P" #'consult-project-extra-find-other-window))

(use-package ibuffer-project
:straight t
:hook (ibuffer . +ibuffer-project-h)
:config
;; From Crafted Emacs
(defun +ibuffer-project-h ()
(setq ibuffer-filter-groups (ibuffer-project-generate-filter-groups))
(unless (eq ibuffer-sorting-mode 'project-file-relative)
(ibuffer-do-sort-by-project-file-relative))))

(use-package projection
:straight t
;; Enable the `projection-hook' feature.
:hook (ibuffer . ibuffer-projection-set-filter-groups)
:hook (minemacs-after-startup . global-projection-hook-mode)
:config
:init
(with-eval-after-load 'project (require 'projection))
;; Access pre-configured projection commands from a keybinding of your choice.
;; Run `M-x describe-keymap projection-map` for a list of available commands.
:config
;; This ensures that `ibuffer-projection-set-filter-groups' takes effect
(+add-hook! ibuffer (run-at-time 0.1 nil (lambda () (call-interactively #'ibuffer-update))))
:bind-keymap
("C-x P" . projection-map))

Expand Down
24 changes: 24 additions & 0 deletions modules/obsolete/me-ibuffer-project.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;;; me-ibuffer-project.el --- Ibuffer + project.el integration (replaced with projection-ibuffer) -*- lexical-binding: t; -*-

;; Copyright (C) 2022-2024 Abdelhak Bougouffa

;; Author: Abdelhak Bougouffa (rot13 "nobhtbhssn@srqbencebwrpg.bet")

;;; Commentary:

;;; Code:

(use-package ibuffer-project
:straight t
:hook (ibuffer . +ibuffer-project-h)
:config
;; From Crafted Emacs
(defun +ibuffer-project-h ()
(setq ibuffer-filter-groups (ibuffer-project-generate-filter-groups))
(unless (eq ibuffer-sorting-mode 'project-file-relative)
(ibuffer-do-sort-by-project-file-relative))))


(provide 'obsolete/me-ibuffer-project)

;;; me-ibuffer-project.el ends here

0 comments on commit baaa638

Please sign in to comment.