[Emacs] Add package for unique IDs for org headers

This commit is contained in:
Lucien Cartier-Tilet 2021-06-16 14:33:20 +02:00
parent 6901ee23f6
commit 43b902a1fe
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 20 additions and 0 deletions

View File

@ -2373,6 +2373,26 @@ for org files that will be hosted and viewable on Github.
(electric-indent-local-mode -1)))
#+end_src
As explained in my [[https://blog.phundrak.com/better-custom-ids-orgmode/][blog post]], org-mode is terrible with coming up with
meaningful IDs for its headings. I actually wrote a package for this!
#+begin_src emacs-lisp
(use-package org-unique-id
:straight (org-unique-id :build t
:type git
:host github
:repo "Phundrak/org-unique-id")
:defer t
:after org
:init
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'before-save-hook
(lambda ()
(when (and (eq major-mode 'org-mode)
(eq buffer-read-only nil))
(org-unique-id)))))))
#+end_src
*** Babel
A package I use from time to time is ~ob-latex-as-png~ which allows me
to easily convert a LaTeX snippet into a PNG, regardless of the