|
16 | 16 | (use-package unique-dir-name
|
17 | 17 | :straight (:host github :repo "abougouffa/unique-dir-name"))
|
18 | 18 |
|
19 |
| -(use-package project-tab-groups |
20 |
| - :straight t |
| 19 | +(use-package one-tab-per-project |
| 20 | + :straight (:host github :repo "abougouffa/one-tab-per-project") |
21 | 21 | :after project
|
22 | 22 | :init
|
23 |
| - (setq project-tab-groups-tab-group-name-function #'+project-tab-groups-name-by-project-root) |
24 |
| - (project-tab-groups-mode 1) |
25 |
| - :config |
26 |
| - (defvar +project-tab-groups-unique-map (make-hash-table :test 'equal)) |
27 |
| - (defun +project-tab-groups-name-by-project-root (dir) |
28 |
| - "Use the project root as group name starting from DIR." |
29 |
| - (with-temp-buffer |
30 |
| - (setq default-directory dir) |
31 |
| - (hack-dir-local-variables-non-file-buffer) |
32 |
| - (let ((root (or (when-let* ((proj (project-current))) |
33 |
| - (expand-file-name (project-root proj))) ;; Use the full path |
34 |
| - (expand-file-name dir)))) |
35 |
| - root))) |
36 |
| - (defun +project-tab-groups--unique-rename-all () |
37 |
| - (dolist (frame (frame-list)) |
38 |
| - (dolist (tab (frame-parameter frame 'tabs)) |
39 |
| - (when-let* ((group-path (alist-get 'group tab)) |
40 |
| - (unique (gethash group-path +project-tab-groups-unique-map))) |
41 |
| - (setcdr (assoc 'name tab) (alist-get 'unique-name unique)) |
42 |
| - (setcdr (assoc 'explicit-name tab) t))))) |
43 |
| - ;; Rename the tab to the tab-group name (project name) |
44 |
| - (advice-add |
45 |
| - #'project-tab-groups--select-or-create-tab-group :after-while |
46 |
| - (satch-defun +project-tab-groups--name-tab-by-group:after-while-a (&rest _) |
47 |
| - (when-let ((group-path (alist-get 'group (tab-bar--current-tab)))) |
48 |
| - (unique-dir-name-register group-path :map '+project-tab-groups-unique-map) |
49 |
| - (+project-tab-groups--unique-rename-all)) ; Rename all tabs accordingly |
50 |
| - t)) |
51 |
| - ;; Unregister the path on tab group closing and rename all tabs accordingly |
52 |
| - (advice-add |
53 |
| - #'project-tab-groups--project-kill-buffers-advice :around |
54 |
| - (satch-defun +project-tab-groups--remove-from-map:around-a (fn &rest args) |
55 |
| - (let ((path (alist-get 'group (tab-bar--current-tab)))) |
56 |
| - (apply fn args) |
57 |
| - (unless (project-tab-groups--find-tab-by-group-name path) ; Removed? |
58 |
| - (unique-dir-name-unregister path :map '+project-tab-groups-unique-map) |
59 |
| - (+project-tab-groups--unique-rename-all)) |
60 |
| - t)))) |
| 23 | + (otpp-mode 1)) |
61 | 24 |
|
62 | 25 | (use-package burly
|
63 | 26 | :straight t)
|
|
0 commit comments