rougier / agenda

Org agenda in the console
GNU General Public License v3.0
133 stars 9 forks source link

Include SCHEDULED items in agenda #3

Closed amoghpj closed 3 years ago

amoghpj commented 3 years ago

Hi, thanks for the great tool! I understand that "deadline" and "scheduled" mean specific things in org-agenda. When I plan my day out, I tend to use "scheduled" items to block of specific times of the day. I would like these to show up in the agenda as well.

Currently, I have naively duplicated the "deadline" logic on line 183 of agenda.py and replaced deadline with "scheduled" and it does what I want.

if node.scheduled:
    d = node.scheduled.start
    key = d.year, d.month, d.day
    day_events = self.events.get(key, [])
    day_events.append( Event(heading, node.scheduled.start, special=True) )
    self.events[key] = day_events

However, it would be nice to have features (colors maybe) to distinguish deadlines and scheduled items in the terminal. Any thoughts on this? Thanks!

rougier commented 3 years ago

You mean everything works expect color? I such case, I think the best would be to play with the Event.info method where you specify how to display info.

amoghpj commented 3 years ago

Thank you for the pointer! I've hacked the Event.special to accomplish what I want. Instead of a bool, I've set it to be a string that can either be "deadline" or "scheduled". Based on this, I can change the prefix from "!! " for a deadline to something like "== " for a scheduled item.

@@ -65,7 +66,10 @@ class Event:
         elif self.start_date == datetime.date.today():
             s += style.event_today + prefix
         if self.special:
-            s += style.event_special + "!! "
+            if self.special == "deadline":
+                s += style.event_special + "!! "
+            elif self.special == "scheduled":
+                s += style.event_special + "==  "

Very cool, and I enjoy your work on nano emacs.