Create the magit-find-first-link helper

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

View File

@ -709,6 +709,22 @@ From [[http://whattheemacsd.com/file-defuns.el-02.html][whattheemacsd.org]].
(magit-section-goto 1)))))
#+end_src
*** Find the first URL in the current section
#+begin_src emacs-lisp
(defun gpolonkai/magit-find-first-link ()
(interactive)
(let ((bos (save-excursion
(gpolonkai/magit-goto-beginning-of-section)
(point)))
(eos (save-excursion
(gpolonkai/magit-goto-end-of-section)
(point))))
(goto-char bos)
(when (re-search-forward "https?://" eos t)
(goto-char (match-beginning 0)))))
#+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.