Skip to content

Commit

Permalink
magit--handle-bookmark: Autoload and require magit-bookmark
Browse files Browse the repository at this point in the history
Loading magit bookmars from a new emacs session uses
`magit--handle-bookmark'.  This provides an autoload to ensure this
works even prior to loading magit.  `magit-bookmark' is also required,
as it implements the necessary methods.
  • Loading branch information
jdtsmith authored and tarsius committed Jul 10, 2024
1 parent 9d1f8db commit 804c623
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lisp/magit-section.el
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,7 @@ and the buffer-local values of the variables referenced in its
bookmark)
(user-error "Bookmarking is not implemented for %s buffers" major-mode)))

;;;###autoload
(defun magit--handle-bookmark (bookmark)
"Open a bookmark created by `magit--make-bookmark'.
Expand All @@ -2405,6 +2406,7 @@ the appropriate buffer without displaying it.
Then call the `magit-*-setup-buffer' function of the the major-mode
with the variables' values as arguments, which were recorded by
`magit--make-bookmark'."
(require (quote magit-bookmark) nil t)
(let ((buffer (magit-bookmark-get-buffer-create
bookmark
(bookmark-prop-get bookmark 'mode))))
Expand Down

0 comments on commit 804c623

Please sign in to comment.