From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Nick Dokos: Re: Lists for org-refile-targets Date: Fri, 04 Dec 2009 14:05:57 -0500 Message-ID: <28623.1259953557@gamaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGdV7-0006BA-GI for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 14:07:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGdV1-00068c-S0 for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 14:07:32 -0500 Received: from [199.232.76.173] (port=48508 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGdV1-00068V-5I for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 14:07:27 -0500 Received: from vms173015pub.verizon.net ([206.46.173.15]:47168) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGdV0-000187-L9 for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 14:07:27 -0500 Received: from gamaville.dokosmarshall.org ([173.76.32.106]) by vms173015.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KU500CJY6D75YWK@vms173015.mailsrvcs.net> for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 13:05:43 -0600 (CST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Noch ein mal: I forgot to cc: the list. Apologies. ------- Forwarded Message Date: Fri, 04 Dec 2009 14:03:39 -0500 From: Nick Dokos To: Nathan Neff cc: nicholas.dokos@hp.com Subject: Re: [Orgmode] Lists for org-refile-targets Nathan Neff wrote: > On Fri, Dec 4, 2009 at 10:45 AM, Nick Dokos wrote: >=20 > Nathan Neff wrote: >=20=20=20=20 > > Currently, I'm getting an error when I try to refile my notes > > and I think it's something very basic. > > > > Here's the relevant code: > > > > ;; Use environment variable $ORGDIR to get dir for org-directory > > (setq org-directory (getenv "ORGDIR")) > > (setq notesmine-dir "~/Documents/notesmine-org") > > > > (setq org-agenda-files (file-expand-wildcards (concat org-directory= "/*.org"))) > > (setq notesmine-files (file-expand-wildcards (concat notesmine-dir = "/*.org"))) > > > > ; Targets include this file and any file contributing to the agenda= - up to 5 levels deep > > (setq org-refile-targets > > =C2=A0 (quote > > =C2=A0=C2=A0=C2=A0 ( > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (org-agenda-files :maxlevel . 5) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (notesmine-files :maxlevel . 5) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (nil :maxlevel . 5) > > =C2=A0=C2=A0=C2=A0 ) > > =C2=A0 ) > > ) > > > > I've tried concatenating org-agenda-files and notesmine-files, but = I keep getting errors > > when trying to refile.=C2=A0 The error that I get is: > > "Wrong type argument, numberp (0.5)" > > > > I can provide a stack trace, but I don't think this is a bug -- I j= ust think that > > I'm not concatenating the list of files that I want to use in org-r= efile-targets > > correctly. > > >=20=20=20=20 > [A stacktrace is always useful. It doesn't matter whether it's a bug = in org or in > your code: it can help narrow down the problem] >=20=20=20=20 > I suspect that the last line is the problem: >=20=20=20=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (nil :maxlevel . 5) >=20=20=20=20 > What happens if you delete it? >=20=20=20=20 > HTH, > Nick >=20 > I still get the "Wrong type argument: numberp, (0.5)" error. >=20 > Here's the stacktrace: >=20 > Debugger entered--Lisp error: (wrong-type-argument numberp (0.5)) > =C2=A0 number-to-string((0.5)) > =C2=A0 (concat "^\\*\\{1," (number-to-string (if org-odd-levels-only ... = ...)) "\\}[ =C2=A0=C2=A0=C2=A0 ]") > =C2=A0 (setq descre (concat "^\\*\\{1," (number-to-string ...) "\\}[ =C2= =A0=C2=A0=C2=A0 ]")) > =C2=A0 (cond ((eq ... :tag) (setq descre ...)) ((eq ... :todo) (setq desc= re ...)) ((eq ... :regexp) (setq descre ...)) ((eq ... :level) (setq descre= ...)) > ((eq ... :maxlevel) (setq fast-path-p t) (setq descre ...)) (t (error "Ba= d refiling target description %s" desc))) > =C2=A0 (while (setq entry (pop entries)) (setq files (car entry) desc (cd= r entry)) (setq fast-path-p nil) (cond (... ...) (... ...) (... ...) (... .= ..)) (if > (stringp files) (setq files ...)) (cond (... ...) (... ...) (... ...) (..= . ...) (... ... ...) (t ...)) (while (setq f ...) (with-current-buffer ... = ... > ... ... ...))) > =C2=A0 (save-current-buffer (set-buffer (or default-buffer ...)) (while (= setq entry ...) (setq files ... desc ...) (setq fast-path-p nil) (cond ... = ... ... > ...) (if ... ...) (cond ... ... ... ... ... ...) (while ... ...))) > =C2=A0 (with-current-buffer (or default-buffer (current-buffer)) (while (= setq entry ...) (setq files ... desc ...) (setq fast-path-p nil) (cond ... = ... ... > ...) (if ... ...) (cond ... ... ... ... ... ...) (while ... ...))) > =C2=A0 (let ((case-fold-search nil) (entries ...) targets txt re files f = desc descre fast-path-p level pos0) (message "Getting targets...") > (with-current-buffer (or default-buffer ...) (while ... ... ... ... ... .= .. ...)) (message "Getting targets...done") (nreverse targets)) > =C2=A0 org-get-refile-targets(#) > =C2=A0 (setq org-refile-target-table (org-get-refile-targets default-buff= er)) > =C2=A0 (let ((org-refile-targets org-refile-targets) (org-refile-use-outl= ine-path org-refile-use-outline-path)) (setq org-refile-target-table > (org-get-refile-targets default-buffer))) > =C2=A0 org-refile-get-location("Refile to: " # nil) > =C2=A0 (or rfloc (org-refile-get-location (if goto "Goto: " "Refile to: "= ) buffer org-refile-allow-creating-parent-nodes)) > =C2=A0 (let* ((marker ...) (buffer ...) (pos ...) (rfloc ...)) (with-curr= ent-buffer buffer (save-excursion ...))) > =C2=A0 (if (equal goto (quote ...)) (org-refile-goto-last-stored) (let* (= ... ... ... ...) (with-current-buffer buffer ...))) > =C2=A0 org-agenda-refile(nil) > =C2=A0 call-interactively(org-agenda-refile nil nil) >=20 Are you sure you have not omitted a space after a period somewhere? (nil :maxfile . 5) is very different from (nil :maxfile .5). What is the value of org-refile-targets? Other than that, I can't see anything wrong in the code (and I think the (nil :maxlevel 5) part is legal), so I think you'll need to do some debugging. The code in questions is around line 8973 in org.el and looks like this: ((eq (car desc) :maxlevel) (setq fast-path-p t) (setq descre (concat "^\\*\\{1," (number-to-string (if org-odd-levels-only (1- (* 2 (cdr desc))) (cdr desc))) "\\}[ \t]"))) I would suggest that you add a call to debug: ((eq (car desc) :maxlevel) (setq fast-path-p t) (debug) (setq descre (concat "^\\*\\{1," (number-to-string (if org-odd-levels-only (1- (* 2 (cdr desc))) (cdr desc))) "\\}[ \t]"))) Load the org.el file explicitly: M-x load-file /path/to/org.el and then try your refile. When it drops into the debugger, you can say "e" and type an expression to be evaluated into the minibuffer. E.g. e desc --> (:maxfile . 5) but if it looks like this (:maxfile .5) watch out! HTH, Nick ------- End of Forwarded Message