Function: org-modern-agenda

org-modern-agenda is a natively compiled function defined in org-modern.el.

Signature

(org-modern-agenda)

Documentation

Finalize Org agenda highlighting.

Source Code

;; Defined in /nix/store/0fwir9vccqq0yiqnswyf22ip3sl68f49-emacs-packages-deps/share/emacs/site-lisp/elpa/org-modern-20260722.1411/org-modern.el
;;;###autoload
(defun org-modern-agenda ()
  "Finalize Org agenda highlighting."
  (remove-from-invisibility-spec 'org-modern)
  (add-to-invisibility-spec 'org-modern) ;; Not idempotent?!
  (add-hook 'pre-redisplay-functions #'org-modern--pre-redisplay nil 'local)
  (setq-local face-remapping-alist (copy-tree face-remapping-alist))
  (maphash (lambda (face _spec)
             (when (string-prefix-p "org-habit-" (symbol-name face))
               (setf (alist-get face face-remapping-alist nil 'remove)
                     (and org-modern-label-border `(org-modern-habit ,face)))))
           face--new-frame-defaults)
  (save-excursion
    (save-match-data
      (let (case-fold-search)
        (when org-modern-todo
          (goto-char (point-min))
          (while (< (point) (point-max))
            (when-let* ((org-not-done-regexp (get-text-property (point) 'org-not-done-regexp))
                        (re (get-text-property (point) 'org-todo-regexp))
                        (re (concat "[: ]" re " "))
                        ((re-search-forward re (pos-eol) 'noerror)))
              (org-modern--todo))
            (goto-char (min (1+ (pos-eol)) (point-max)))))
        (when org-modern-tag
          (goto-char (point-min))
          (let ((re (concat "\\( \\)\\(:\\(?:" org-tag-re "::?\\)+\\)[ \t]*$")))
            (while (re-search-forward re nil 'noerror)
              (org-modern--tag))))
        (when org-modern-priority
          (goto-char (point-min))
          (while (re-search-forward "\\(\\[#.\\]\\)" nil 'noerror)
            ;; For some reason the org-agenda-fontify-priorities adds overlays?!
            (when-let* ((ov (overlays-at (match-beginning 0))))
              (overlay-put (car ov) 'face nil))
            (org-modern--priority)))))))