Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

agenda-span

How do I lower the agenda's span? I prefer a single-day view for my agendas, as I tend to set-up habits and daily tasks so a weekly view just ends up filled with repeated tasks. I already set dashboard-week-agenda to nil, but today is 2024-11-26 and I'm seeing tasks for tomorrow, 2024-11-27.

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

Hi, this time "agenda for today" means entries with time between now and the next 86400 seconds (24 hrs).

You could define a new filter function like this:

(defun new-agenda-filter-function ()
  "Include entries with timestamps before the end of the day."
  (let ((entry-timestamp (dashboard-agenda--entry-timestamp (point)))
        (end-of-day (days-to-time (1+ (time-to-days (current-time))))))
    (unless (and entry-timestamp ;; ensure entry has timestamp
                 (time-less-p (current-time) entry-timestamp) ;; don't show past entries
                 (time-less-p entry-timestamp end-of-day))
      (point))))

Or similar to dashboard-filter-agenda-by-time, and then set dashboard-filter-agenda-entry to that function:

(setq dashboard-filter-agenda-entry 'new-agenda-filter-function)

Hope it works, I'm not sure about the end-of-day value.

You must be logged in to vote
1 reply
@gs-101
Comment options

no-items

Thank's, but it didn't work, I set it up like this:

(use-package dashboard-widgets
  :config
  (defun ricardorich/dashboard-day-agenda ()
    "Include entries with timestamps before the end of the day."
    (let ((entry-timestamp (dashboard-agenda--entry-timestamp (point)))
          (end-of-day (days-to-time (1+ (time-to-days (current-time))))))
      (unless (and entry-timestamp ;; Ensure that the entry has a timestamp
                   (time-less-p (current-time) entry-timestamp) ;; Don't show past entries
                   (time-less-p entry-timestamp end-of-day))
        (point))))
  :custom
  (dashboard-filter-agenda-entry 'ricardorich/dashboard-day-agenda))

I also evaluated the function individually with eval-last-sexp and used eval-expression for setq dashboard-filter-agenda-entry for good measure. But I think you may be right about end-of-day (Org Mode has the function org-today, maybe I could try that).

Besides that, I also tried setting a different name for the function, and opening regular Emacs (no daemon) as a sort of restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.