Skip to content

haji-ali/calfw-blocks

 
 

Repository files navigation

calfw-blocks.el

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

Fork changelog

The following features are implemented:

  • Using calendar colours instead of a rotating list of colors for events.
  • Using `cl-lib` functions.
  • Viewing current time indicator only when today is being shown.
  • Word wrapping text in events when possible.
  • Removed separate rows for dates, including them instead in the day-header.
  • Added a marker for the current day.
  • Implemented continuous blocks for all-day events.
  • Changed the grid rendering to use overlines.
  • Cleaned up some of the code, though this is definitely WIP.
  • Various fixes and linting (WIP).
  • TODO: checkdoc

This fork must be installed with my fork of `calfw`, otherwise it will not work.

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.

License

GNU General Public License v3.0 (GPLv3)

About

Visual enhancements for the Emacs Calendar Framework (calfw)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%