From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph LANGE Subject: Useful interactive functions for clock logs, and workarounds for large agenda files Date: Tue, 12 Jul 2016 23:48:46 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN5Y6-0002BR-6G for emacs-orgmode@gnu.org; Tue, 12 Jul 2016 17:49:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bN5Xz-0004L4-Qc for emacs-orgmode@gnu.org; Tue, 12 Jul 2016 17:49:00 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN5Xz-0004Kf-HT for emacs-orgmode@gnu.org; Tue, 12 Jul 2016 17:48:55 -0400 Received: by mail-wm0-x22c.google.com with SMTP id f126so6158159wma.1 for ; Tue, 12 Jul 2016 14:48:55 -0700 (PDT) Received: from [192.168.1.5] (x5d814c6d.dyn.telefonica.de. [93.129.76.109]) by smtp.googlemail.com with ESMTPSA id x194sm2971316wmf.13.2016.07.12.14.48.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2016 14:48:53 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" Dear Org-mode community, I have recently developed a few functions related to clocking and the agenda, which are highly useful for me. So far I haven't found the time to add them to worg, but as I have meanwhile open-sourced my Emacs configuration, I thought I'd point you there for now. There is: 1. org-clock-split-current-interval https://github.com/clange/emacs/blob/master/.emacs.d/init/org-clock.el#L18 (stable link to current revision: https://github.com/clange/emacs/blob/f340dc1517f2a8017dd3a6f11124740c6af9367c/.emacs.d/init/org-clock.el#L18) This function splits the CLOCK time interval in the current line in two. Use case: you logged time on some task but afterwards realise that part of the time was spent on some other task. See https://lists.gnu.org/archive/html/emacs-orgmode/2015-03/msg01054.html for the original description, but meanwhile I have improved the function. 2. org-clock-change-hh-mm https://github.com/clange/emacs/blob/master/.emacs.d/init/org-clock.el#L102 (stable link to current revision: https://github.com/clange/emacs/blob/f340dc1517f2a8017dd3a6f11124740c6af9367c/.emacs.d/init/org-clock.el#L102) This function changes the HH:MM parts of the CLOCK time interval in the current line. My main use case for this: adding time logged outside of org-mode to one's org file. When not at my computer, I log time in an unstructured way on my phone, e.g. like this: Tue 12 Taskname 22:00-22:11, 23:31-23:45 (This is mainly because the VimTouch trick explained in https://lists.gnu.org/archive/html/emacs-orgmode/2014-10/msg00089.html no longer works for me, as on a non-rooted device one can't edit .vimrc any more.) I add such logs to my org file by first creating a CLOCK line for the right day, e.g. copied from somewhere else and possibly changed to the right day using org-shiftcontrolup, and then modifying the HH:MM parts. This has so far been quite cumbersome to do manually, as it required me to jump around a lot in the line. 3. a variant of org-calendar-goto-agenda that does not display an agenda with the default timespan but always just for one day, bound to the key "C" in the calendar. I need this because I'm lazy and keep all my history in one large org file (5.5 MB, grown over 6.5 years), which slows down the agenda. https://github.com/clange/emacs/blob/master/.emacs.d/init/org.el#L67 (stable link to current revision: https://github.com/clange/emacs/blob/774b6d5ac33102dfd8bbc68b18a5a1227c486f75/.emacs.d/init/org.el#L67) BTW, I have more workarounds for coping with large agenda files; see e.g. https://github.com/clange/emacs/blob/master/.emacs.d/init/org.el#L76 (https://github.com/clange/emacs/blob/774b6d5ac33102dfd8bbc68b18a5a1227c486f75/.emacs.d/init/org.el#L76) for how to export the agenda of the next month to an external file. I also have code for extracting from an org file only those tasks on which time was logged in a given interval, which is useful e.g. for (re-)generating clocktables for these intervals. Please let me know if you are interested. This is implemented as a Makefile plus shell and Perl scripts and is currently hosted in the same private repository in which I have my org files, but in principle I'm happy to open it. Cheers, Christoph -- Dr. Christoph Lange, Enterprise Information Systems Department Applied Computer Science @ University of Bonn; Fraunhofer IAIS http://langec.wordpress.com/about, Skype duke4701 → Please note: I will be on parental leave from 29 July to 28 October. Colleagues will stand in for me by project.