Skip to content

Conversation

@aizensoosuke
Copy link
Collaborator

@aizensoosuke aizensoosuke commented Feb 11, 2021

Implements following improvements:

  • Navigable info line (left click jumps to file).
  • Blocks are displayed on the right day line. Each day has one (or several, see next items) dedicated lines.
  • Configurable overlaps (either on new lines, or with a different warning face).
    • Customize with boolean org-timeline-overlap-in-new-line and face org-timeline-overlap.
  • Configurable clocks (either not displayed, or on a dedicated line beginning with "$", or in the same line as other events).
    • Customize with booleans org-timeline-show-clocked and org-timeline-dedicated-clocked-line.
  • On generation of the timeline, display info for the next block for today, i.e. the currently happening one or the next one.
    The next block is also emphasized with a specific face org-timeline-next-block.
    • Customize with boolean org-timeline-emphasize-next-block that defaults to nil.
  • Optionally show item's title inside each block. You can only see the first few characters, as it has to be contained in the block.
    If the item has property TIMELINE_TEXT, display its value instead of the item's title.
    • Customize with boolean org-timeline-show-text-in-blocks that defaults to nil.
  • Visually separate blocks that are adjacent using an "overline" face on every other adjacent block.
  • Ability to hide elapsed columns and only keep the last org-timeline-keep-elapsed of them.
    This customizable variable defaults to -1 which tells org-timeline to keep all the elapsed columns.
  • Ability to see a 24h cycle in timeline. Setting org-agenda-span to 2 and org-timeline-keep-elapsed to a positive value merges today and tomorrow's timelines into 1 (only if the agenda currently shows today and tomorrow).
    That way, you see a 24h cycle starting org-timeline-keep-elapsed hours ago.
    • This will work better if you set org-timeline-start-hour to be 0. It will probably break (i.e. not show blocks that should appear) if you set this to a different value.
    • When doing this, you can easily see today's entire timeline by hitting j in the agenda and asking for yesterday to be shown.
    • I'm planning to make this work with org-timeline-start-hour when org-timeline-keep-elapsed is disabled (negative).
  • Adding a character (for now, ❚ i.e. U+275A) at the beginning of each block's title in order to differentiate consecutive events.
    • Customize with org-timeline-insert-before-title that defaults to "\u275A".
  • In a similar manner to clocks, ability to set a group for an item. For example, if an event has the property "TIMELINE_GROUP" set to "academics", it will be displayed on a dedicated line starting with "aca". Clocked entries are actually automatically put in the category " $".
  • Overlap can be customized per-task. You can set the property TIMELINE_DO_NOT_OVERLAP for a task.

Other changes:

  • Changed the customizable variable that sets the hour at which the timeline starts. It is now org-timeline-beginning-of-day-hour.
  • Following Distinction between consecutive tasks #20, I have also shifted everything one char to the right, for better alignment with the hourline. See commit 764e34c.
  • Commit 4bc235a changes the structure and splits org-timeline--generate-timeline in a bunch of different functions that I tried my best to make independant.
  • Tests have been added to reflect those new features. I also added a list of implemented tests at the top of org-timeline-test.el.

I have taken some inspiration from deopurkar's fork.

That's (not) the result (anymore):
image

image

Sōsuke Aizen and others added 27 commits February 11, 2021 14:20
going back to defvar.
also remove a useless line 'cursor-sensor...
overlapping blocks not handled yet.
this is customizable with custom variables:
  - `org-timeline-show-clocked`
  - `org-timeline-clocked-in-new-line`
customizable with:
- `org-timeline-overlap` (a face)
- `org-timeline-overlap-in-new-line` (a bool)
there is a bug when clocks and several overlapping blocks
happen for the same day.
if a block is currently happening, show its info.
else, if there is a next one, show it.
else, if there is a previous one, show the last one.
finally, if no event today, show an empty info line,
  unless the timeline is completely empty.
customizable with:
- face `org-timeline-nearest-block`
- option `org-timeline-emphasize-nearest-block`
    that defaults to nil.
next commit will also change the feature to only look
for *next* event.
this also makes it only look for *next* event
(see previous commit)
also separate `org-timeline--decorate-info`.
also change name of former `org-timeline--clear-info`
@aizensoosuke aizensoosuke requested a review from Fuco1 February 11, 2021 13:43
this is customizable with `org-timeline-show-title-in-blocks'
that defaults to nil.
@aizensoosuke
Copy link
Collaborator Author

@Fuco1

Hi!

I hope you're doing well. If you have a little time it would be nice if you could take a quick look at #22 and #23.
It's probably less of a quick look, but if you could review org-timeline--merge-for-24h-cycle it would be very nice. I'd especially like to know if you think it's a bad way of doing this, and if it should definitely be done in org-timeline--list-tasks.

Other than that I think I'm close to marking this PR as ready for review. I just need to fix 3 tests not passing out of 35, and do a review of the whole code myself. I know there will be unoptimized code and all, but this is my first project in elisp so I'm already happy it works well! And hopefully it can help other people.

Thank you !

@aizensoosuke
Copy link
Collaborator Author

I coded and passed all the tests in emacs 27.1.

I'll mark is as ready for review, but I didn't review the whole code myself.

marking older versions as optional for now, they all fail.
otherwise it overrides the default font-lock-face e.g. org-timeline-block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants