Create the magit-find-first-link helper

This commit is contained in:
2025-03-31 12:50:27 +02:00
parent 2972d3f964
commit 082988c915

View File

@@ -709,6 +709,22 @@ From [[http://whattheemacsd.com/file-defuns.el-02.html][whattheemacsd.org]].
(magit-section-goto 1))))) (magit-section-goto 1)))))
#+end_src #+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 * 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. Now that we have package management configured we can set up defaults more easily. This includes every builtin packages, font faces, and the like.