From f5b20152dd4b8f802bae4fffb1200b354ca8a9db Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 8 Jul 2018 19:16:29 +0200 Subject: [PATCH] =?UTF-8?q?[Helm]=20Make=20new=20clock-in=20functionality?= =?UTF-8?q?=20for=20=E2=80=98helm-org=E2=80=99=20a=20bit=20nicer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 03a961e..0faae44 100644 --- a/init.el +++ b/init.el @@ -922,12 +922,25 @@ are assumed to be of the form *.crt." helm-source-bookmarks helm-source-bookmark-set)) - ;; Make clocking in the new default action for + ;; Add action to clock in at current heading to ;; `helm-org-agenda-files-headings’ + + (defun helm-org--clock-in-at-heading (marker) + "Clock in to current heading at MARKER." + (org-with-point-at marker + (org-clock-in))) + + (defun helm-org-clock-in-at-heading () + (interactive) + (with-helm-alive-p + (helm-exit-and-execute-action 'helm-org--clock-in-at-heading))) + (add-to-list 'helm-org-headings-actions - '("Clock in to this heading" . (lambda (marker) - (org-with-point-at marker - (org-clock-in))))))) + '("Clock in to this heading" + . helm-org--clock-in-at-heading) + t) + + (bind-key "C-c c" 'helm-org-clock-in-at-heading helm-org-headings-map))) (use-package ivy :commands (ivy-mode