]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Add CUSTOM_ID properties to all Org entries
authorEshel Yaron <eshel@areionsec.com>
Sat, 7 May 2022 12:02:28 +0000 (15:02 +0300)
committerEshel Yaron <eshel@areionsec.com>
Sat, 7 May 2022 12:02:28 +0000 (15:02 +0300)
.emacs.d/esy.org

index 3db3bb994805cdf1f3022b72fde559e60b38ef10..5633121c39157b18452716b5aaaf5f7e73d8117a 100644 (file)
@@ -5,6 +5,9 @@
 #+STARTUP: overview indent
 
 * Introduction
+:PROPERTIES:
+:CUSTOM_ID: introduction
+:END:
 
 This document holds my customizations for GNU Emacs. Its source version is written in
 [[https://orgmode.org/][Org mode]], utilizing [[https://orgmode.org/worg/org-contrib/babel/][Babel]] to realize [[https://en.wikipedia.org/wiki/Literate_programming][literate programming]]. The Elisp code blocks
@@ -16,6 +19,9 @@ SourceHut]]. An [[https://eshelyaron.com/esy.html][online HTML version]] is also
 exporting and publishing]] below for more information regarding [[https://eshelyaron.com][my website]].
 
 * Fresh installation
+:PROPERTIES:
+:CUSTOM_ID: install
+:END:
 
 To bootstrap this configuration, fetch a local clone of the repository from
 [[https://git.sr.ht/~eshel/dotfiles][SourceHut]] and create a symlink from the =.emacs.d= subdirectory into your home
@@ -66,6 +72,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Allow for more memory usage during initialization
+:PROPERTIES:
+:CUSTOM_ID: garbage-collection-tweeks
+:END:
 
 #+begin_src emacs-lisp
   (let ((normal-gc-cons-threshold (* 20 1024 1024))
@@ -76,6 +85,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Loading the =modus-vivendi= theme
+:PROPERTIES:
+:CUSTOM_ID: themes
+:END:
 
 #+begin_src emacs-lisp
   (load-theme 'modus-vivendi)
@@ -83,6 +95,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Package archives
+:PROPERTIES:
+:CUSTOM_ID: package-archives
+:END:
 
 #+begin_src emacs-lisp
   (require 'package)
@@ -140,6 +155,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * History
+:PROPERTIES:
+:CUSTOM_ID: history
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-history ()
@@ -157,8 +175,14 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Display settings
+:PROPERTIES:
+:CUSTOM_ID: display
+:END:
 
 ** Must have display settings
+:PROPERTIES:
+:CUSTOM_ID: display-must-haves
+:END:
 
 #+begin_src emacs-lisp
   (setq use-file-dialog nil
@@ -178,6 +202,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** More display settings
+:PROPERTIES:
+:CUSTOM_ID: display-goodies
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-display ()
@@ -202,6 +229,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Org-mode settings                                                     :org:
+:PROPERTIES:
+:CUSTOM_ID: org
+:END:
 
 ** Literate config bootstrap
 :PROPERTIES:
@@ -225,6 +255,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** Org-mode basic settings
+:PROPERTIES:
+:CUSTOM_ID: org-must-haves
+:END:
 
 #+begin_src emacs-lisp
   (defconst esy/inbox-path "~/inbox.org"
@@ -269,6 +302,29 @@ For further information about Elisp headers, see [[info:elisp#Library
 
 #+end_src
 
+** Interactively fill missing CUSTOM_ID properties
+:PROPERTIES:
+:CUSTOM_ID: orgs-custom-ids
+:END:
+
+#+begin_src emacs-lisp
+  (defun esy/org-fill-custom-id (point value)
+    "Set CUSTOM_ID to VALUE interactively for the entry at POINT."
+    (interactive "d\nMCUSTOM_ID: ")
+    (org-entry-put point "CUSTOM_ID" value))
+
+  (defun esy/org-fill-custom-ids-in-buffer ()
+    "Visit headers in the current buffer and set CUSTOM_ID for each."
+    (interactive)
+    (require 'beacon)
+    (org-global-cycle 1)
+    (org-map-entries (lambda ()
+                       (unless (org-entry-get (point) "CUSTOM_ID")
+                         (beacon-blink)
+                         (org-cycle)
+                         (call-interactively #'esy/org-fill-custom-id)
+                         (org-global-cycle 1)))))
+#+end_src
 ** Export and publish
 :PROPERTIES:
 :CUSTOM_ID: exporting
@@ -375,6 +431,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** Org-mode capture templates
+:PROPERTIES:
+:CUSTOM_ID: org-capture-templates
+:END:
 
 #+begin_src emacs-lisp
 
@@ -513,14 +572,23 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** Unset =org-mode= binding of =C-,= to =org-cycle-agenda-files=       :kbd:
+:PROPERTIES:
+:CUSTOM_ID: org-bindings
+:END:
 
 #+begin_src emacs-lisp
   (keymap-unset org-mode-map "C-," t)
 #+end_src
 
 * Email settings                                                       :mail:
+:PROPERTIES:
+:CUSTOM_ID: email
+:END:
 
 ** My accounts
+:PROPERTIES:
+:CUSTOM_ID: accounts
+:END:
 
 #+begin_src emacs-lisp
   (setq user-full-name "Eshel Yaron")
@@ -533,6 +601,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** Sending mail from multiple SMTP accounts
+:PROPERTIES:
+:CUSTOM_ID: multiple-smtp-accounts
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/smtpmail-multi-make-accout (address server)
@@ -564,6 +635,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** Reading mail with Gnus
+:PROPERTIES:
+:CUSTOM_ID: gnus
+:END:
 
 #+begin_src emacs-lisp
   (setq mail-user-agent 'gnus-user-agent
@@ -605,8 +679,14 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Global keybindings                                                    :kbd:
+:PROPERTIES:
+:CUSTOM_ID: global-keybindings
+:END:
 
 ** Misc. keybindings
+:PROPERTIES:
+:CUSTOM_ID: misc-keybindings
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/kill-dwim ()
@@ -661,6 +741,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** =C-x= keybindings
+:PROPERTIES:
+:CUSTOM_ID: c-x-keybindings
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/customize-ctl-x-map ()
@@ -689,6 +772,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** =C-h= keybindings
+:PROPERTIES:
+:CUSTOM_ID: c-h-keybindings
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/customize-help-map ()
@@ -704,6 +790,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** =ace-window= homerow keys
+:PROPERTIES:
+:CUSTOM_ID: ace-window
+:END:
 
 #+begin_src emacs-lisp
    (with-eval-after-load 'ace-window
@@ -713,12 +802,18 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** =ace-link= setup
+:PROPERTIES:
+:CUSTOM_ID: ace-link
+:END:
 
 #+begin_src emacs-lisp
   (add-hook 'after-init-hook #'ace-link-setup-default)
 #+end_src
 
 * Display weekly agenda on startup
+:PROPERTIES:
+:CUSTOM_ID: agenda-on-startup
+:END:
 
 #+begin_src emacs-lisp :tangle no
   (defun esy/display-weekly-agenda ()
@@ -731,8 +826,14 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Minibuffer and completions
+:PROPERTIES:
+:CUSTOM_ID: minibuffer-and-completions
+:END:
 
 ** Enable and indicate recursive minibuffers
+:PROPERTIES:
+:CUSTOM_ID: recursive-minibuffers
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-recursive-minibuffers ()
@@ -745,6 +846,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 ** Completions
+:PROPERTIES:
+:CUSTOM_ID: completions
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-completions ()
@@ -785,6 +889,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Elfeed
+:PROPERTIES:
+:CUSTOM_ID: elfeed
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-elfeed ()
@@ -803,6 +910,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * eww
+:PROPERTIES:
+:CUSTOM_ID: eww
+:END:
 
 #+begin_src emacs-lisp
   (with-eval-after-load 'eww
@@ -811,6 +921,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Async shell commands with =dtache=
+:PROPERTIES:
+:CUSTOM_ID: dtache
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-dtache ()
@@ -823,6 +936,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Mode-line customizations
+:PROPERTIES:
+:CUSTOM_ID: modeline
+:END:
 
 #+begin_src emacs-lisp
   (defvar esy/ping-target "1.1.1.1"
@@ -941,6 +1057,9 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Setup PATH from shell environment
+:PROPERTIES:
+:CUSTOM_ID: path-from-shell
+:END:
 
 #+begin_src emacs-lisp
   (require 'exec-path-from-shell)
@@ -948,8 +1067,14 @@ For further information about Elisp headers, see [[info:elisp#Library
 #+end_src
 
 * Programming
+:PROPERTIES:
+:CUSTOM_ID: programming
+:END:
 
 ** General =prog-mode= settings
+:PROPERTIES:
+:CUSTOM_ID: prog-mode
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-programming ()
@@ -1004,6 +1129,9 @@ include =emacs-lisp-mode= and =lisp-interaction-mode=.
 #+end_src
 
 * LaTeX and PDF settings
+:PROPERTIES:
+:CUSTOM_ID: latex-and-pdf
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/pdf-tools-install ()
@@ -1021,6 +1149,9 @@ include =emacs-lisp-mode= and =lisp-interaction-mode=.
 #+end_src
 
 * Misc. settings
+:PROPERTIES:
+:CUSTOM_ID: misc
+:END:
 
 #+begin_src emacs-lisp
   (defun esy/setup-misc ()
@@ -1038,6 +1169,9 @@ include =emacs-lisp-mode= and =lisp-interaction-mode=.
 #+end_src
 
 * Elisp Footer
+:PROPERTIES:
+:CUSTOM_ID: footer
+:END:
 
 #+begin_src emacs-lisp
   (provide 'esy)