From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] org-clock: Fix CLOCK_INTO_DRAWER property check Date: Thu, 16 Oct 2014 22:25:10 +0200 Message-ID: <878ukf3gpl.fsf@nicolasgoaziou.fr> References: <87d29rajwv.fsf@kmlap.domain.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xerb8-00036c-LY for emacs-orgmode@gnu.org; Thu, 16 Oct 2014 16:24:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xerb1-0004GU-5z for emacs-orgmode@gnu.org; Thu, 16 Oct 2014 16:24:34 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:35731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xerb0-0004Ft-WC for emacs-orgmode@gnu.org; Thu, 16 Oct 2014 16:24:27 -0400 In-Reply-To: <87d29rajwv.fsf@kmlap.domain.org> (Kyle Meyer's message of "Thu, 16 Oct 2014 15:34:08 -0400") 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: Kyle Meyer Cc: Org-mode Hello, Kyle Meyer writes: > A question on Stack Overflow [1] reported an issue overriding > `org-clock-into-drawer' with properties (specifically, overriding a > global value of t with a property value nil). Looking into the function > `org-clock-into-drawer', the actual behavior did not match the > documented behavior. The attached patch should fix the issue. Thanks for the patch. > - (let ((p (org-entry-get nil "CLOCK_INTO_DRAWER" 'inherit)) > - (q (org-entry-get nil "LOG_INTO_DRAWER" 'inherit))) > + (let ((p (org-entry-get nil "CLOCK_INTO_DRAWER" 'inherit t)) > + (q (org-entry-get nil "LOG_INTO_DRAWER" 'inherit t))) > (cond > - ((or (not (or p q)) (equal p "nil") (equal q "nil")) org-clock-into-drawer) > - ((or (equal p "t") (equal q "t")) "LOGBOOK") > - ((not p) q) > - (t p)))) > + ((not (or p q)) org-clock-into-drawer) > + ((equal p "nil") nil) > + ((equal p "t") "LOGBOOK") > + ((equal q "nil") nil) > + ((equal q "t") "LOGBOOK")))) This is wrong. If p is a string, e.g. "FOO", return value should be "FOO". Ditto if q contains a string. Regards, -- Nicolas Goaziou