From 6b54747f9a047d0a8b44678adaa9677a87047281 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 14 Jan 2026 12:32:34 -0800 Subject: [PATCH] Add missing helper functions for custom agenda views The org-agenda-custom-commands reference get-date-created-from-agenda-entry and imalison:compare-int-list, but these were only defined in README.org (main emacs config), not tangled into org-config.org. This caused /custom-view?key=r (Recently created) to fail with "void-function get-date-created-from-agenda-entry". Co-Authored-By: Claude Opus 4.5 --- nixos/org-agenda-api.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nixos/org-agenda-api.nix b/nixos/org-agenda-api.nix index 9b98ec6a..6fcb4ad0 100644 --- a/nixos/org-agenda-api.nix +++ b/nixos/org-agenda-api.nix @@ -60,6 +60,25 @@ let (when (file-exists-p (expand-file-name "org-config-config.el" config-dir)) (load (expand-file-name "org-config-config.el" config-dir)))) +;; Define no-op stubs for unavailable packages (overwrite autoloads) +(defun org-bullets-mode (&optional _arg) + "No-op stub for org-bullets-mode (package not available in container)." + nil) + +;; Helper functions used by org-agenda-custom-commands +;; These are defined in README.org but needed for custom views +(defun imalison:compare-int-list (a b) + "Compare two lists of integers lexicographically." + (when (and a b) + (cond ((> (car a) (car b)) 1) + ((< (car a) (car b)) -1) + (t (imalison:compare-int-list (cdr a) (cdr b)))))) + +(defun get-date-created-from-agenda-entry (agenda-entry) + "Get the CREATED property timestamp from an agenda entry." + (org-time-string-to-time + (org-entry-get (get-text-property 1 'org-marker agenda-entry) "CREATED"))) + ;; Capture templates for API (setq org-agenda-api-capture-templates `(("gtd-todo"