]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update esy.org
authorEshel Yaron <me@eshelyaron.com>
Mon, 10 Oct 2022 15:34:55 +0000 (18:34 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 10 Oct 2022 15:35:39 +0000 (18:35 +0300)
.emacs.d/esy.org

index 43078d445187c838536c427e5f6d0e4fb1649010..f0d9437b83cd4b3071a4a459368bc48b24b490a8 100644 (file)
@@ -141,7 +141,8 @@ For further information about Elisp headers, see [[info:elisp#Library
   ;; (load-theme 'modus-vivendi)
 
   (setq ef-themes-mixed-fonts t
-        ef-themes-variable-pitch-ui t)
+        ef-themes-variable-pitch-ui t
+        ef-themes-to-toggle '(ef-bio ef-frost))
   (mapc #'disable-theme custom-enabled-themes)
   (load-theme 'ef-bio :no-confirm)
 #+end_src
@@ -451,20 +452,33 @@ refiling directly into deeper headings as well.
     (interactive "d\nMCUSTOM_ID: ")
     (org-entry-put point "CUSTOM_ID" value))
 
+  (defun esy/org-fill-description (point value)
+    "Set DESCRIPTION to VALUE interactively for the entry at POINT."
+    (interactive "d\nMDESCRIPTION: ")
+    (org-entry-put point "DESCRIPTION" value))
+
   (defun esy/org-maybe-prompt-custom-id ()
     "Prompt for CUSTOM_ID if not set for the entry at POINT."
-    (unless (org-entry-get (point) "CUSTOM_ID")
-      (pulse-momentary-highlight-one-line)
-      (org-cycle)
-      (call-interactively #'esy/org-fill-custom-id)
-      (org-global-cycle 1)))
+    (let ((res 0))
+      (unless (and (org-entry-get (point) "DESCRIPTION")
+                   (org-entry-get (point) "CUSTOM_ID"))
+        (pulse-momentary-highlight-one-line)
+        (org-cycle)
+        (unless (org-entry-get (point) "CUSTOM_ID")
+          (call-interactively #'esy/org-fill-custom-id)
+          (setq res (1+ res)))
+        (unless (org-entry-get (point) "DESCRIPTION")
+          (call-interactively #'esy/org-fill-description)
+          (setq res (1+ res)))
+        (org-global-cycle 1))
+      res))
 
   (defun esy/org-fill-custom-ids-in-buffer ()
     "Visit headers in the current buffer and set CUSTOM_ID for each."
     (interactive)
     (org-global-cycle 1)
-    (message "Filled %d CUSTOM_ID properties."
-             (length (remove nil
+    (message "Filled %d properties."
+             (apply #'+ (remove nil
                              (org-map-entries
                               #'esy/org-maybe-prompt-custom-id)))))
 #+end_src