From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Question about searches (ultimately for agenda) Date: Sun, 20 Dec 2009 13:51:33 +0100 Message-ID: <3888E19B-2C15-4669-B49C-24E703241B21@gmail.com> References: <22ED17FE-4FB4-4E3E-943A-7B6B6FF92AAF@gmail.com> <49C210B9-FBF3-4B6F-B86A-223A326B25DC@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMLGn-0001Es-SG for emacs-orgmode@gnu.org; Sun, 20 Dec 2009 07:52:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMLGj-0001EP-Dp for emacs-orgmode@gnu.org; Sun, 20 Dec 2009 07:52:21 -0500 Received: from [199.232.76.173] (port=35355 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMLGj-0001EM-9X for emacs-orgmode@gnu.org; Sun, 20 Dec 2009 07:52:17 -0500 Received: from mail-fx0-f225.google.com ([209.85.220.225]:50126) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMLGg-0005MW-5X for emacs-orgmode@gnu.org; Sun, 20 Dec 2009 07:52:17 -0500 Received: by fxm25 with SMTP id 25so3578723fxm.26 for ; Sun, 20 Dec 2009 04:51:37 -0800 (PST) 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: Mueen Nawaz Cc: emacs-orgmode@gnu.org On Dec 19, 2009, at 5:35 AM, Mueen Nawaz wrote: > On 12/17/09 13:26, Carsten Dominik wrote: >> Yes, so that the search only continues after that entry. But yes, you >> are right, this can fail for the final entry in a file. >> >> Try >> >> '(when (org-entry-is-done) (outline-next-heading) (point)) > > Seems to work. > >>> Also, I'm pretty weak with Emacs Lisp. What does (point) do? >>> Google's >>> no help (obviously). >> >> Point returns the buffer position of he cursor, in this case the >> position where the next entry starts. > > OK. I guess I don't understand why we need to know where the point > is. The agenda skip function is called to check if an entry should be skipped. At each entry that matches the current query definition while sweeping an agenda file, this function will be called to give you a final chance to say NO to this entry. If it returns nil, that means, OK, take the entry and put it into the agenda. If it returns something else, that must be the location from where to resume search for another match of your query. For example it can return the location of the end of the current entry to make search continue from there. Or the location of the end of the entire subtree end to make search continue from there. You could also return (point-at-eob) to make sure that after skipping this entry, the search in this buffer will find nothing more. You you also make it return 1 o start from the beginning of the bugger an in this way end up in an infinite loop :-) Clearer now? > Is this returning the value of the point in whatever buffer I am > when I /execute/ the agenda command? Or is this more like the > function is sweeping the point across all agenda files to find > headlines? Or...? > > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten