[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Stop clock on closing emacs
From: |
Igor Sosa Mayor |
Subject: |
Re: [O] Stop clock on closing emacs |
Date: |
Sun, 9 Feb 2014 00:00:05 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am Mon, Feb 03, 2014 at 01:39:25PM +0100, Sebastien Vauban wrote:
> A variation:
>
> --8<---------------cut here---------------start------------->8---
> ;; ask the user if they wish to clock out before killing Emacs
> (defun my/org-query-clock-out ()
> "Ask the user before clocking out.
> This is a useful function for adding to `kill-emacs-query-functions'."
> (if (and (featurep 'org-clock)
> (funcall 'org-clocking-p)
> (y-or-n-p "You are currently clocking time, clock out? "))
> (org-clock-out)
> t)) ; only fails on keyboard quit or error
>
> (add-hook 'kill-emacs-query-functions 'my/org-query-clock-out)
> --8<---------------cut here---------------end--------------->8---
thanks! I will give it a try!
--
:: Igor Sosa Mayor :: address@hidden ::
:: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ ::
:: jabberid: rogorido :: ::