Commit 206e696315c0

Vincent Demeester <vincent@sbr.pm>
2026-01-13 18:15:16
chore: remove Nix package definitions
Packaging is handled in vdemeester/home repository. Keep x/ focused on Go code only.
1 parent 973c156
Changed files (2)
dots
.config
emacs
systems
kerkouane
dots/.config/emacs/init.el
@@ -2228,6 +2228,35 @@ Add this function to the `after-save-hook'."
 		  :query "maildir:/icloud/INBOX OR maildir:/gmail/INBOX OR maildir:/redhat/INBOX"
 		  :key   ?b))
 
+  ;; Custom sorting: oldest-first for active folders, newest-first for archives
+  (declare-function mu4e-search-change-sorting "mu4e")
+
+  (defcustom vde/mu4e-oldest-first-bookmarks '(
+    "maildir:/icloud/INBOX"
+    "maildir:/gmail/INBOX"
+    "maildir:/redhat/INBOX"
+    "maildir:/icloud/INBOX OR maildir:/gmail/INBOX OR maildir:/redhat/INBOX"  ; All Inboxes
+    "maildir:/icloud/Drafts"
+    "maildir:/gmail/[Gmail]/Drafts"
+    "maildir:/redhat/[Gmail]/Drafts"
+  )
+    "Bookmarks/folders to sort oldest-first (ascending).
+Active folders like INBOX and Drafts show oldest messages first to prioritize
+pending items by age. All other folders (Sent, Archives) will sort newest-first."
+    :type '(repeat string)
+    :group 'mu4e)
+
+  (defun vde/mu4e-set-sort-order-by-bookmark (search)
+    "Set sort order based on bookmark type.
+Active folders (INBOX, Drafts) sort ascending (oldest first) to prioritize
+pending items. Archives and Sent folders sort descending (newest first) to
+show recent activity."
+    (if (member search vde/mu4e-oldest-first-bookmarks)
+        (mu4e-search-change-sorting :date 'ascending)
+      (mu4e-search-change-sorting :date 'descending)))
+
+  (add-hook 'mu4e-search-bookmark-hook #'vde/mu4e-set-sort-order-by-bookmark)
+
   ;; imapfilter integration
   (defun vde/mu4e-imapfilter-add-rule ()
     "Add an imapfilter rule from the current email message.
systems/kerkouane/extra.nix
@@ -747,6 +747,8 @@ in
     host = "go.sbr.pm";
     config = ''
       paths:
+        /x:
+          repo: https://github.com/vdemeester/x
         /lord:
           repo: https://github.com/vdemeester/lord
         /ape: