Skip to content

Visual enhancements for the Emacs Calendar Framework (calfw)

License

Notifications You must be signed in to change notification settings

ml729/calfw-blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calfw-blocks.el

Visual time blocks and more for the Emacs Calendar Framework (calfw).

Screenshot

Weekly block view: screenshot.png

Transposed two week view: screenshot-transpose.png

Installation

Manual Installation

Clone this git repo (e.g. to `~/.emacs.d/site-lisp/’)

cd ~/.emacs.d
mkdir site-lisp
cd site-lisp
git clone https://github.com/ml729/calfw-blocks

And add its path to `’load-path’:

(add-to-list 'load-path "~/.emacs.d/site-lisp/calfw-blocks")

Make sure this package is loaded after calfw.

Usage

This package comes with the following calfw views that display time blocks:

'block-day
'block-week
'block-2-day
'block-3-day
'block-4-day
'block-5-day

The block-week view always starts on Sunday. The block-day and block-<n>-day views always start on the current day. The top right button labelled Week uses block-week.

The package also includes two-column transposed versions of the original calfw views (credit to @novoid for the design), where days of the week are displayed vertically rather than horizontally:

'transpose-8-day
'transpose-10-day
'transpose-12-day
'transpose-14-day
'transpose-two-weeks

The transpose-<n>-day views always start on the current day, and transpose-two-weeks always starts on the most recent Sunday. The top right buttons labelled W^T and 2W^T use transpose-8-day and transpose-14-day, respectively.

You can use these to define functions that directly open calfw with these views. Examples:

;; Calendar showing org-agenda entries
(defun my-open-calendar-agenda ()
  (interactive)
  (cfw:open-calendar-buffer
   :contents-sources
   (list
    (cfw:org-create-source "medium purple"))
   :view 'block-week))

;; Calendar showing org entries from files
(defun my-open-calendar-files ()
  (interactive)
  (cfw:open-calendar-buffer
   :contents-sources
   (list
    (cfw:org-create-file-source "Todos" "~/stuff/todos.org" "green")
    (cfw:org-create-file-source "Events" "~/stuff/events.org" "blue"))
   :view 'block-3-day))

Customization

Notable customization options:

  • calfw-blocks-earliest-visible-time: what time of day the calendar starts at.
  • calfw-blocks-show-time-grid: shows a time grid if non-nil.
  • calfw-blocks-default-event-length: the length in hours of events with a start time but no end time; used to determine the size of the rendered block.
  • calfw-blocks-lines-per-hour: how many lines each hour gets.
  • calfw-blocks-min-block-width: the smallest width a block can be in characters (includes divider character). If there are too many concurrent events, some events are hidden so that all blocks are at least `calfw-blocks-min-block-width’ characters wide.

Known Issues

Does not currently handle multiday events with times on both the start and end dates, such as:

SCHEDULED: <2023-07-06 Thu 19:00>--<2023-07-07 Fri 5:00>

License

GNU General Public License v3.0 (GPLv3)

About

Visual enhancements for the Emacs Calendar Framework (calfw)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published