Skip to content

Commit

Permalink
Use magit-setup-buffer-internal's new DIRECTORY argument
Browse files Browse the repository at this point in the history
If non-nil, the `default-directory' is set to that before enabling
the mode, which is needed here because `forge-set-buffer-repository'
on `magit-mode-hook' takes `default-directory' into account, which
for global lists, should be "/", to avoid associating the buffer
with some repository.
  • Loading branch information
tarsius committed Jul 1, 2024
1 parent fb272bd commit c8e915d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion forge-pkg.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(emacsql "20240124")
(ghub "20240507")
(let-alist "1.0.6")
(magit "20240428")
(magit "20240701")
(markdown-mode "2.6")
(seq "2.24")
(transient "20240421")
Expand Down
5 changes: 2 additions & 3 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,8 @@ This mode itself is never used directly."
(magit-generate-buffer-name-function (lambda (_mode _value) name)))
(magit-setup-buffer-internal
(if (forge-issue-p topic) #'forge-issue-mode #'forge-pullreq-mode)
t `((forge-buffer-topic ,topic)
(default-directory ,(or (forge-get-worktree repo) "/")))
name)
t `((forge-buffer-topic ,topic))
name (or (forge-get-worktree repo) "/"))
(forge-topic-mark-read topic)))

(defun forge-topic-refresh-buffer ()
Expand Down
6 changes: 3 additions & 3 deletions lisp/forge-topics.el
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ Must be set before `forge-topics' is loaded.")
(unless (or repo global)
(error "Cannot determine repository"))
(magit-setup-buffer-internal #'forge-topics-mode nil
`((default-directory ,dir)
(forge--buffer-topics-spec ,spec)
`((forge--buffer-topics-spec ,spec)
(forge-buffer-unassociated-p ,global))
(get-buffer-create buf))))
(get-buffer-create buf)
dir)))

(defun forge-topics-refresh-buffer ()
(magit-set-header-line-format (forge-topics-buffer-desc))
Expand Down

0 comments on commit c8e915d

Please sign in to comment.