From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Baier Subject: Re: [Refile] Make agenda-files and current file targets Date: Wed, 30 Oct 2013 17:44:45 +0100 Message-ID: <87r4b23dz6.fsf@gmail.com> References: <87vc0f2aju.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbYtS-0003m9-KK for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 12:45:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbYtL-0003Cm-Ae for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 12:45:18 -0400 Received: from plane.gmane.org ([80.91.229.3]:47768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbYtL-0003Cd-58 for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 12:45:11 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VbYtJ-0003hK-Jc for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 17:45:09 +0100 Received: from nat-wh-wh36.rz.uni-karlsruhe.de ([141.70.81.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Oct 2013 17:45:09 +0100 Received: from lexi.baier by nat-wh-wh36.rz.uni-karlsruhe.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Oct 2013 17:45:09 +0100 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 Hello, it's me again, I figured out, what was wrong with the original code. I had gotten the parentheses of the lambda wrong, which messed all this up. I modified the code and refactored the lambda out into a proper function, as you can see below: ---------------------------------------------------------------- (defun dl-org-refile-targets () (unless (member (buffer-file-name) org-agenda-files) (buffer-file-name))) (setq org-refile-targets (quote ((org-agenda-files :maxlevel . 4) (dl-org-refile-targets :regexp . ".*")))) ---------------------------------------------------------------- This does not throw any error anymore. I have, however, come upon another problem that manifests itself when calling org-refile with the cursor upon a heading in a file that is not a member of org-agenda-files: I see "Getting targets..." in the modeline, which takes a long time (I canceled it after ~2 minutes). What exactly does :regexp . ".*" do? I thought it would simply take _all_ headlines in the file indicated by dl-org-refile-targets. The file I testet this with has less than 100 headlines and I have no idea why this takes so long. After changing the contraint to :maxlevel 4 as you can the below, it works just fine. (Note: The file in question has only headlines with levels <= 2) ---------------------------------------------------------------- #+begin_src emacs-lisp (defun dl-org-refile-targets () (unless (member (buffer-file-name) org-agenda-files) (buffer-file-name))) (setq org-refile-targets (quote ((org-agenda-files :maxlevel . 4) (dl-org-refile-targets :maxlevel . 4)))) ---------------------------------------------------------------- What did I miss here? Any help is appreciated. Regards, Alex