From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: property searches and numerical values Date: Thu, 17 Apr 2008 13:19:58 +0100 Message-ID: <20080417121958.GA29729@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JmT5x-0001Ao-OP for emacs-orgmode@gnu.org; Thu, 17 Apr 2008 08:20:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JmT5v-0001Ac-BD for emacs-orgmode@gnu.org; Thu, 17 Apr 2008 08:20:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmT5v-0001AZ-6F for emacs-orgmode@gnu.org; Thu, 17 Apr 2008 08:20:03 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JmT5u-0003RG-Q1 for emacs-orgmode@gnu.org; Thu, 17 Apr 2008 08:20:03 -0400 Content-Disposition: inline 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 org-mode mailing list I'd like to ask about ways in which (sorted) sparse trees can be produced b= ased on numerical-valued properties. One thing I have in mind is that it wo= uld seem natural to treat priority as a (1-dimensional) numerical quantity,= rather than as a categorical variable as it seems to be currently. i.e. I'= m attracted by the idea of being able to generate a sparse tree containing = all subtrees with priority greater than 2.5, and to have headings in the sp= arse tree sorted by priority. (Of course I'm not suggesting replacing the c= urrent priority system; in the above by 'priority' I mean some user defined= numerical-valued property.) [ Am I right in thinking that one also can't d= o this currently with timestamps? Not that that is necessarily needed as th= e agenda view does a lovely job. ] So one version of my question would be q1. Would it be possible to implement binary comparison operators >,<,>=3D,= <=3D for use in tag and property searches? (If true numeric comparisons are= difficult, then alphanumeric would still be useful.) Sorry if this is available already. I also have a more general question, which may well arise from my ignorance= of what's available. I should admit at the outset that so far I haven't at= tempted to do anything other than completely basic customisations of org-mo= de. q2: It's my impression that the majority of current users aren't scared of= (e)lisp. (personally I am skill/knowledge-less but not scared). Is there a= 'template'/'model' function a user should look at if they wanted to implem= ent their own sparse-tree creation function? I am thinking of a function th= at takes as arguments a node's properties (and possibly also tags, priority= , timestamps), and computes a TRUE/FALSE value (err, t/nil?) that specifies= whether the subtree rooted at that point should be included in the search = results. I've seen the section in the manual 'using the property API'; perh= aps what I'm talking about is an extension to that API. If all users had to= do were provide a predicate function include-subtree-in-sparse-tree, and o= rg-mode deals with the tree traversal, producing the formatted output, etc,= then perhaps it wouldn't be that hard for a user to implement something ne= w like the > operators? Perhaps. Having said all that, of course I do appre= ciate the nice intuitive syntax for performing tag/property searches. I was= just wondering about a general way of making it easy for users to extend t= he search functionality, and perhaps reduce the burden on the main develope= r of responding to requests like my q1. Dan