From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [bug] org-capture fails with undefined org-time-was-given variable Date: Thu, 23 May 2013 11:07:38 -0400 Message-ID: <8738td20qt.fsf@pierrot.dokosmarshall.org> References: <8761yaca3w.fsf@pinto.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfX7T-0004aF-Ce for emacs-orgmode@gnu.org; Thu, 23 May 2013 11:07:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfX7R-0001aq-VA for emacs-orgmode@gnu.org; Thu, 23 May 2013 11:07:55 -0400 Received: from plane.gmane.org ([80.91.229.3]:37792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfX7R-0001aS-Ot for emacs-orgmode@gnu.org; Thu, 23 May 2013 11:07:53 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UfX7P-0001aW-Oo for emacs-orgmode@gnu.org; Thu, 23 May 2013 17:07:51 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 May 2013 17:07:51 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 May 2013 17:07:51 +0200 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 Eric S Fraga writes: > Hello, > > I have the following org capture template: > > #+begin_src emacs-lisp > (setq org-capture-templates '(("j" "journal" entry (file+datetree+prompt "~/s/notes/journal.org") > "* %(format-time-string \"%H:%M\") %^{Entry} %^G\n%i%?"))) > #+end_src > > (other rules elided for clarity). Trying this today (after not using it > for a long time), I get the following error: > > ,---- > | Debugger entered--Lisp error: (void-variable org-time-was-given) > | org-capture-set-target-location() > | org-capture(nil) > | call-interactively(org-capture nil nil) > | command-execute(org-capture) > `---- > > I don't actually use this rule any longer as I prefer to clock in and > out but I was trying to show a friend how he could use org for > journalling. > > I've had a look at the source (reasonably up to date) but this variable > does not seem to be something I should be setting. Is my capture rule > somehow wrong? Or is this a bug in org-capture? > FWIW, I tried the capture rule in a minimal emacs and it's working fine for me: Org-mode version 8.0.3 (release_8.0.3-144-gbd09fe @ /home/nick/elisp/org-mode/lisp/) That includes a bunch of private commits, but when I look at git history I don't find the commit you mention in your org version, f1b99a, so maybe you have your own bunch of private commits and one or more of them broke something? Maybe try a vanilla org? The variable is indeed not to be set by you: it's a dynamically scoped variable, so somebody binds it at some level and then every callee (direct or indirect) can access it. Stepping through org-capture-set-location shows that it is unbound up until the call to org-read-date (line 907-909 in org-capture.el) and it is bound on return from that function, at least in my case. > Any suggestions or pointers welcome! > > Thanks, > eric -- Nick