[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: |
Sat, 1 Feb 2014 14:07:13 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am Sat, Feb 01, 2014 at 01:03:07PM +0100, Florian Beck wrote:
> Use `kill-emacs-hook':
>
> (defun org-clock-out-maybe ()
> "Stop a currently running clock."
> (org-clock-out nil t))
>
> (add-hook 'kill-emacs-hook 'org-clock-out-maybe)
Thanks a lot. This is much better. But: are you really using this idea?
The problem is that the kill-emacs-hook does not ask for save the
modified buffer. That means: I see that the end time is being put into
the org buffer, but the buffer/file is not being saved...
I solved the problem (but maybe there is a more elegant way...) adding
the following:
(defun org-clock-out-maybe ()
"Stop a currently running clock."
(org-clock-out nil t)
(org-save-all-org-buffers))
--
:: Igor Sosa Mayor :: address@hidden ::
:: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ ::
:: jabberid: rogorido :: ::