Create the magit-goto-end-of-section helper

This commit is contained in:
Gergely Polonkai 2025-03-31 12:49:37 +02:00
parent 3552e17ae9
commit 2972d3f964
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -686,6 +686,29 @@ From [[http://whattheemacsd.com/file-defuns.el-02.html][whattheemacsd.org]].
(magit-section-goto section)))
#+end_src
*** Go to the end of the current section
#+begin_src emacs-lisp
(defun gpolonkai/magit-goto-end-of-section ()
"Move to the beginning of the next visible section."
(interactive)
(unless (eobp)
(let ((section (magit-current-section)))
(if (oref section parent)
(let ((next (and (not (oref section hidden))
(not (= (oref section end)
(1+ (point))))
(car (oref section children)))))
(while (and section (not next))
(unless (setq next (car (magit-section-siblings section 'next)))
(setq section (oref section parent))))
(if next
(magit-section-goto next)
(end-of-buffer)))
(magit-section-goto 1)))))
#+end_src
* Set up the very basics
Now that we have package management configured we can set up defaults more easily. This includes every builtin packages, font faces, and the like.