IMPORTANT NOTICE: Devheroes public code hosting will shut down at 1st of March 2023. Due to some difficulties, we have to shut down the instance. Since is pretty mature and welcoming, We highly recommend you to move your code there. Please be advised that on 1st of March, your data will be removed. Thanks for your time with us, and may the source be with you.

Browse Source

Add org-ql, org-sidebar and super agenda via dedicated cubes

Sameer Rahmani 7 months ago
  1. 114


@ -28,9 +28,114 @@ @@ -28,9 +28,114 @@
(require 'fpkg)
(require 'fg42/cube)
(defcube fg42/org-ql-cube
"This package provides a query language for Org files. It offers two
syntax styles: Lisp-like sexps and search engine-like keywords.
It includes three libraries: The ~org-ql~ library is flexible and may
be used as a backend for other tools. The libraries ~org-ql-search~ and
~helm-org-ql~ (a separate package) provide interactive search commands
and saved views.
After installation, you can use the commands without additional configuration.
To use the functions and macros in your own Elisp code, use libraries ~org-ql~
and ~org-ql-view~."
(:title "Org Qurey Language"
:flag org-ql
:flag-default t)
(fpkg/use org-ql
:after org))
(defcube fg42/org-super-agenda-cube
"This package lets you “supercharge” your Org daily/weekly agenda. The idea is
to group items into sections, rather than having them all in one big list.
Now you can sort-of do this already with custom agenda commands, but when you
do that, you lose the daily/weekly aspect of the agenda: items are no longer
shown based on deadline/scheduled timestamps, but are shown no-matter-what.
You can set your groups via the ~:groups~ parameter. Check out the code
for more parameters.
For more information checkout [[]]"
(:title "Org Super Agenda"
:flag org-super-agenda
:flag-default t)
(defconst fg42/org-super-agenda-groups
(let* ((params fg42/org-super-agenda-cube-params)
(groups (plist-get params :groups)))
(fpkg/use org-super-agenda
:after org-agenda
(setq org-agenda-skip-scheduled-if-done (or (plist-get params :skip-scheduled-if-done) t)
org-agenda-skip-deadline-if-done (or (plist-get params :skip-deadline-if-done) t)
org-agenda-include-deadlines (or (plist-get params :include-deadline) t)
org-agenda-block-separator (plist-get params :block-separator)
org-agenda-compact-blocks (or (plist-get params :compact-blocks) t)
org-agenda-start-day (plist-get params :start-day) ;; nil == today
org-agenda-span (or (plist-get params :span) 1)
org-agenda-start-on-weekday (plist-get params :start-on-week)
org-super-agenda-groups groups))
(defcube fg42/org-sidebar
"This package presents helpful sidebars for Org buffers. Sidebars are customizable using
~org-ql~ queries and ~org-super-agenda~ grouping.
The default sidebar includes a chronological list of scheduled and deadlined items in the
current buffer (similar to the Org agenda, but without all its features) at the top, and
a list of all other non-done to-do items below. If the buffer is narrowed, the sidebar only
shows items in the narrowed portion; this allows seeing an overview of tasks in a subtree."
(:title "Org Sidebar"
:flag org-sidebar
:flag-default t)
(let ((default-file (or (plist-get fg42/org-sidebar-params :default-file) "~/orgs/"))
(fns (plist-get fg42/org-sidebar-params :sidebar-fns)))
(defun fg42/org-sidebar--default (buf)
(let ((main-org-buf (get-buffer-create "*main-org*")))
(with-current-buffer main-org-buf
(insert-file default-file))
(defun fg42/org-sidebar-toggle-sidebar-default ()
(message "here")
(org-sidebar #'fg42/org-sidebar--default))
(if-flag org-super-agenda
(if-flag org-ql
(fpkg/use org-sidebar
(setq org-sidebar-default-fns fns)
(("<f9>" . fg42/org-sidebar-toggle-sidebar-default)))
(error "`fg42/org-ql-cube' is required for `fg42/org-sidebar'"))
(error "`fg42/org-sugper-agenda-cube' is required for `fg42/org-sidebar'"))))
(defcube fg42/org-cube
"Org cube"
(:title "cubes/fg42/"
"A GNU Emacs major mode for keeping notes, authoring documents, computational notebooks,
literate programming, maintaining to-do lists, planning projects, and more in a fast
and effective plain text system.
This cube contains ~fg42/org-super-agenda-cube~, ~fg42/org-ql-cube~ and ~fg42/org-sidebar~
cubes and you can pass parameters to them via ~:super-agenda~, ~:ql~ and ~:sidebar~ keys.
For more info on ~org-mode~ check out [[]]"
(:title "Org-mode"
:flag org
:flag-default t)
@ -42,6 +147,11 @@ @@ -42,6 +147,11 @@
(fpkg/use org-bullets
:hook (org-mode . org-bullets-mode))
(fg42/org-super-agenda-cube (plist-get fg42/org-cube-params :super-agenda))
(fpkg/use org-mode