Commit 2b4fae24dc50

Vincent Demeester <vincent@sbr.pm>
2026-06-29 11:45:52
feat(emacs): support C-u prefix for multiple ghostel
Delegated buffer management to ghostel itself, which handles reuse and C-u for fresh buffers natively.
1 parent 148c16f
Changed files (1)
dots
config
emacs
dots/config/emacs/site-lisp/project-func.el
@@ -185,18 +185,12 @@ if one already exists."
 (defun vde/project-ghostel ()
   "Run ghostel in the current project's root directory.
 If a ghostel buffer already exists for the project, switch to it.
-Otherwise, create a new ghostel buffer."
+With \\[universal-argument], create a new ghostel buffer."
   (interactive)
   (defvar ghostel-buffer-name)
   (let* ((default-directory (project-root (project-current t)))
-         (ghostel-buffer-name (project-prefixed-buffer-name "ghostel"))
-         (buf (seq-find (lambda (b)
-                          (string-match-p (regexp-quote ghostel-buffer-name)
-                                          (buffer-name b)))
-                        (buffer-list))))
-    (if (and buf (not current-prefix-arg))
-        (pop-to-buffer-same-window buf)
-      (ghostel))))
+         (ghostel-buffer-name (project-prefixed-buffer-name "ghostel")))
+    (ghostel current-prefix-arg)))
 
 ;;;###autoload
 (defun vde/project-magit-status ()