From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Refile targets fail with certain filename Date: Mon, 12 Dec 2011 15:04:55 -0600 Message-ID: References: <28788.1323709503@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaD3S-0005I8-DK for emacs-orgmode@gnu.org; Mon, 12 Dec 2011 16:04:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaD3Q-00035f-L5 for emacs-orgmode@gnu.org; Mon, 12 Dec 2011 16:04:58 -0500 Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:48674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaD3Q-00035K-9t for emacs-orgmode@gnu.org; Mon, 12 Dec 2011 16:04:56 -0500 Received: by lahi5 with SMTP id i5so2553553lah.0 for ; Mon, 12 Dec 2011 13:04:55 -0800 (PST) In-Reply-To: <28788.1323709503@alphaville.dokosmarshall.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: nicholas.dokos@hp.com Cc: emacs-orgmode Thanks Nick for your advice. I have posted a new e-mail with the subject "Refile fails with blank * TODO" On Mon, Dec 12, 2011 at 11:05 AM, Nick Dokos wrote: > Nathan Neff wrote: > >> Hello, >> >> This was a very tricky problem to work around. =A0I have two directories >> ("notesmine" and "personal") that I use to refile stuff to. =A0I refile = to my >> notesmine directory once every few months, so I was baffled last night >> when I started getting "Wrong type argument: >> stringp, nil" when I wanted to refile to my notesmine directory. >> >> ;; Setup >> ;; My /Users/nate/Documents/notesmine directory has a file called >> "org-mode.org" in it. >> >> ;; Begin Code >> (defun njn/personal-org-files() >> =A0 =A0 =A0 =A0(interactive) >> =A0 =A0 =A0 =A0(directory-files "/Users/nate/Documents/notesmine" 't "^[= ^.].*org$") >> =A0 =A0 ) >> >> (defun njn/refile-targets-personal() >> =A0 =A0 (interactive) >> =A0 =A0 (setq org-refile-targets >> =A0 =A0 =A0 =A0 =A0 (quote ((njn/personal-org-files :maxlevel . 5)))) >> =A0 ) >> >> ;; I would then run M-x njn/refile-targets-personal, and >> ;; then press Ctrl-C Ctrl-W to refile a heading in one of my org files. >> ;; Then, I would see the "Wrong type argument: stringp nil" >> >> I found that the problem *disappears* when I remove or re-name >> the "org-mode.org" file from my notesmine directory! >> >> I refile to my personal directory all the time, and I found that if >> I move the "org-mode.org" file to my personal directory, (or create a bl= ank >> "org-mode.org" file in my personal directory then I would start >> getting the same "Wrong type argument stringp, nil" error when refiling >> to my personal directory. >> >> So, as a geek, I'm interested in why the "org-mode.org" filename causes >> this error. =A0I've reproduced the problem with the simple code above, s= o >> I hope someone else can say "Yes, I can reproduce the problem" and I wil= l >> have done some good :-) >> >> Can anyone reproduce the error and tell me if "org-mode.org" is a keywor= d or >> function or something, or is the problem in the regular expression I'm >> using to select >> my refile targets? >> > > I cannot reproduce it, but the setup needed is probably sufficiently comp= licated > to make the attempt futile. > > Here's the minimal .emacs I tried: > > --8<---------------cut here---------------start------------->8--- > ;;; -*- mode: emacs-lisp -*- > ;;; constant part > (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"= )) > (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/contr= ib/lisp")) > (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org= -mode)) > (require 'org-install) > > (setq debug-on-error t) > (setq eval-expression-print-length nil) > (setq eval-expression-print-level nil) > > (global-set-key "\C-cl" 'org-store-link) > (global-set-key "\C-ca" 'org-agenda) > > ;;;; Nathan Neff's problem config. > ;; Setup > ;; My /Users/nate/Documents/notesmine directory has a file called "org-mo= de.org" in it. > > (setq org-agenda-files '("/home/nick/lib/notesmine")) > > ;; Begin Code > (defun njn/personal-org-files() > =A0 =A0 =A0 (interactive) > =A0 =A0 =A0 (directory-files "/home/nick/lib/notesmine" 't "^[^.].*org$") > =A0 =A0) > > (defun njn/refile-targets-personal() > =A0 =A0(interactive) > =A0 =A0(setq org-refile-targets > =A0 =A0 =A0 =A0 =A0(quote ((njn/personal-org-files :maxlevel . 5)))) > =A0) > > ;; I would then run M-x njn/refile-targets-personal, and > ;; then press Ctrl-C Ctrl-W to refile a heading in one of my org files. > ;; Then, I would see the "Wrong type argument: stringp nil" > ;;; end of Nathan Neff's problem config > > --8<---------------cut here---------------end--------------->8--- > > and /home/nick/lib/notesmine contains two files, tasks.org and org-mode.o= rg: > > tasks.org: > --8<---------------cut here---------------start------------->8--- > > * TODO foo > =A0SCHEDULED: <2011-12-12 Mon> > > ** DONE bar > =A0 SCHEDULED: <2011-12-12 Mon> > --8<---------------cut here---------------end--------------->8--- > > org-mode.org: > > --8<---------------cut here---------------start------------->8--- > > * one > ** two > *** three > **** four > ***** five > ****** TODO foo > =A0 =A0 =A0 SCHEDULED: <2011-12-12 Mon> > --8<---------------cut here---------------end--------------->8--- > > After doing M-x njn/refile-targets-personal, I can refile from tasks.org = (to either > tasks.org or org-mode.org) with C-c C-w with no problems. > > I'd suggest you turn on debug-on-error and post the backtrace, preferably > with a minimal .emacs similar to the above and none of your other > customizations: emacs -q -l /path/to/minimal/dot/emacs > > Nick