~abcdw/rde-devel

Add feature emacs-org-dynamic-agenda. v1 PROPOSED

This patch series adds the feature emacs-org-dynamic-agenda, and the feature emacs-org-ql, which provides optimizations for emacs-org-dynamic-agenda. It adds a patch to allow using org-agenda-files as a path, as in the org-mode manual.

Nicolas Graves (4):
  rde: Add feature-emacs-org-dynamic-agenda.
  feature: emacs-org-agenda: maybe-path-or-list? for org-agenda-files.
  rde: Add feature-emacs-org-ql.
  feature: emacs-org-dynamic-agenda: Properly integrate with org-ql.

 src/rde/features/emacs-xyz.scm | 70 +++++++++++++++++++++++++++++++++-
 1 file changed, 69 insertions(+), 1 deletion(-)

-- 
2.41.0
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~abcdw/rde-devel/patches/44893/mbox | git am -3
Learn more about email & git

[PATCH 1/4] rde: Add feature-emacs-org-dynamic-agenda. Export this patch

---
 src/rde/features/emacs-xyz.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/rde/features/emacs-xyz.scm b/src/rde/features/emacs-xyz.scm
index d670bc2a..51aa2306 100644
--- a/src/rde/features/emacs-xyz.scm
+++ b/src/rde/features/emacs-xyz.scm
@@ -112,6 +112,7 @@
            feature-emacs-org-roam
            feature-emacs-org-agenda
            feature-emacs-org-dailies
            feature-emacs-org-dynamic-agenda
            feature-emacs-citar
            feature-emacs-org-protocol
            feature-emacs-spelling
@@ -4494,6 +4495,32 @@ or with a org-roam-less copy of the package."
             (org-dailies-capture-templates . ,org-dailies-capture-templates)))
   (home-services-getter get-home-services)))

(define* (feature-emacs-org-dynamic-agenda
          #:key
          (emacs-org-dynamic-agenda emacs-org-dynamic-agenda))
  "Configure org-dynamic-agenda for GNU Emacs."
  (ensure-pred file-like? emacs-org-dynamic-agenda)

  (define emacs-f-name 'org-dynamic-agenda)
  (define f-name (symbol-append 'emacs- emacs-f-name))

  (define (get-home-services config)
    (list
     (rde-elisp-configuration-service
      emacs-f-name
      config
      `((require 'org-dynamic-agenda))
      #:summary "\
Org dynamic agenda"
      #:commentary ""
      #:keywords '(convenience)
      #:elisp-packages (list emacs-org-dynamic-agenda))))

  (feature
   (name f-name)
   (values `((,f-name . #t)))
   (home-services-getter get-home-services)))

;; TODO: rewrite to states
(define* (feature-emacs-org-roam
          #:key
-- 
2.41.0

[PATCH 2/4] feature: emacs-org-agenda: maybe-path-or-list? for org-agenda-files. Export this patch

---
 src/rde/features/emacs-xyz.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/rde/features/emacs-xyz.scm b/src/rde/features/emacs-xyz.scm
index 51aa2306..cf2b8094 100644
--- a/src/rde/features/emacs-xyz.scm
+++ b/src/rde/features/emacs-xyz.scm
@@ -4258,7 +4258,9 @@ Indentation and refile configurations, visual adjustment."
          (org-agenda-prefix-format '())
          (org-agenda-appt? #f))
  "Configure org-agenda for GNU Emacs."
  (ensure-pred maybe-list? org-agenda-files)
  (define (maybe-path-or-list? elt)
    (or (maybe-path? elt) (maybe-list? elt)))
  (ensure-pred maybe-path-or-list? org-agenda-files)
  (ensure-pred list? org-agenda-custom-commands)
  (ensure-pred maybe-list? org-agenda-prefix-format)
  (ensure-pred boolean? org-agenda-appt?)
-- 
2.41.0

[PATCH 3/4] rde: Add feature-emacs-org-ql. Export this patch

---
 src/rde/features/emacs-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/rde/features/emacs-xyz.scm b/src/rde/features/emacs-xyz.scm
index cf2b8094..eee4e6b5 100644
--- a/src/rde/features/emacs-xyz.scm
+++ b/src/rde/features/emacs-xyz.scm
@@ -112,6 +112,7 @@
            feature-emacs-org-roam
            feature-emacs-org-agenda
            feature-emacs-org-dailies
            feature-emacs-org-ql
            feature-emacs-org-dynamic-agenda
            feature-emacs-citar
            feature-emacs-org-protocol
@@ -4497,6 +4498,35 @@ or with a org-roam-less copy of the package."
             (org-dailies-capture-templates . ,org-dailies-capture-templates)))
   (home-services-getter get-home-services)))

(define* (feature-emacs-org-ql
          #:key
          (emacs-org-ql emacs-org-ql))
  "Configure org-ql for GNU Emacs."
  (ensure-pred file-like? emacs-org-ql)

  (define emacs-f-name 'org-ql)
  (define f-name (symbol-append 'emacs- emacs-f-name))

  (define (get-home-services config)
    (list
     (rde-elisp-configuration-service
      emacs-f-name
      config
      `()
      #:summary "\
An Org-mode query language, including search commands and saved views"
      #:commentary "\
This package provides a query language for Org files. It offers two syntax
styles: Lisp-like sexps and search engine-like keywords. Currently this
package is unconfigured but it plays along with emacs-org-dynamic-agenda."
      #:keywords '(convenience)
      #:elisp-packages (list emacs-org-ql))))

  (feature
   (name f-name)
   (values `((,f-name . #t)))
   (home-services-getter get-home-services)))

(define* (feature-emacs-org-dynamic-agenda
          #:key
          (emacs-org-dynamic-agenda emacs-org-dynamic-agenda))
-- 
2.41.0

[PATCH 4/4] feature: emacs-org-dynamic-agenda: Properly integrate with org-ql. Export this patch

---
 src/rde/features/emacs-xyz.scm | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/rde/features/emacs-xyz.scm b/src/rde/features/emacs-xyz.scm
index eee4e6b5..64a397bc 100644
--- a/src/rde/features/emacs-xyz.scm
+++ b/src/rde/features/emacs-xyz.scm
@@ -4529,9 +4529,11 @@ package is unconfigured but it plays along with emacs-org-dynamic-agenda."

(define* (feature-emacs-org-dynamic-agenda
          #:key
          (emacs-org-dynamic-agenda emacs-org-dynamic-agenda))
  "Configure org-dynamic-agenda for GNU Emacs."
          (emacs-org-dynamic-agenda emacs-org-dynamic-agenda)
          (emacs-org-ql-dynamic-agenda emacs-org-ql-dynamic-agenda))
  "Configure org-dynamic-agenda or org-ql-dynamic-agenda for GNU Emacs."
  (ensure-pred file-like? emacs-org-dynamic-agenda)
  (ensure-pred file-like? emacs-org-ql-dynamic-agenda)

  (define emacs-f-name 'org-dynamic-agenda)
  (define f-name (symbol-append 'emacs- emacs-f-name))
@@ -4541,12 +4543,19 @@ package is unconfigured but it plays along with emacs-org-dynamic-agenda."
     (rde-elisp-configuration-service
      emacs-f-name
      config
      `((require 'org-dynamic-agenda))
      `(,@(if (get-value 'emacs-org-ql config)
              '((require 'org-ql-dynamic-agenda)
                (setq org-agenda-include-diary nil))
              '((require 'org-dynamic-agenda))))
      #:summary "\
Org dynamic agenda"
      #:commentary ""
      #:commentary "\
This hook records files that should be saved as agenda-files, making the refreshing
and loading of org-agenda faster (and even faster with org-ql cache)."
      #:keywords '(convenience)
      #:elisp-packages (list emacs-org-dynamic-agenda))))
      #:elisp-packages (list (if (get-value 'emacs-org-ql config)
                                 emacs-org-ql-dynamic-agenda
                                 emacs-org-dynamic-agenda)))))

  (feature
   (name f-name)
-- 
2.41.0