From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Sosa Mayor Subject: Re: Stop clock on closing emacs Date: Sat, 1 Feb 2014 14:07:13 +0100 Message-ID: <20140201130713.GA18536@pedroche.uni-erfurt.de> References: <20140201104512.GA10687@pedroche.uni-erfurt.de> <52ECE27B.9070505@miszellen.de> Reply-To: joseleopoldo1792@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9aJ4-0000C7-U9 for emacs-orgmode@gnu.org; Sat, 01 Feb 2014 08:08:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9aIy-0003HW-MY for emacs-orgmode@gnu.org; Sat, 01 Feb 2014 08:08:22 -0500 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:34322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9aIy-0003H7-Ao for emacs-orgmode@gnu.org; Sat, 01 Feb 2014 08:08:16 -0500 Received: by mail-ea0-f176.google.com with SMTP id h14so2819591eaj.7 for ; Sat, 01 Feb 2014 05:08:14 -0800 (PST) Received: from localhost (nat-wlan2.Uni-Erfurt.DE. [193.175.204.97]) by mx.google.com with ESMTPSA id b41sm49590139eef.16.2014.02.01.05.08.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Feb 2014 05:08:13 -0800 (PST) Content-Disposition: inline In-Reply-To: <52ECE27B.9070505@miszellen.de> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 :: joseleopoldo1792@gmail.com :: :: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ :: :: jabberid: rogorido :: ::