📜 ⬆️ ⬇️

Time tracking with Emacs and org-mode

If you, like me, are paid hourly, then surely the customer will want to know what exactly the time has taken and how much.
And in any case, it is useful to know this, even if only for yourself.

In this article I will talk about one of the ways to account for the time spent - org-mode in Emacs.
This method is good because it is very flexible and, if you wish, everything is customized for yourself, it works on almost all operating systems and platforms, and is quite simple to use.

image

I myself work almost exclusively on Linux, but in this article I will use Windows XP for the purity of the experiment and attracting alternative OS users to the ranks of Emacs users.
I want to show that Emacs is convenient even under Windows and is not at all scary (rumors about the need for a foot drive for typing Emacs shortcuts are greatly exaggerated :-)).
In Linux, everything is about the same (Emacs is better to install using the distribution package manager).
')
So first we need Emacs.
Emacs is a text editor (there are many opinions on this subject, but for the purposes of this article we will consider it a text editor :-)) from the Unix world, but it also works fine in Windows.
And org-mode is one of the many modes for Emacs, it has many features (including time tracking) and has recently been included in the standard GNU Emacs distribution.

Downloading GNU Emacs from here: http://ftp.gnu.org/gnu/emacs/windows/emacs-22.3-bin-i386.zip (37 MB)
Unpack the archive (preferably in a directory without spaces).
Suppose we unpacked in D: \ emacs-22.3, then in D: \ emacs-22.3 \ bin there will be an addpm.exe file that needs to be run once, and it will add a shortcut to the Start menu to launch Emacs.
And you can not run this file - not necessarily, but just immediately run D: \ emacs-22.3 \ bin \ runemacs.exe

In general, we run Emacs, create a new file (click on the icon), give the file the .org extension (not necessarily, but conveniently; you can also .txt and whatever, in general).
In the future, it will be possible to configure that org-mode will be turned on by default for files (.org is often already configured in Linux), but for now just type Alt + x org-mode ENTER (instead of Alt + x, in Emacs it’s customary to write Mx ), after which the buffer with the open file will go into org-mode.

Now we will create several items for the TODO list: we will begin each item with an asterisk and the word TODO in large letters.
Asterisks in org-mode are a way to highlight header levels. One asterisk is like <h1> in HTML, two asterisks - <h2>, etc. Better, of course, five stars, but I digress ...
In the TODO-list items, you can also specify additional information, not just the title. For example, I added a link (links in org-mode are clickable).

image

Next, go to Org -> Logging work and tick the “Record DONE Time” checkbox so that when the item from the TODO list is completed, the completion time is saved - this is convenient.

And now - the most interesting: go to the list item that we start working on (click), and from the same Org -> Logging work menu, select Clock in (of course, in the future it will be more convenient for you to do all this with hot keys, since they are signed near the menu items).
All time has gone. Finished working on this item or just gathered for dinner - Org -> Logging work -> Clock out. There you can do as many times as you want - time will be summed up.

image

When the work on any item has been fully completed, it is necessary to transfer it from the TODO state to DONE: Org -> TODO Lists -> TODO / DONE, while the time counter working on this item may be stopped.

At the end of the day (hour, week of the month, for a certain period - everything is configured), you can create a pivot table of the elapsed time.
To do this, go to the part of the file where we want to place the pivot table (preferably at the very beginning, before all the items) and select Org -> Logging work -> Create clock table.

image
Yes, the picture is the same as at the very beginning

You can delete unnecessary columns / lines from this table, export to a file (all through the Tbl menu is also part of org-mode) and send it to the customer in a letter:

*Total file time* *24:05*
DONE Emacs 0:01
TODO habrahabr 0:02
TODO 24:02

In general, everything.

Of course, the capabilities of org-mode are not limited only to the consideration of time: for example, there is even a built-in tabular processor like Excel, with formulas.
If you want to read more about org-mode: orgmode.org/org.html or built-in documentation (in menu Org -> Documentation -> Info Documentation).
Even on youtube there is a record of interesting speech by the author org-mode on Google: www.youtube.com/watch?v=oJTwQvgfgMM
Also interesting is the article habrahabr.ru/blogs/emacs/28098

Well, about Emacs itself, in general, the documentation of the mountain.

Source: https://habr.com/ru/post/63424/


All Articles