From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Baier Subject: [Refile] Make agenda-files and current file targets Date: Wed, 30 Oct 2013 13:44:05 +0100 Message-ID: <87vc0f2aju.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbV8P-0007r2-Is for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 08:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbV8G-0003ca-Ug for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 08:44:29 -0400 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:45213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbV8G-0003be-H8 for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 08:44:20 -0400 Received: by mail-ea0-f179.google.com with SMTP id b10so615548eae.24 for ; Wed, 30 Oct 2013 05:44:19 -0700 (PDT) Received: from T420s (nat-wh-wh36.rz.uni-karlsruhe.de. [141.70.81.154]) by mx.google.com with ESMTPSA id f49sm83102312eec.7.2013.10.30.05.44.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2013 05:44:18 -0700 (PDT) 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, I am trying to configure my refiling targets in a way, that allows me to refile to any of the files in org-agenda-files, as well as to the file displayed by the current buffer, if it is not included in org-agenda-files. Additionally, I want the headings in agenda-files to be included up to level 4, but of current file every heading should be considered a target. This is what I came up with so far: ---------------------------------------------------------------- (setq org-refile-targets (quote ((org-agenda-files :maxlevel . 4) (#'(lambda () (unless (member (buffer-file-name) org-agenda-files) (buffer-file-name)) :regexp . ".*"))))) ---------------------------------------------------------------- The problem here is, that the lambda evaluates to nil when (buffer-file-name) is a member of org-agenda-files. And this nil in turn isn't anything org-refile understands (Upon C-c C-w I get "Bad refiling target description nil"). Does anyone know how to go about this and can give me soem pointers? Regards, Alex