From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Sosa Mayor Subject: Re: Stop clock on closing emacs Date: Sun, 9 Feb 2014 00:00:05 +0100 Message-ID: <20140208230005.GA5049@pedroche.home> References: <20140201104512.GA10687@pedroche.uni-erfurt.de> <52ECE27B.9070505@miszellen.de> <20140201130713.GA18536@pedroche.uni-erfurt.de> <86fvo0v08y.fsf@somewhere.org> 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]:51220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCGti-0005jf-PM for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 18:01:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCGth-000446-Sx for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 18:01:18 -0500 Received: from mail-bk0-x232.google.com ([2a00:1450:4008:c01::232]:53666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCGth-000442-Lz for emacs-orgmode@gnu.org; Sat, 08 Feb 2014 18:01:17 -0500 Received: by mail-bk0-f50.google.com with SMTP id w16so1431436bkz.23 for ; Sat, 08 Feb 2014 15:01:16 -0800 (PST) Received: from localhost ([2a02:810a:8b80:24e8:2a0:d1ff:fe8e:e378]) by mx.google.com with ESMTPSA id dj6sm7861859bkc.5.2014.02.08.15.01.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Feb 2014 15:01:15 -0800 (PST) Content-Disposition: inline In-Reply-To: <86fvo0v08y.fsf@somewhere.org> 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 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 :: joseleopoldo1792@gmail.com :: :: GnuPG: 0x1C1E2890 :: http://www.gnupg.org/ :: :: jabberid: rogorido :: ::