Git Product home page Git Product logo

emacs-calfw's Introduction

Calfw - A calendar framework for Emacs

What is calfw?

This program displays a calendar view in the Emacs buffer.

Calfw image

Screenshots

Currently, calfw has 4 views, month, 1week, 2week and day view. Views

Pushing SPC key, the detail buffer pops up. Pushing SPC key again, the buffer is closed. Pop up details

Many information items are displayed in the Emacs buffer. View details

Installation

To use this program, locate this file to load-path directory, and add the following code to your .emacs.

(require 'calfw)

Executing the command cfw:open-calendar-buffer, switch to the calendar buffer. You can navigate the date like calendar.el.

Schedule data which are shown in the calendar view, are collected by a list of the struct cfw:source objects through the named argument variables :contents-sources and :annotation-sources. The former source defines schedule contents. The later one does date annotations like the moon phases.

This program gets the holidays using the function calendar-holiday-list. See the document for the holidays.el and the Info text.

Key bindings

In the calendar buffer and region, you can use following key bindings:

Navigation
[left], b, h Previous day
[right], f, l Next day
[up], p, k Previous week
[down], n, j Next week
^ Week begin
$ Week end
[home] First date in this month
[end] Last date in this month
M-v, [PgUp], < Previous month
C-v, [PgDown], > Next month
t Today
g Absolute date (YYYY/MM/DD)
TAB Next item in a day
Changing View
M Month view
W 1 Week view
T 2 Week view
D Day view
Operation
r Refresh data and re-draw contents
SPC Pop-up detail buffer (like Quicklook in Mac)
RET, [click] Jump (howm, orgmode)
q Bury buffer

The buttons on the toolbar can be clicked.

Add-ons:

Following programs are also useful:

Setting example:

For howm users:

(eval-after-load "howm-menu" '(progn
  (require 'calfw-howm)
  (cfw:install-howm-schedules)
  (define-key howm-mode-map (kbd "M-C") 'cfw:open-howm-calendar)
))

If you are using Elscreen, here is useful.

(define-key howm-mode-map (kbd "M-C") 'cfw:elscreen-open-howm-calendar)

You can display a calendar in your howm menu file.

%here%(cfw:howm-schedule-inline)

howm menu embedding

For org users:

(require 'calfw-org)

Then, M-x cfw:open-org-calendar.

org-agenda and calfw-org

Filtering agenda items

You can choose agenda items with cfw:org-agenda-schedule-args, like following code:

(setq cfw:org-agenda-schedule-args '(:timestamp))

This setting restricts items containing a date stamp or date range matching the selected date. If cfw:org-agenda-schedule-args is nil, the default customize variable org-agenda-entry-types is used. For the further information, please refer the orgmode document.

Orgmode like key bindng

You can use another key binding like org agenda buffer, setting cfw:org-overwrite-default-keybinding to non-nil, like following code:

(setq cfw:org-overwrite-default-keybinding t)

Then, following key bindings are overwritten:

key function
g Refresh data and re-draw contents (cfw:refresh-calendar-buffer)
j Goto the specified date (cfw:org-goto-date)
k org-capture
x Close calfw and other buffers opened by calfw-org (cfw:org-clean-exit)
d Day view (cfw:change-view-day)
v d Day view (cfw:change-view-day)
v w 1 Week view (cfw:change-view-week)
v m Month View (cfw:change-view-month)

Synchronization with google calendar

Here is the program which helps synchronization schedule items between org and google calendar, and also collaborates with calfw.

For iCal (Google Calendar) users:

Here is a minimum sample code:

(require 'calfw-ical)
(cfw:open-ical-calendar "http://www.google.com/calendar/ical/.../basic.ics")

Google Calendar and calfw-ical

Here is the add-on program which communicate with google calendar via API:

For diary users:

Here is a minimum sample code:

(require 'calfw-cal)

Then, M-x cfw:open-diary-calendar.

If you see a blank entry for each day, set the variable diary-list-include-blanks to nil.

General setting

The calfw view can display many schedule items, gathering some schedule sources. Using the function cfw:open-calendar-buffer is the general way to display the schedules.

Here is the sample code:

(require 'calfw-cal)
(require 'calfw-ical)
(require 'calfw-howm)
(require 'calfw-org)

(defun my-open-calendar ()
  (interactive)
  (cfw:open-calendar-buffer
   :contents-sources
   (list
    (cfw:org-create-source "Green")  ; orgmode source
    (cfw:howm-create-source "Blue")  ; howm source
    (cfw:cal-create-source "Orange") ; diary source
    (cfw:ical-create-source "Moon" "~/moon.ics" "Gray")  ; ICS source1
    (cfw:ical-create-source "gcal" "https://..../basic.ics" "IndianRed") ; google calendar ICS
   ))) 

The function cfw:open-calendar-buffer receives schedules sources via the named argument :contents-sources.

One can customize the keymap on the calendar buffer with the named argument :custom-map of cfw:open-calendar-buffer.

Customize

Holidays

The calfw collects holidays from the customize variable calendar-holidays which belongs to holidays.el in the Emacs. See the document and source of holidays.el for details.

Format of month and week days

The calfw uses some customization variables in the calendar.el.

Here is a customization code:

;; Month
(setq calendar-month-name-array
  ["January" "February" "March"     "April"   "May"      "June"
   "July"    "August"   "September" "October" "November" "December"])

;; Week days
(setq calendar-day-name-array
      ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"])

;; First day of the week
(setq calendar-week-start-day 0) ; 0:Sunday, 1:Monday

Faces

One can customize the faces.

Here is a template code for face customization:

(custom-set-faces
 '(cfw:face-title ((t (:foreground "#f0dfaf" :weight bold :height 2.0 :inherit variable-pitch))))
 '(cfw:face-header ((t (:foreground "#d0bf8f" :weight bold))))
 '(cfw:face-sunday ((t :foreground "#cc9393" :background "grey10" :weight bold)))
 '(cfw:face-saturday ((t :foreground "#8cd0d3" :background "grey10" :weight bold)))
 '(cfw:face-holiday ((t :background "grey10" :foreground "#8c5353" :weight bold)))
 '(cfw:face-grid ((t :foreground "DarkGrey")))
 '(cfw:face-default-content ((t :foreground "#bfebbf")))
 '(cfw:face-periods ((t :foreground "cyan")))
 '(cfw:face-day-title ((t :background "grey10")))
 '(cfw:face-default-day ((t :weight bold :inherit cfw:face-day-title)))
 '(cfw:face-annotation ((t :foreground "RosyBrown" :inherit cfw:face-day-title)))
 '(cfw:face-disable ((t :foreground "DarkGray" :inherit cfw:face-day-title)))
 '(cfw:face-today-title ((t :background "#7f9f7f" :weight bold)))
 '(cfw:face-today ((t :background: "grey10" :weight bold)))
 '(cfw:face-select ((t :background "#2f2f2f")))
 '(cfw:face-toolbar ((t :foreground "Steelblue4" :background "Steelblue4")))
 '(cfw:face-toolbar-button-off ((t :foreground "Gray10" :weight bold)))
 '(cfw:face-toolbar-button-on ((t :foreground "Gray50" :weight bold))))

Grid frame

Users can have nice unicode grid frame. However, in the some environment, the Emacs can not display the grid characters correctly. Please try following settings.

Grid setting example:

;; Default setting
(setq cfw:fchar-junction ?+
      cfw:fchar-vertical-line ?|
      cfw:fchar-horizontal-line ?-
      cfw:fchar-left-junction ?+
      cfw:fchar-right-junction ?+
      cfw:fchar-top-junction ?+
      cfw:fchar-top-left-corner ?+
      cfw:fchar-top-right-corner ?+ )

;; Unicode characters
(setq cfw:fchar-junction ?╋
      cfw:fchar-vertical-line ?┃
      cfw:fchar-horizontal-line ?━
      cfw:fchar-left-junction ?┣
      cfw:fchar-right-junction ?┫
      cfw:fchar-top-junction ?┯
      cfw:fchar-top-left-corner ?┏
      cfw:fchar-top-right-corner ?┓)
      
;; Another unicode chars
(setq cfw:fchar-junction ?╬
      cfw:fchar-vertical-line ?║
      cfw:fchar-horizontal-line ?═
      cfw:fchar-left-junction ?╠
      cfw:fchar-right-junction ?╣
      cfw:fchar-top-junction ?╦
      cfw:fchar-top-left-corner ?╔
      cfw:fchar-top-right-corner ?╗)

Line breaking

If a content string is longer than the cell width, the calfw breaks into the multiple lines. In the current implementation, the Calfw has 3 strategies: none, simple and wordwrap. The variable cfw:render-line-breaker selects the strategy to break lines.

  • cfw:render-line-breaker-none
    • Never breaks lines. Longer contents are truncated.
  • cfw:render-line-breaker-simple (default)
    • This strategy breaks lines with rigid width. This may be not so beautiful, but In the most cases it looks good.
  • cfw:render-line-breaker-wordwrap
    • This strategy breaks lines with the emacs function fill-region. Although, the line breaking algorithm of the Emacs is not so smart as more complicated ones, such as Knuth/Plass algorithm, this strategy is better than the simple one.

Calfw framework details

In this section, I would explain how to add a new calendar source and how to embed the calfw component in the other applications.

How to add a new calendar source?

Defining the cfw:source object, one can extend calfw calendar source.

struct cfw:source details

The struct cfw:source is a simple data type defined by cl-defstruct.

Here is the details of the slot members of cfw:source.

slot name description
name [required] Source name. This name is shown at the status bar.
data [required] Data function which returns calendar contents. The function details are described in the next section.
update [option] Update function. Calfw calls this function when this source needs to refresh the data.
color [option] Color string for this source. Color names those are shown by M-x list-colors-display or RGB hex format like "#abcdef".
period-fgcolor [option] Foreground color for period items. The default color is white or black.
period-bgcolor [option] Background color for period items. The default color is cfw:source-color.
opt-face [option] Additional options for the normal item face. Ex. :opt-face '(:weight bold)
opt-period-face [option] Additional options for the period item face.

Only name and data slots are essential. Many slots are visual options.

In many cases, one has to specify only the color slot for visual, because the calfw chooses appropriate colors for the rest color options.

cfw:source-data details

This section explains what objects the function-slot cfw:source-data should return.

The function-slot cfw:source-data receives two arguments, start and end date of the query period, and returns a list of instances of cfw:event struct.

Here is a simple example.

cfw:source-data example1:

;; cfw:source-data example
(defun sample-data1 (b e)
  (list
    (make-cfw:event :title "item1"   :start-date  (cfw:date 1 1 2011))
    (make-cfw:event :title "item2-1" :start-date  (cfw:date 1 10 2011))
    (make-cfw:event :title "item2-2" :start-date  (cfw:date 1 10 2011))
    ))

(cfw:open-calendar-buffer
  :date (cfw:date 1 1 2011)
  :contents-sources
   (list 
     (make-cfw:source
      :name "test1" :data 'sample-data1)))

Evaluating this code in the scratch buffer, following result is displayed.

Simple source example

The date is specified by cfw:date type, ([month] [day] [year]). This format is commonly used in calendar.el and orgmode. (I diagrammed the exchange ways for some time and date formats in Emacs, here.)

Period items are little different. One period item is specified by :start-date and :end-date, and the nested list which has the symbol periods at the head collects them, like the following code.

cfw:source-data example2:

;; cfw:source-data period items
(defun sample-data2 (b e)
  (list
    (make-cfw:event :title "Item1"
          :start-date  (cfw:date 1 15 2011))
    (list 'periods
      (make-cfw:event :title "Period item"
          :start-date (cfw:date 1 8 2011)
          :end-date   (cfw:date 1 9 2011)
          :description "Period item description")
      (make-cfw:event :title "Next item"
          :start-date (cfw:date 1 11 2011)
          :end-date   (cfw:date 1 12 2011)
          :description "Next item description"))))
  
(cfw:open-calendar-buffer
  :date (cfw:date 1 1 2011)
  :contents-sources
   (list 
     (make-cfw:source
      :name "test2" :data 'sample-data2)))

Evaluating this code in the scratch buffer, following result is displayed.

Range items example

Here are other detailed specifications.

  • The both start and end date are included by the query period.
  • The items those aren't included in the query period are ignored.
  • cfw:source-data should return a value as fast as possible, because users are waiting for the result. Caching is good idea.
  • Schedule items don't have to be ordered. Duplicated items may be gathered.
  • In the day cell, the items are sorted by string-lessp, i.e. numerical and alphabetical order.
    • The ordering function can be customized by the named argument :sorter of the component construction.

In the above examples, the dates of the schedule items are fixed. The actual sources generate result values by the programs. The codes of calfw add-ons may be helpful for your implementation.

cfw:event struct detail

The cfw:event struct:

slot name description
title event title [string]
start-date start date of the event [cfw:date]
start-time start time of the event (optional)
end-date end date of the event [cfw:date] (optional)
end-time end of the event (optional)
description event description [string] (optional)
location location [string] (optional)
source [internal] source of the event
Event formatting

The framework has several formatting functions for cfw:event instances. The functions are used by the calfw plugins (cal,ical, etc) to display in a common way.

Format function Description
cfw:event-overview To get an overview of the event (month, 2-week & week view)
cfw:event-days-overview Overview in day-view.
cfw:event-period-overview Overview of periods (same for all views)
cfw:event-detail Detailed information of the event for the detail-view

The formatting can be customized by the user with several formatting strings:

  • cfw:event-format-overview
  • cfw:event-format-days-overview
  • cfw:event-format-period-overview
  • cfw:event-format-detail
  • cfw:event-format-title
  • cfw:event-format-start-date
  • cfw:event-format-start-time
  • cfw:event-format-end-date
  • cfw:event-format-end-time
  • cfw:event-format-location
  • cfw:event-format-description

Examples

  • calfw-git.el
    • Displaying git commit history items in calfw calendar view
  • calfw-syobocal.el
    • Retrieving schedule items via Web API and displaying them in calfw calendar view

Another way to define schedule items (legacy method)

This subsection explains legacy method to define schedule items, so as for users to read old source codes. We should not use this method in the future.

The function-slot cfw:source-data receives two arguments, start and end date of the query period, and returns an alist that consists of ([date] . ([item1] [item2] ... )).

Here is a simple example.

cfw:source-data example1:

;; cfw:source-data example
(defun sample-data1 (b e)
  '(
    ((1  1 2011) . ("item1"))
    ((1 10 2011) . ("item2-1" "item2-2"))
    ))

(cfw:open-calendar-buffer
  :date (cfw:date 1 1 2011)
  :contents-sources
   (list 
     (make-cfw:source
      :name "test1" :data 'sample-data1)))

Period items are little different. One period item is specified by ([start date] [end date] [content]) and the periods record of the alist collects them as a list, like the following code.

cfw:source-data example2:

;; cfw:source-data period items
(defun sample-data2 (b e)
  '(
    ((1  8 2011) . ("item1"))
     (periods
      ((1 8 2011) (1 9 2011) "period item")
      ((1 11 2011) (1 12 2011) "next item"))
    ))
;; (A . (B C) ) is equivalent to (A B C)

(cfw:open-calendar-buffer
  :date (cfw:date 1 1 2011)
  :contents-sources
   (list 
     (make-cfw:source
      :name "test2" :data 'sample-data2)))

How to embed the calfw component in the other applications?

In this section, the details of calfw components would be explained so as for users to extend calfw in themselves.

Calfw is built on the MVC architecture, using simple structure objects and modules employed by naming rules.

Calfw component

Calfw has three destination components to display the calendar.

  • Independent buffer
  • Region in the other buffer
  • Text output
Buffer

The 'buffer' destination displays the calendar view as ordinary Emacs applications do.

The function cfw:open-calendar-buffer makes a new calendar buffer (calfw buffer) and displays it by switch-to-buffer. The major mode of the calfw buffer is cfw:calendar-mode and the keymap cfw:calendar-mode-map is bound.

This destination is easy to use for applications and users, because the buffer is usual application boundary and users know how to use buffers.

Region

The 'Region' destination embeds the calendar view in the buffer which is managed by the other applications. This destination can give the other applications a nice calendar view. See the howm embedding for example.

Let's try a demonstration. Evaluate this code in your scratch buffer.

Region destination example:

;; Evaluate this code in the scratch buffer
(require 'calfw)
(cfw:create-calendar-component-region :height 10)

Then, the calendar view will be embedded in the scratch buffer like the following screenshot. You can navigate the calfw view in the buffer. Undoing for the some times, you can remove the calfw view.

calfw in the scratch buffer

Because this destination never interacts anything out of the region and has its own key-binds as a text property, users can easily embed a calendar view in the other applications.

Text

The 'text' destination generates just a text which represent calfw view. The function cfw:get-calendar-text returns the text.

Destination and View

Three destinations are explained as mentioned above. Although they have different appearance, the application can operate the calfw component in the same way.

Let us call them 'destination', it is the abstraction of UI components.

The similar word 'view' means in which form the calfw displays the contents, for example, monthly form, two-weeks and weekly one and etc.

Calfw objects

Overview

The calfw consists of four objects:

  • cfw:component that gathers following objects up.
  • cfw:model that manages calendar contents.
  • cfw:source that defines schedule items.
  • cfw:dest that is abstraction of destinations.

The relations between the objects are displayed as UML class diagram (Diagrammed by astah).

Overview for calfw objects

cfw:component acts as Controller of MVC. It connects model object and destination one, and controls all events. It also gives the interface of calfw objects for the other applications.

cfw:model and cfw:source act as Model of MVC. They manage the schedule contents and calendar logic.

cfw:dest acts as View of MVC. It abstracts the common interface from UI destinations.

cfw:component

The object cfw:component controls calfw objects and events.

The object has following information:

  • References to cfw:dest object and cfw:model one.
  • Selected date on the calfw component.
  • View style.
  • Hooks
    • update-hooks
    • selection-change-hooks
    • click-hooks.

The object has following operations:

  • Getting object references to cfw:dest, cfw:model, belonging buffer and so on.
  • Getting and setting the selected date (get-selected-date / set-selected-date).
  • Getting and setting the view style (get-view / set-view).
    • The view style is a symbol, such as month, two-weeks, week and day.
  • Resizing and refreshing the view (resize / update).
  • Managing hooks (add-xxx-hook / remove-xxx-hook)

After construction of the calfw component, the destination object can not be changed.

The views are defined as a function and dispatched by the function cfw:cp-dispatch-view-impl.

The instance of the calfw component is stored at following places:

  • buffer destination: the buffer-local variable cfw:component
  • region destination: the text property cfw:component
  • text destination: N/A

Calling the utility function cfw:cp-get-component, one can obtain the calfw instance at the appropriate places. The stateless functions, such as simple event handler functions, can use this function to get the instance.

The applications those have the state-full operations, however, should hold their own calfw instance for the safety object reference.

cfw:model

The object cfw:model gathers schedule sources and gives a common interface for view functions to access the contents.

The object has following information:

  • contents source objects (contents-sources)
  • annotation source objects (annotation-sources)
  • sorting function (sorter)

The model object has no information of views and destinations, just manages schedule contents.

The holidays are retrieved from the global function calendar-holiday-list of calendar.el.

The schedule contents are modified through the model object after the component construction.

(In the current implementation, the model object is build by alist. Then, view functions adds some data as view model. I think it is not good solution, so the implementation may be modified in future.)

cfw:dest

The object cfw:dest abstracts rendering destinations and gives a common interface of rendering operation to view functions.

The object has following information:

  • destination buffer object (buffer)
  • region functions (min-func, max-func)
  • reference size (width, height)
  • clearing function (clear-func)
  • advice functions (before-update-func, after-update-func)
  • overlay data (select-ol, today-ol)

In the current implementation, cfw:dest has three forms, buffer, region and text, mentioned above. Actually, the region destination is what I want. One buffer can have some destination objects, because all data (including local-variables and keymaps) are packed in the cfw:dest object.

Application design

In this section, I would describe a simple guide line of application design using calfw.

One can use calfw as an application UI (like calfw-howm) or dialog UI for selecting a date (like calendar.el). The user application can choose the destination style: buffer or region. Switching between them is very easy.

The data presentation can be achieved by defining cfw:source object. It may be straightforward.

The input events by the user can be caught by hooks in the cfw:component. Then, the selected date is obtained by the function cfw:cursor-to-nearest-date or cfw:cursor-to-date. The current implementation, calfw can not treat a range on the calendar.

Generally, any events can be caught by the custom keymap which is given by the named argument :custom-map with component construction. Furthermore, because calfw reserves the text properties (face, keymap and so on) on the text that is returned by cfw:source objects, one can control event handling at each characters.

Once the model is modified, update function of the cfw:component object should be called to refresh the view.

The summary diagram is here.

Summary of application design

See the calfw-howm.el code for more details.

History

  • 2015/09/24 ver 1.5 : Fixed bugs and added some customize variables.
  • 2015/02/27 ver 1.4 : Introduced cfw:event struct, improved some functions, fixed some bugs.
  • 2011/10/10 ver 1.3 : Improved visual and navigation: multi-line, moving items in a day, diary mode and so on.
  • 2011/07/20 ver 1.2 : Merged many patches and improved many and bug fixed.
  • 2011/07/05 ver 1.0 : Refactored the whole implementation and design. Improved UI and views.
  • 2011/01/07 ver 0.2.1 : Supporting org-agenda schedules.
  • 2011/01/07 ver 0.1 : First release. Supporting howm and iCal schedules.

SAKURAI, Masashi m.sakurai atmark kiwanami.net

Time-stamp: <2015-09-24 11:47:57 sakurai>

emacs-calfw's People

Contributors

ahilsend avatar fitzsim avatar jehops avatar justbur avatar jwiegley avatar kiwanami avatar myuhe avatar pft avatar skyer9 avatar syohex avatar takashihattori avatar takaxp avatar tsdh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-calfw's Issues

"Selecting deleted buffer"

I am using calfw to display my org-mode calendar, so basically I run cfw:open-org-calendar and move around from there.

Sometimes something happens (yes, sorry, I will try to find a recipe to make this happen) and I get "Selecting deleted buffer" as an error, and calfw stops working for the remainder of the Emacs session.

I have to quit Emacs completely and start it again, to get calfw to work again!

If I M-x toggle-debug-on error, this is what pops up:

Debugger entered--Lisp error: (error "Selecting deleted buffer") org-compile-prefix-format(nil) (let ((org-agenda-prefix-format " ") (span (quote day))) (org-compile-prefix-format nil) (progn (let* ((--cl-var-- (cfw:enumerate-days begin end)) (date nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq date (car --cl-var--)) (setq --cl-var-- (nconc (reverse (progn ...)) --cl-var--)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--)))) cfw:org-collect-schedules-period((9 2 2013) (9 8 2013)) (let* ((cfw:org-todo-keywords-regexp (regexp-opt org-todo-keywords-for-agenda)) (contents nil) (periods nil) (--cl-var-- (cfw:org-collect-schedules-period begin end)) (i nil) (date nil) (line nil) (range nil)) (while (consp --cl-var--) (setq i (car --cl-var--)) (setq date (cfw:org-tp i (quote date))) (setq line (funcall cfw:org-schedule-summary-transformer i)) (setq range (cfw:org-get-timerange line)) (if range (progn (if (member range periods) nil (setq periods (cons range periods)))) (setq contents (cfw:contents-add (cfw:org-normalize-date date) line contents))) (setq --cl-var-- (cdr --cl-var--))) (nconc contents (list (cons (quote periods) periods)))) (progn (let* ((cfw:org-todo-keywords-regexp (regexp-opt org-todo-keywords-for-agenda)) (contents nil) (periods nil) (--cl-var-- (cfw:org-collect-schedules-period begin end)) (i nil) (date nil) (line nil) (range nil)) (while (consp --cl-var--) (setq i (car --cl-var--)) (setq date (cfw:org-tp i (quote date))) (setq line (funcall cfw:org-schedule-summary-transformer i)) (setq range (cfw:org-get-timerange line)) (if range (progn (if (member range periods) nil (setq periods (cons range periods)))) (setq contents (cfw:contents-add (cfw:org-normalize-date date) line contents))) (setq --cl-var-- (cdr --cl-var--))) (nconc contents (list (cons (quote periods) periods))))) cfw:org-schedule-period-to-calendar((9 2 2013) (9 8 2013)) funcall(cfw:org-schedule-period-to-calendar (9 2 2013) (9 8 2013)) [..etc..etc..]

I am using GNU Emacs 24.2.50.1.

Thanks for calfw, it is really nice to be able to display my org-mode calendar in a more visual way than what org-agenda-list does!

No clickable link generated for org items with date-only timestamps

Hi,

I just started using it - thanks for the great package.

It seems calfw-org does not generate clickable links (for cfw:org-onclick) for org items with date-only timestamps.

For example, an item with timestamp <2016-03-01 Tue 09:30> is shown in the calender with clickable 09:30 link, but another item with timestamp <2016-03-01 Tue> is shown in the calender without any clickable links. (<RET> does not work either).

Please let me know if I'm doing something wrong. Thank you so much.

calfw-ical does not show times for calendar items

Hi,

It seems currently calfw-ical does not show times for calendar items, unlike calfw-org. (I'm using calfw-ical for multiple internet calendars using cfw:ical-create-source following the instructions in README).

Would it be possible to show them in the calendar? Thank you so much.

Advance warnings in Org agenda show prematurely in calfw

Thanks for emacs-calfw, which looks appealing!

In Org agenda for today, there are advance warnings which show, in the second column, texts like "In 2 d.:", "In 13 d.:", etc. In calfw, these populate the events for today, while they should rather populate the events for the real due date.

François

Modifying holidays

Hi,
I could not find how to remove holidays from the calendar view. Would you please give an example? I looked at describe-function but could not figure it out.
Thanks

Any new release ?

The last date of release dated October 10 , 2011. Is there a new version planned?

skip whitespace char in diary file

in diary file
if i add more then one whitespace char like this

12/26 [tab][tab]TEST

it breaks calendar buffer
i think skipping whitespace char is better

No display for multi-day Org events

I updated calfw from elpa yesterday (to calfw-20150831.1847) and lost some functionality.

The previous version displayed multi-day Org events as a block. The current version does not.

This may be related to #11, #60, and #63.

Default Org Color

Sorry to post trivial issues here, but I'm having trouble figuring out how to set this based on the documentation.

How can I set the default color of Org items? Currently they are Seagreen4. I'd prefer them to be white.

calfw2org

Hi!
I´m not happy with calfw introducing a template in my list of templates in org.
Furthermore, when I tried it, it just throw some error. What is it supposed to do?

This is the way emacs reacts upon C-c c c.

  • %![Error: (error Not found cfw:component attribute...)]

How to disable this template in my template list? And the "c" is hardcoded, so
any "c" template would be overridden?

emacs 24.3.1, org and calfw from git.

No cfw:fchar-bottom-* variables for customization of bottom grid line

calfw draws the bottom line of the calendar grid as it would draw any other horizontal line there. It doesn't have customization options for the junction characters of the bottom line and just uses cfw:fchar-junction, cfw:fchar-left-junction and cfw:fchar-right-junction, which looks suboptimal. Adding the variables cfw:fchar-bottom-junction, cfw:fchar-bottom-left-corner and cfw:fchar-bottom-right-corner and using them to draw the bottom line of the calendar grid would make the output even more beautiful.

org links break the layout

Hi,

right now org-style links like [[https://github.com][github]] break the layout of the agenda table, it would be great if these could be displayed correctly.

regards,
philipp

Highlight important entries

Hi,

I've been starting to use calfw because I think it's awesome. However, with one issue I got no where. I'm using diary mode and want to highlight important diary entries. As far as I know the readme gives no information about that (except I've overseen something). Is it even a feature or would I have to use second source to highlight some entries with another color.

Many Thanks in advance

Please use standard symbol prefixes

Wonderful package that could be made even more wonderful with standard symbol prefixes.

From Emacs Lisp Coding Conventions:

You should choose a short word to distinguish your program from other Lisp programs. The names of all global symbols in your program, that is the names of variables, constants, and functions, should begin with that chosen prefix. Separate the prefix from the rest of the name with a hyphen, ‘-’. This practice helps avoid name conflicts, since all global variables in Emacs Lisp share the same name space, and all functions share another name space. Use two hyphens to separate prefix and name if the symbol is not meant to be used by other packages.

e.g. cfw:open-calendar-buffer to cfw-open-calendar-buffer :)

Adding export-to-some-markup-format option?

Not an issue, only a request:
I would very much like to be able to export calfw views to some simple markup format like
markdown or org. Is it possible to write a calfw calendar view to a file non-interactively?

Would you consider the inclusion of a patch providing such functionality?

Cannot jump to org entries from calfw using the keyboard

When using calfw-org, you can jump to an org entry by clicking on the
corresponding calfw table entry using the mouse. In theory, you should be able
to do the same by hitting RET when point is on a calfw entry (see
cfw:org-text-keymap).

However, there is no way to set point on a calfw entry except by using the
mouse! All navigation keys (the arrow keys, C-n, C-p, C-f, C-p,...) navigate
by time units (next day, week, month,...), so you can't set point to one
appointment entry contained in some "day cell".

Default view: Two Weeks

The default view is month view. Is there a way to set the default view to be one week or two weeks instead?

Include diary appointment

Hi, like for org or other mode, it will be really interesting to get event for the native mode calendar.el and diary file. Perhaps I miss some configuration to done.

Thanks for this very promising mode.

cfw-org and BBDB anniversaries

I use BBDB to store my contacts informations, and their birthdays too. Org can import them very easily and display them in the agenda view.

cfw-org do that too, but it displays too many things.
I have a birthdays.org file containing a line indicating that my birthdays are in bbdb (the field if called birthday in bbdb)

For example, here is what org-mode gives me in agenda view:
Friday, July, 16th
Birthdays: Birthday: John Doe (50th)

Here is what cfw gives me:
Birthday: [[bbdb:John Doe][John Doe (50th)]] birthdays.org

I wish it would display the same things as org-mode. At least, I don't want to see the bbdb field which repeat the name…

You can find a screenshot here: http://hpics.li/e077445

How could calfw get data from Google iCal/Calendar?

It seems it's working for everyone, but I couldn't find any explaination how I could set this up in sync with Google Calendar. I found only in the README.md this link:

(require 'calfw-ical)
(cfw:open-ical-calendar "http://www.google.com/calendar/ical/.../basic.ics")

But I don know where I could get that link. Anyone have a suggestion?

word wrap for timed org items

Hi,

It seems any timed org items (e.g., 10:00 TODO Something) get truncated in the calendar view, which make things hard to read - especially with the first 9 characters occupied by the time (10:00) and the TODO markers. It would be great if it is possible to wrap these timed items as well.

Symbol's function definition is void: calendar-extract-year

Hi,
I've followed your instruction, but when I launch the command M-x cfw:open-org-calendar the system replies with an error message:
Symbol's function definition is void: calendar-extract-year
I've googled some instruction to put in my initi file about calendar-extract-year but nothing seems to work.
Any idea?
pierfranco

Add example of calfw opening for org-agenda-custom-commands

In org-mode, org-agenda-custom-commands allows customizing the kind of org agenda views to display.

I think it should be great to add to calfw-org's documentation an example on how this could be done.

I'm no emacs lisper but I've hacked the following which seems to work :

(defun open-calfw-agenda-org (coin)
(interactive)
(cfw:open-org-calendar)
)

(setq org-agenda-custom-commands
'(

("G"
"Graphical display in calfw"
open-calfw-agenda-org
)

)
)

There's probably a cleaner way to do the same.

Hope this helps.

Displaying multi-line items

From orgmode ML, [O] [calfw] Better use of space, posted on Thu, 21 Jul 2011.

However, when using especially the two week view (and this is probably
also true for the week view) I would like calfw to utilize vertical
space better. By 'better' I basically mean that I would like calfw to be
greedy.

Refer to the following screenshot:

http://ompldr.org/vOWtjdA

Compare (the second week) to Google Cal:

http://ompldr.org/vOWtjdg

Seeing there is a lot of space left in each of Calfw's day-column it
would be nice if it could be used to enhance the overview. This could
for example be archived mapping events against time on the vertical axis
as the Google calendar does (and also Mozilla Lightning but it no longer
work on my system). This might also allow for printing more text from
the even entry (using multiple lines).

On the other hand we probably also want to make sure that it is still
works on a 800x600 display. Thus, it might be best to introduce a
governing variable.

  • Display multiple-lines items (the source splits an item multiple lines.)

This is not so difficult. In this mechanism, the source objects can
propose some formats, for example, "15:00 appointment" and ("15:00-15:30"
"appointment"). Then, calfw chooses the suitable format and displays
in the current layout algorithm.

I will design the interface between cfw:source and calfw, and
implement it.

Other improvement points are discussed later.

Colors customization

Could you write down how to do color customization, please?

It could be nice to have that information.

Thanks a lot!

Another function for calfw-org.el

The following makes a good option for cfw:read-date-command, as it makes the date selection prompt for calfw works exactly like org-mode.

(defun cfw:org-goto-date ()
  (interactive)
  (let ((xs (decode-time (org-time-string-to-time
                          (org-read-date)))))
    (list (nth 4 xs) (nth 3 xs) (nth 5 xs))))

icalカレンダー取得について

emacs-calfwからgoogle calendarを利用しようとしています。
いくつか不明なところがあって教えて頂けませんでしょうか。

(cfw:ical-create-source "Google" "https://www.google.com/calendar/ical/..../basic.ics" "OrangeRed1")

1.上記コードを実行する際にcalfw-ical.el内部からwgetでbasic.icsファイルをゲットするの
でしょうか。

2.basic.icsファイルの取得は初回起動時のみ行うでしょうか。

3.ICSデータはどこにキャッシングされているでしょうか。

4.カレンダービューで"r"でリフレッシューするとき内部の挙動を教えて頂けませんか。
※TLS通信が起きていることが気になっている。

よろしくお願いします。

Cursor jumps to random position in buffer after calling calfw buffer.

It's a little annoying that the cursor jumps to random position in current buffer after calling calfw buffer.
For example, in buffer A line 113 call cfw:open-calendar-buffer, then switch back to buffer A, the cursor move to line 72 out of no reason.

I just use the following lines of settings, with Emacs 24.3.90.1 (20140411):

(require 'calfw)
(require 'calfw-org)
(require 'calfw-cal)
(global-set-key (kbd "C-c A") 'cfw:open-org-calendar)
(setq cfw:org-capture-template
      '("c" "calfw2org" entry
        (file nil)
        "** %?\n %(cfw:org-capture-day)"))

Do not append directly to org-capture-templates

Since most users customize this variable, directly appending to it causes the Customize buffer to look wrong, since the data appended does not fit the structure specified by the customization. I recommend having 'c' just invoke org-capture, without adding anything to the templates list.

Always overflow hoizontally, after cfw:refresh-calendar-buffer

Hello,

When I call cfw:refesh-calendar-buffer, the calendar components always overflow 1 character.
(Last character is overlapped by continuation glyph.)

It seems that calfw takes width from function window-width, which has following notice in its document:

Note that the returned value includes the column reserved for the
continuation glyph.

I tried in other buffers too and confirmed that I could write only "(window-width) -1" characters in one line.

calfw 20150831.1847
GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0) of 2015-08-20
Terminal.app 2.5.3 (343.7)
OS X Yosemite 10.10.5 (14F27)

Thank you.

`cfw:cp-move-cursor` operates on the wrong buffer; and, suggestions . . .

First off, let me please take this opportunity to say how grateful I am that you invested the time to write such a useful library. It is truly AWESOME! I wish I would have known about it sooner, and I really wish Emacs had these features built in. Thank you, thank you, and thank you!

Example

When running M-x cfw:open-org-calendar from a non-calendar buffer, there are of course several functions that get called one after the other. While going through the chain of functions, we finally get to cfw:cp-set-selected-date. Within the first condition of cfw:cp-set-selected-date, the function cfw:cp-move-cursor is called. As you know, cfw:cp-move-cursor uses the (current-buffer) to set-window-point. This causes point to move upward on whatever the current-buffer happens to be. I would suggest referring to the to the *cfw-calendar* instead of the current-buffer to fix this issue -- e.g.:

(defun cfw:cp-move-cursor (dest date)
  "[internal] Just move the cursor onto the date. This function
is called by `cfw:cp-set-selected-date'."
  (let ((pos (cfw:find-by-date dest date)))
    (when pos
      (goto-char pos)
      (when
          (and
            (get-buffer-window cfw:calendar-buffer-name)
            (not (eql (selected-window) (get-buffer-window cfw:calendar-buffer-name))))
        (set-window-point (get-buffer-window cfw:calendar-buffer-name) pos)))))

FYI No. 1: I'm not a programmer, just a weekend hobbyist. I developed (with the occasional help of a few generous programmers who participate on Stack Overflow) a rotating 12-month calendar that shows birthdays, holidays, appointments, and stuff, which you may enjoy taking a look at. There is no copyright or anything -- if you like any of it, feel free to use some or all of it.

https://github.com/lawlist/lorg-calendar

FYI No. 2: Here is a link to a modification of org-agenda-list to show birthdays and holidays in the *Org Agenda* buffer:

http://emacs.stackexchange.com/a/10872/2287

Suggestion No. 1: I set up birthdays using the same mechanism as you did for holidays, but to achieve a different face, I had to add another argument to (lambda (date week-day hday bday) in a few places and make some other changes. There will be many people who are not so familiar with elisp that will undoubtedly be using your library -- they will likely lack the necessary skills to modify your code to include birthdays, so you may want to consider including it for cfw:open-org-calendar. The birthdays can be set up with holiday-fixed and you could include an example, and set up another variable -- e.g., cfw:show-birthdays. My custom version of your library is already tweaked, so I'm just suggesting it for other people if you are so inclined.

Suggestion No. 2: The face for Saturday needs to be changed to include a condition for a dark background -- it presently has two (2) settings for a light background, instead of one each -- it should be:

(defface cfw:face-saturday
  '((((class color) (background light))
     :foreground "Blue" :background "#d4e5ff" :weight bold)
    (((class color) (background dark))
     :foreground "Blue" :weight bold))
  "Face for Saturday" :group 'calfw)

Suggestion No. 3: Here is a fix for the holiday and weekend numbered dates not having a background color that matches the bar strip across the top of each numbered day -- modify a couple of conditions in the following functions -- cfw:view-month; cfw:view-week; cfw:view-two-weeks; and, cfw:view-day:

 [***]
 (hday 'cfw:face-holiday-date)
 [***]
 (t
   (cfw:render-get-week-date-face week-day 'cfw:face-default-day))

Create a new function:

(defun cfw:render-get-week-date-face (daynum &optional default-face)
  "[internal] Put the default numbered date week face."
  (cond
    ((= daynum cfw:week-saturday)
     'cfw:face-saturday-date)
    ((= daynum cfw:week-sunday)
     'cfw:face-sunday-date)
   (t default-face)))

Create three (3) new faces, or four (4) if you are inclined to add birthdays:

(defface cfw:face-holiday-date
  '((((class color) (background light))
     :background "#ffd5e5")
    (((class color) (background dark))
     :background "grey10" :foreground "OrangeRed" :weight bold))
  "Face for holidays date." :group 'calfw)

(defface cfw:face-sunday-date
  '((((class color) (background light))
     :foreground "red2" :background "#ffd5e5" :weight bold)
    (((class color) (background dark))
     :background "grey10" :foreground "red" :weight bold))
  "Face for Sunday date." :group 'calfw)

(defface cfw:face-saturday-date
  '((((class color) (background light))
     :foreground "Blue" :background "#d4e5ff" :weight bold)
    (((class color) (background dark))
     :background "grey10" :foreground "blue" :weight bold))
  "Face for Saturday date." :group 'calfw)

Suggestion No. 4: The background colors of the two overlays relating to the today title bar and the selected date title bar conflict in that Emacs does not know which takes priority over the other -- sometimes today will show the today background when it is the selected, or sometimes visa-versa. I dealt with this issue by doing something not fully supported yet according to the overlay documentation -- i.e., I added a negative priority to the today face title bar -- within the function cfw:dest-ol-today-set, I added (overlay-put overlay 'priority -1). This resolves the conflict in favor of the selected date. I took it one step further by modifying cfw:dest-ol-selection-set to make a determination whether (equal date (calendar-current-date)) and if so, then use a new face for today+selected and of course I created that new face.

Suggestion No. 5:  The calendar view presently only display a schedule of org-mode events for the current month. This is problematic because the calendar views (month, week, two-weeks) may show a few days before the beginning of the month, and/or a few days following the end of the month. Let's say we are looking at the month view of May 2015 -- in this example, April 26 to 30 are visible, and so is June 1 to 6. There may be some very important events in the org-mode files that need to display during those periods that are outside the current month. Here is an example of how to fix this problem (the screenshot above includes the fix):

(defun cfw:view-model-make-common-data-for-weeks (model begin-date end-date)
  "[internal] Return a model object for week based views."
  (let* (
      ;; a list of the index of day-of-week
      (index-days-of-week (cfw:view-model-make-day-names-for-week))
      ;; a matrix of day-of-month, which corresponds to the index of `headers'
      (matrix-days-of-month
        (cfw:view-model-make-weeks
          (cfw:week-begin-date begin-date)
            (cfw:week-end-date end-date)))
      (first (car (car matrix-days-of-month)))
      (last (car (last (car (last matrix-days-of-month))))) )
  (cfw:model-create-updated-view-data model
    (cfw:view-model-make-common-data model first last
      `((headers . ,index-days-of-week)
        (weeks . ,matrix-days-of-month))))))

Suggestion No. 6: I added some new faces for Saturday and Sunday in the week titles, so that they are a different color than the numbered date -- see the screenshot above.

Suggestion No. 7: I didn't see a setting to programmatically open a calendar buffer on a specific month/year WHEN no calendar buffer exists, so here is my modification (e.g., from a *scratch* buffer, a user might want to jump directly to July of the current year to see what's on calendar that month) -- and, I added functions bound from f1 to f12 and also put them in the menubar (for when a user is already inside a calendar buffer).

Suggestion No. 8: The other thing you might want to consider is adding a toolbar menu, which also works for people using a mouse context menu or when the user clicks on the major-mode name in the mode-line. I use a right-click mouse pop-up menu that is a customized version of the menu-bar, and I hide the menu-bar to save extra screen real estate.

EXAMPLES FOR SUGGESTIONS 7 AND 8

(defun cfw:open-org-calendar (&optional init-date goto-today)
"Open an org schedule calendar in the new buffer."
(interactive)
  (let* (
      (source1 (cfw:org-create-source))
      (cp
        (cfw:create-calendar-component-buffer
          :date init-date
          :view 'month
          :contents-sources (list source1)
          :custom-map cfw:org-schedule-map
          :sorter 'cfw:org-schedule-sorter)) )
    (switch-to-buffer (cfw:cp-get-buffer cp))
    (when goto-today
      (let* (
          (today (calendar-current-date))
          (dest (cfw:component-dest (cfw:cp-get-component)))
          (first-date (cfw:find-first-date dest))
          (last-date (cfw:find-last-date dest))
          (today-is-visible-p (cfw:date-between first-date last-date today)))
        (when today-is-visible-p
          (cfw:navi-goto-date today))))
    (set-window-start (get-buffer-window cfw:calendar-buffer-name) (point-min))))

(defun cfw:f1 ()
"January of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 01 01 current-year) 'today-maybe)))

(defun cfw:f2 ()
"February of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 02 01 current-year) 'today-maybe)))

(defun cfw:f3 ()
"March of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 03 01 current-year) 'today-maybe)))

(defun cfw:f4 ()
"April of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 04 01 current-year) 'today-maybe)))

(defun cfw:f5 ()
"May of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 05 01 current-year) 'today-maybe)))

(defun cfw:f6 ()
"June of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 06 01 current-year) 'today-maybe)))

(defun cfw:f7 ()
"July of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 07 01 current-year) 'today-maybe)))

(defun cfw:f8 ()
"August of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 08 01 current-year) 'today-maybe)))

(defun cfw:f9 ()
"September of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 09 01 current-year) 'today-maybe)))

(defun cfw:f10 ()
"October of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 10 01 current-year) 'today-maybe)))

(defun cfw:f11 ()
"November of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 011 01 current-year 'today-maybe))))

(defun cfw:f12 ()
"December of the current year."
(interactive)
  (let ((current-year (nth 2 (calendar-current-date))))
    (cfw:open-org-calendar (list 012 01 current-year 'today-maybe))))

(defvar cfw:calendar-mode-map
  (let* (
      (map (make-sparse-keymap))
      (current-year (nth 2 (calendar-current-date))))
    (define-key map [menu-bar cfw]
      (cons "CFW" (make-sparse-keymap "CFW")))
     (define-key map [right] 'cfw:navi-next-day-command)
     (define-key map "f"       'cfw:navi-next-day-command)
     (define-key map "l" 'cfw:navi-next-day-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-next-day-command]
       '(menu-item "Next Day" cfw:navi-next-day-command
                   :help "My help sentence."))
     (define-key map [left]  'cfw:navi-previous-day-command)
     (define-key map "b"       'cfw:navi-previous-day-command)
     (define-key map "h" 'cfw:navi-previous-day-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-previous-day-command]
       '(menu-item "Previous Day" cfw:navi-previous-day-command
                   :help "My help sentence."))
     (define-key map [down]  'cfw:navi-next-week-command)
     (define-key map "n"       'cfw:navi-next-week-command)
     (define-key map "j" 'cfw:navi-next-week-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-next-week-command]
       '(menu-item "Next Week" cfw:navi-next-week-command
                   :help "My help sentence."))
     (define-key map [up]    'cfw:navi-previous-week-command)
     (define-key map "p"       'cfw:navi-previous-week-command)
     (define-key map "k" 'cfw:navi-previous-week-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-previous-week-command]
       '(menu-item "Previous Week" cfw:navi-previous-week-command
                   :help "My help sentence."))
     (define-key map "^" 'cfw:navi-goto-week-begin-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-goto-week-begin-command]
       '(menu-item "Week Begin" cfw:navi-goto-week-begin-command
                   :help "My help sentence."))
     (define-key map "$" 'cfw:navi-goto-week-end-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-goto-week-end-command]
       '(menu-item "Week End" cfw:navi-goto-week-end-command
                   :help "My help sentence."))
     (define-key map "["   'cfw:navi-previous-month-command)
     (define-key map "M-v" 'cfw:navi-previous-month-command)
     (define-key map [prior] 'cfw:navi-previous-month-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-previous-month-command]
       '(menu-item "Previous Month" cfw:navi-previous-month-command
                   :help "My help sentence."))
     (define-key map "]"   'cfw:navi-next-month-command)
     (define-key map "C-v" 'cfw:navi-next-month-command)
     (define-key map [next]  'cfw:navi-next-month-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-next-month-command]
       '(menu-item "Next Month" cfw:navi-next-month-command
                   :help "My help sentence."))
     (define-key map [home]  'cfw:navi-goto-first-date-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-goto-first-date-command]
       '(menu-item "First Date" cfw:navi-goto-first-date-command
                   :help "My help sentence."))
     (define-key map [end]   'cfw:navi-goto-last-date-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-goto-last-date-command]
       '(menu-item "Last Date" cfw:navi-goto-last-date-command
                   :help "My help sentence."))
     (bindings--define-key map [menu-bar cfw sep] menu-bar-separator)
     (define-key map "g" 'cfw:navi-goto-date-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-goto-date-command]
       '(menu-item "Goto Date" cfw:navi-goto-date-command
                   :help "My help sentence."))
    (define-key map [menu-bar cfw goto]
      (cons
        (format "Goto Month -- %s" current-year)
        (make-sparse-keymap "Goto Month")))
     (define-key map [f12] 'cfw:f12)
     (bindings--define-key map [menu-bar cfw goto cfw:f12]
       `(menu-item (format "December %s" ,current-year)
          cfw:f12
          :help "Click to jump to December."))
     (define-key map [f11] 'cfw:f11)
     (bindings--define-key map [menu-bar cfw goto cfw:f11]
       `(menu-item (format "November %s" ,current-year)
          cfw:f11
          :help "Click to jump to November."))
     (define-key map [f10] 'cfw:f10)
     (bindings--define-key map [menu-bar cfw goto cfw:f10]
       `(menu-item (format "October %s" ,current-year)
          cfw:f10
          :help "Click to jump to October."))
     (define-key map [f9] 'cfw:f9)
     (bindings--define-key map [menu-bar cfw goto cfw:f9]
       `(menu-item (format "September %s" ,current-year)
          cfw:f9
          :help "Click to jump to September."))
     (define-key map [f8] 'cfw:f8)
     (bindings--define-key map [menu-bar cfw goto cfw:f8]
       `(menu-item (format "August %s" ,current-year)
          cfw:f8
          :help "Click to jump to August."))
     (define-key map [f7] 'cfw:f7)
     (bindings--define-key map [menu-bar cfw goto cfw:f7]
       `(menu-item (format "July %s" ,current-year)
          cfw:f7
          :help "Click to jump to July."))
     (define-key map [f6] 'cfw:f6)
     (bindings--define-key map [menu-bar cfw goto cfw:f6]
       `(menu-item (format "June %s" ,current-year)
          cfw:f6
          :help "Click to jump to June."))
     (define-key map [f5] 'cfw:f5)
     (bindings--define-key map [menu-bar cfw goto cfw:f5]
       `(menu-item (format "May %s" ,current-year)
          cfw:f5
          :help "Click to jump to May."))
     (define-key map [f4] 'cfw:f4)
     (bindings--define-key map [menu-bar cfw goto cfw:f4]
       `(menu-item (format "April %s" ,current-year)
          cfw:f4
          :help "Click to jump to April."))
     (define-key map [f3] 'cfw:f3)
     (bindings--define-key map [menu-bar cfw goto cfw:f3]
       `(menu-item (format "March %s" ,current-year)
          cfw:f3
          :help "Click to jump to March."))
     (define-key map [f2] 'cfw:f2)
     (bindings--define-key map [menu-bar cfw goto cfw:f2]
       `(menu-item (format "February %s" ,current-year)
          cfw:f2
          :help "Click to jump to February."))
     (define-key map [f1] 'cfw:f1)
     (bindings--define-key map [menu-bar cfw goto cfw:f1]
       `(menu-item (format "January %s" ,current-year)
          cfw:f1
          :help "Click to jump to January."))
     (define-key map "t" 'cfw:navi-goto-today-command)
     (define-key map "." 'cfw:navi-goto-today-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-goto-today-command]
       '(menu-item "Today" cfw:navi-goto-today-command
                   :help "My help sentence."))
     (define-key map [tab] 'cfw:navi-next-item-command)
     (bindings--define-key map [menu-bar cfw cfw:navi-next-item-command]
       '(menu-item "Next Item" cfw:navi-next-item-command
                   :help "My help sentence."))
     (define-key map "r"   'cfw:refresh-calendar-buffer)
     (bindings--define-key map [menu-bar cfw cfw:refresh-calendar-buffer]
       '(menu-item "Refresh" cfw:refresh-calendar-buffer
                   :help "My help sentence."))
     (define-key map [?\s] 'cfw:show-details-command)
     (bindings--define-key map [menu-bar cfw cfw:show-details-command]
       '(menu-item "Details" cfw:show-details-command
                   :help "My help sentence."))
     (define-key map "D" 'cfw:change-view-day)
     (bindings--define-key map [menu-bar cfw cfw:change-view-day]
       '(menu-item "Day View" cfw:change-view-day
                   :help "My help sentence."))
     (define-key map "W" 'cfw:change-view-week)
     (bindings--define-key map [menu-bar cfw cfw:change-view-week]
       '(menu-item "Week View" cfw:change-view-week
                   :help "My help sentence."))
     (define-key map "T" 'cfw:change-view-two-weeks)
     (bindings--define-key map [menu-bar cfw cfw:change-view-two-weeks]
       '(menu-item "2-Week View" cfw:change-view-two-weeks
                   :help "My help sentence."))
     (define-key map "M" 'cfw:change-view-month)
     (bindings--define-key map [menu-bar cfw cfw:change-view-month]
       '(menu-item "Month View" cfw:change-view-month
                   :help "My help sentence."))
     (define-key map "q" 'bury-buffer)
     (bindings--define-key map [menu-bar cfw burry-buffer]
       '(menu-item "Burry Buffer" burry-buffer
                   :help "My help sentence."))
     (define-key map [mouse-1] 'cfw:navi-on-click)
     (define-key map "0" 'digit-argument)
     (define-key map "1" 'digit-argument)
     (define-key map "2" 'digit-argument)
     (define-key map "3" 'digit-argument)
     (define-key map "4" 'digit-argument)
     (define-key map "5" 'digit-argument)
     (define-key map "6" 'digit-argument)
     (define-key map "7" 'digit-argument)
     (define-key map "8" 'digit-argument)
     (define-key map "9" 'digit-argument)
    map)
  "Keymap for `cfw:calendar-mode'.")

(defvar cfw:org-schedule-map
  (let ((map (make-sparse-keymap)))
     (define-key map [menu-bar cfw]
       (cons "CFW-SCHEDULE" (make-sparse-keymap "CFW-SCHEDULE")))
     (bindings--define-key map [menu-bar cfw sep-agenda] menu-bar-separator)
     (define-key map "A" 'cfw:org-open-agenda-day)
     (bindings--define-key map [menu-bar cfw cfw:org-open-agenda-day]
       '(menu-item "Agenda" cfw:org-open-agenda-day
                   :help "My help sentence."))
    map)
  "Keymap for `cfw:org-schedule-map'.")

Google map integration

Selecting a schedule item with the location attribute on the calfw calendar,
one wants to open the google-map buffer for the location in other window.

http://julien.danjou.info/google-maps-el.html

Currently, calfw-ical doesn't hold the original ics data text.

Then, calfw-ical should put the text property on the ics items so as to get the original contents.

shortcut for calfw-org

i made "clean exit #20" related function.
(close all buffer opened by calfw-org)

but i do not know how to add shortcut in calfw buffer.

can you tell me how to add it?

[Request] Clean exit

With org-agenda, we have 2 possibilities for quitting: "q" or "x".

When pressing "q", it acts like calfw.

When pressing "x", it closes all buffers that have been opened for the calendar too.

Calfw should offer the possibility to quit with "x" and closes buffers related to the calendar. This would let us have a cleaner buffer list.

Indeed, I always have to kill my .bbdb buffer and some *.org buffers opened after seeing my agenda… quite annoying.

diary with multiple entries

When I have multiple entries for a day in the diary, calfw shows only the first entry. I'd assume there is a problem with the regexp that parses the diary. Can you please fix this? It is virtually impossible to use calfw if I can see only one entry per day. Thanks!!

Calendar tables get confused by inline images (display text properties)

I've just discovered calfw and it's awesome! I use it together with org-mode.

One minor glitch is that the tables get confused by images. For example, in
one of my org files I have this entry:

* Wetter                                                            :weather:
** Montabaur
   :PROPERTIES:
   :CATEGORY: Montabaur 
   :LOCATION: Montabaur, Germany
   :END:
%%(org-google-weather "Montabaur" "de")

This uses the org-google-weather package to insert a short weather forecast
including an icon (sunny, cloudy, etc.) into the org agenda buffer.

Screenshot Org Agenda: http://dl.dropbox.com/u/30611246/img/org-agenda.png

When that is converted to a calfw calendar table, then the borders of the cells
are wrong.

Screenshot Calfw: http://dl.dropbox.com/u/30611246/img/org-calfw.png

Clearly, the table code relies on monospaced fonts and images don't fit well
here. So I think you should just strip images, that is, the display text
property.

This is a very simply patch that fixes the issue for me:

diff --git a/calfw-org.el b/calfw-org.el
index 99fe18e..5dcdc17 100644
--- a/calfw-org.el
+++ b/calfw-org.el
@@ -69,7 +69,10 @@
          (buffer (marker-buffer marker)))
     (propertize
      (concat item " " (buffer-name buffer))
-     'keymap cfw:org-text-keymap)))
+     'keymap cfw:org-text-keymap
+     ;; Delete the display property, since displaying images will break our
+     ;; table layout.
+     'display nil)))

 (defvar cfw:org-schedule-summary-transformer 'cfw:org-summary-format
   "Transformation function which transforms the org item string to calendar title.

However, I'm not convinced that it is a good idea to only fix the org mode
stuff. Most probably the filtering (or better, a nifty implementation of how
to correctly handle display specs) of display text properties should be in
calfw.el, but I can't spot the right location at a first glance.

Optional row-centric visualization (instead of column-centric)

Hi!

Most of my agenda entries are much longer than high. Therefore I would love to see an alternative style for example for a week where Monday is the first row (instead of the first column) in the layout. Tuesday is the row below and so forth. In contrast to the usual weekly agenda, I would love to see a second column with either next week or the second half of the current week (see image below).

My content could be displayed much better since with the current calfw, I only see the Org-mode file and probably the first two words of each entry - which is not of any help in most cases.

I attached an example sketch of a view I would like to use:

2013-01-14T10 10 Screenshot - calfw week view sketch

So it's more or less the same way as now but in a transposed form.

ICS recurrent event

hi
i've setup calfw to display some ics calendars from my Google account. It works fine, but i've got an error: reccurent event aren't display (like weekly or yearly event).
Any idea ?

modify on cfw:open-org-calendar

i modified cfw:open-org-calendar

  • add diary item on cfw:open-org-calendar

but i dont know other people like it

i did not requested this modification

Week view: show only Monday-Friday

It would be nice to be able to configure what days of the week are displayed (i.e. I only use the calendar for work stuff, so showing Saturday and Sunday isn't necessary, and the extra space could be used to avoid so much wordwrapping).

calfw looks great!

calfw does not show an Emacs diary block as a period

This is similar to #11, but for periods, also known as 'blocks' from the Emacs diary file, instead of from org-mode.

For example, if my diary file includes this:

  %%(diary-block 11 1 2014 12 5 2014) Chapel routine

I'd like to see that displayed as a calfw period, instead of as a "Chapel routine" item on every day in the range.

customize width of cells in monthly view?

If I adjust the font size to be very small in a Calfw buffer, the size of the cells stays the same.
Accordingly, if I have something scheduled using Org Mode, I just see something like this:

 27 (1) ...
HIGH [#A...

I need to switch to Day mode (D) to see what the item was.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.