From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: Finding LAST copy of a given headline in a file Date: Fri, 26 Jul 2013 13:35:25 +0200 Message-ID: <20130726113525.GC16304@kuru.dyndns-at-home.com> References: <20130725225148.GB9608@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2gJ1-0007Cx-FJ for emacs-orgmode@gnu.org; Fri, 26 Jul 2013 07:35:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2gJ0-00050h-JJ for emacs-orgmode@gnu.org; Fri, 26 Jul 2013 07:35:31 -0400 Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]:35531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2gJ0-00050W-Cv for emacs-orgmode@gnu.org; Fri, 26 Jul 2013 07:35:30 -0400 Received: by mail-ea0-f181.google.com with SMTP id d10so362629eaj.40 for ; Fri, 26 Jul 2013 04:35:29 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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: Subhan Tindall Cc: Org-Mode On Thu, Jul 25, 2013 at 04:39:08PM -0700, Subhan Tindall wrote: > Yes, you are correct, file+datetree does not do this. A while ago I > suggested a file+datetree+headline type function be added, but it was not > received well. I tend to agree with that. Your case is a corner case I believe. We can't keep on adding features which are not used widely. Specially since file+function or function provides all the flexibility anyone would ever want. > I attempted a function for use with file+function, but couldn't get it > quite working. Can you provide your attempt? Maybe then others can point out what you might be doing wrong. > I'm not quite sure how to use org-map-entries to find headlines? Given a scope, it iterates over all headlines to find a match. All the matches are accumulated in a list and returned. You have to provide your matching function to org-map-entries. Without putting much thought into it, I would propose the following algorithm: 1. Call org-map-entries in the full buffer scope looking for the date you want. 2. Once you have the entry corresponding to the date, limit scope to subtree and call org-map-entries again, this time looking for the specific "Ticket" you want to add to. Following (2), the template should be added as a sibling. Hope this helps, PS: Could you please not top-post. It is difficult to follow threads if you do. -- Suvayu Open source is the future. It sets us free.