Integrated repository, worktree, git stacker, and project manager
0

Configure Feed

Select the types of activity you want to include in your feed.

emacs: set default-directory on pm buffers

Project-scoped buffers (pm-status, pm-agent-list when given a
project) bind default-directory to the container so transient,
project-current, and pm--container-of resolve to the right project
from inside the buffer.

Global buffers (pm-list, pm-pool, pm-repos, all-projects
pm-agent-list) bind default-directory to a new pm-manager-project
defcustom (a project name); when unset, they fall back to ~.

Jordan Isaacs (May 3, 2026, 5:02 AM UTC) 3b6d5e4b 1c844ea4

+33 -1
+4
integrations/emacs/pm-agent.el
··· 362 362 (with-current-buffer buf 363 363 (pm-agent-list-mode) 364 364 (setq pm-agent-list--scope (cons project (and all t))) 365 + (setq default-directory 366 + (if project 367 + (pm-agent--cwd project) 368 + (pm-global-default-directory))) 365 369 (let ((inhibit-read-only t)) 366 370 (erase-buffer) 367 371 (insert "Loading…\n"))
+1
integrations/emacs/pm-list.el
··· 167 167 (let ((buf (get-buffer-create "*pm-list*"))) 168 168 (with-current-buffer buf 169 169 (pm-list-mode) 170 + (setq default-directory (pm-global-default-directory)) 170 171 (let ((inhibit-read-only t)) 171 172 (erase-buffer) 172 173 (insert "Loading…\n"))
+1
integrations/emacs/pm-pool.el
··· 141 141 (with-current-buffer buf 142 142 (pm-pool-mode) 143 143 (setq pm-pool--repo (and repo (not (string-empty-p repo)) repo)) 144 + (setq default-directory (pm-global-default-directory)) 144 145 (let ((inhibit-read-only t)) 145 146 (erase-buffer) 146 147 (insert "Loading…\n"))
+1
integrations/emacs/pm-repo.el
··· 102 102 (with-current-buffer buf 103 103 (pm-repo-mode) 104 104 (setq pm-repo--offline offline) 105 + (setq default-directory (pm-global-default-directory)) 105 106 (let ((inhibit-read-only t)) 106 107 (erase-buffer) 107 108 (insert "Loading…\n"))
+4 -1
integrations/emacs/pm-status.el
··· 331 331 (defun pm-project-status (name) 332 332 "Show `pm project status NAME' in a magit-style buffer." 333 333 (interactive (list (pm--read-project "Status of: "))) 334 - (let ((buf (get-buffer-create (format "*pm-status: %s*" name)))) 334 + (let ((buf (get-buffer-create (format "*pm-status: %s*" name))) 335 + (container (file-name-as-directory 336 + (expand-file-name name pm-projects-dir)))) 335 337 (with-current-buffer buf 336 338 (pm-status-mode) 337 339 (setq pm-status--project name) 340 + (setq default-directory container) 338 341 (let ((inhibit-read-only t)) 339 342 (erase-buffer) 340 343 (insert (format "pm: %s\n\nLoading…\n" name)))
+22
integrations/emacs/pm.el
··· 63 63 :type 'boolean 64 64 :group 'pm) 65 65 66 + ;;;###autoload 67 + (defcustom pm-manager-project nil 68 + "Project name used as `default-directory' for global pm buffers. 69 + Applies to `pm-list', `pm-pool', `pm-repo-list', and `pm-agent-list' 70 + in its all-projects view — none of which are bound to a single 71 + project but still benefit from a sensible cwd (e.g. so a transient 72 + opened from the buffer scopes to your usual workspace). 73 + When nil, those buffers fall back to the user's home directory." 74 + :type '(choice (const :tag "Home directory" nil) string) 75 + :group 'pm) 76 + 77 + ;;;###autoload 78 + (defun pm-global-default-directory () 79 + "Resolve `default-directory' for non-project-scoped pm buffers. 80 + Returns `pm-manager-project's container under `pm-projects-dir' 81 + when set, else the user's home directory." 82 + (file-name-as-directory 83 + (expand-file-name 84 + (if pm-manager-project 85 + (expand-file-name pm-manager-project pm-projects-dir) 86 + "~")))) 87 + 66 88 (require 'pm-process) 67 89 (require 'pm-project) 68 90 (require 'pm-commands)