Browse Source

Adding a new blog post about Calendar oragnization with org

master
Elia el Lazkani 2 weeks ago
parent
commit
c87026b414
  1. BIN
      images/calendar-organization-with-org/01-calendar-overview.png
  2. BIN
      images/calendar-organization-with-org/02-calendar-day-overview.png
  3. BIN
      images/calendar-organization-with-org/03-calendar-day-closed-item-overview.png
  4. 158
      posts/text-editors/calendar-organization-with-org.org

BIN
images/calendar-organization-with-org/01-calendar-overview.png (Stored with Git LFS)

size 40108

BIN
images/calendar-organization-with-org/02-calendar-day-overview.png (Stored with Git LFS)

size 47204

BIN
images/calendar-organization-with-org/03-calendar-day-closed-item-overview.png (Stored with Git LFS)

size 52938

158
posts/text-editors/calendar-organization-with-org.org

@ -0,0 +1,158 @@
#+BEGIN_COMMENT
.. title: Calendar Organization with Org
.. date: 2021-05-30 22:00:00
.. slug: calendar-organization-with-org
.. updated: 2021-05-30 22:00:00
.. status: published
.. tags: org, emacs, calendar, organization
.. category: text-editor
.. authors: Elia el Lazkani
.. description: Calendar organization with org in emacs
.. type: text
#+END_COMMENT
I have been having /some/ issues with my calendar. Recurring stuff have been going out of wack for some reason. In general, the setup I've had for the past few years have now become a problem I need to fix.
I decided to turn to my trusted /emacs/, like I usually do. /Doom/ comes bundled with something. Let's figure out what it is and how to configure it together.
{{{TEASER_END}}}
* Calendar in Emacs
I dug deeper into /Doom/'s /Calendar/ module and I found out that it is using [[https://github.com/kiwanami/emacs-calfw][calfw]].
I went to /GitHub/ and checked the project out. It's another emacs package, I'm going to assume you know how to install it.
Let's look at the configuration example.
#+begin_src emacs-lisp
(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
)))
#+end_src
That looks like an extensive example. We don't need all of it, I only need the part pertaining to /org/.
* Configuration
The example looks straight forward. I'm going to keep /only/ the pieces I'm interested in. The configuration looks like the following.
#+begin_src emacs-lisp
(require 'calfw-cal)
(require 'calfw-org)
(defun my-blog-calendar ()
(interactive)
(cfw:open-calendar-buffer
:contents-sources
(list
(cfw:org-create-file-source "Blog" "~/blog.org" "Orange") ; our blog organizational calendar
)))
#+end_src
That was easy. but before we jump to the next step, let's a bit about what we just did.
We, /basically/, created a new function which we can call later with =M-x= to open our calendar.
We configured the function to include the /org/ files we want it to keep track of.
In this case, we only have one. We named it *Blog* and we gave it the color *Orange*.
* Creating our org file
After we have configured =calfw=, we can create the =blog.org= file.
#+begin_src org
,#+TITLE: Blog
,#+AUTHOR: Who
,#+DESCRIPTION: Travels of Doctor Who
,#+TAGS: organizer organization calendar todo tasks
,* Introduction
This is the /calendar/ of *Dr Who* for the next week.
,* Travels
,** DONE Travel to Earth 1504
CLOSED: <2021-07-03 za 09:18> SCHEDULED: <2021-07-02 vr>
- CLOSING NOTE <2021-07-03 za 09:18> \\
The doctor already traveled to earth /1504/ for his visit to the /Mayans/.
A quick visit to the /Mayan/ culture to save them from a deep lake monster stealing all their gold.
,** TODO Travel back to Earth 2021
SCHEDULED: <2021-07-04 zo>
Traveling back to earth 2021 to drop the companion before running again.
,** TODO Travel to the Library
SCHEDULED: <2021-07-04 zo>
The doctor visits the /Library/ to save it again from paper eating bacteria.
,** TODO Travel to Midnight
SCHEDULED: <2021-07-08 do>
The doctor visits *Midnight* in the /Xion System/.
,** TODO Travel to Earth 2021
SCHEDULED: <2021-07-09 vr>
Snatching back the companion for another travel advanture.
#+end_src
* Let's get the party started
Now that we have everything set into place. We can either /reload/ /emacs/ or simply run the code snippet that declares /our/ function.
Next step is checking out if it works. Let's run =M-x= then call our function =my-blog-calendar=.
#+BEGIN_EXPORT html
<a class="image-reference align-center" href="/images/calendar-organization-with-org/01-calendar-overview.png" alt="Alternative Title">
<img src="/images/calendar-organization-with-org/01-calendar-overview.thumbnail.png" class="align-center">
<p class="caption align-center">Calendar organization with Org</p>
</a>
#+END_EXPORT
If we go to a date with =hjkl= and hit =return= or =enter=, we get to see what we have to work with.
#+BEGIN_EXPORT html
<a class="image-reference align-center" href="/images/calendar-organization-with-org/02-calendar-day-overview.png" alt="Alternative Title">
<img src="/images/calendar-organization-with-org/02-calendar-day-overview.thumbnail.png" class="align-center">
<p class="caption align-center">Calendar day overview</p>
</a>
#+END_EXPORT
We can take a look at closed items with /time/ too.
#+BEGIN_EXPORT html
<a class="image-reference align-center" href="/images/calendar-organization-with-org/03-calendar-day-closed-item-overview.png" alt="Alternative Title">
<img src="/images/calendar-organization-with-org/03-calendar-day-closed-item-overview.thumbnail.png" class="align-center">
<p class="caption align-center">Calendar day with closed item</p>
</a>
#+END_EXPORT
That looks pretty nice.
* Conclusion
I thought it was going to be more extensive to configure the calendaring feature in /emacs/.
I couldn't be further away from the truth.
Not only was it a breeze to configure, it was even easier to create the calendar and maintain it.
If you are already familiar with /org/, then you're already there.
Point the calendar to your /org/ file, /iCal/ file or even /Google Calendar/ link and you're all set.
The bottom line of working with /org/ is the ease of use, to me.
If you already use it to organize some aspects of your life, you can just as easily create calendars for all these events.
Loading…
Cancel
Save