From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Weis Subject: Re: org-agenda-custom-commands Date: Thu, 29 Oct 2009 20:56:07 +0100 Message-ID: <20091029195607.GA3764@pollux.local.net> References: <20091018144356.GA3139@pollux.local.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3b5w-0000Ve-DX for emacs-orgmode@gnu.org; Thu, 29 Oct 2009 15:55:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3b5r-0000V4-Hl for emacs-orgmode@gnu.org; Thu, 29 Oct 2009 15:55:39 -0400 Received: from [199.232.76.173] (port=53479 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3b5r-0000V1-C5 for emacs-orgmode@gnu.org; Thu, 29 Oct 2009 15:55:35 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:34777) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3b5q-0002D3-Ft for emacs-orgmode@gnu.org; Thu, 29 Oct 2009 15:55:35 -0400 Content-Disposition: inline In-Reply-To: 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 Sorry, I was away for a couple of days. Many thanks for your proposition which really works fine. Still, would it be difficult to implement ``evaluating match before it gets used''? My user needs to define in his files a great number of _multi-value_ property keys. He also requires for an occur-tree a horribly complicated regular expression comprising a simple interactive character string. I understand now that the latter could equally be accomplished with the org-occur function the same way you've proposed for the org-match-sparse-tree function, couldn't it? Yes, it can! I've just tested the following function: (defun my-occur (match) (interactive "s") (org-occur (concat "[:]" match "[:]"))) Great, it works. But I still think it could be advantageous to do the whole lot within the org-agenda-custom-commands variable if the match would be evaluated before getting used. Thank you very much indeed. Harald Weis On Mon, Oct 19, 2009 at 03:36:42PM +0200, Carsten Dominik wrote: > Well, I guess I could evaluate match before it gets used. But maybe > you can also turn this around: Dinfe a function what will call the > tree maker directly > > > (defun my-tree (match) > (interactive "s") > (org-match-sparse-tree nil (concat "{" match "}"))) > > or something like this.... > > - Carsten > > On Oct 18, 2009, at 4:43 PM, Harald Weis wrote: > > >Hi All, > > > >I would like to define one entry of the org-agenda-custom-commands > >variable like so: > >(setq org-agenda-custom-commands > > '(("i" "item" tags-tree > > (remedy-build-tags-tree-regex "item")))) > > > >where ''item'' is the property key and > >where the remedy-build-tags-tree-regex function is defined as follows: > > > >(defun remedy-build-tags-tree-regex (propkey) > > (concat propkey > > "={" > > (read-from-minibuffer (concat propkey " : ")) > > "}")) > > > >This would allow me to select the property value interactively. > > > >The org-make-tags-matcher function does not appreciate. > >''C-c a'' yields > >i item : set of 2 commands > > > >Selecting ''i'' produces the following error message in the > >minibuffer. > >Wrong type argument: stringp, (remedy-build-tags-tree-regex "item") > > > >Is there a way to get the desired functionality?