emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: Subhan Tindall <subhan.tindall@rentrakmail.com>
Cc: Org-Mode <emacs-orgmode@gnu.org>
Subject: Re: Finding LAST copy of a given headline in a file
Date: Fri, 26 Jul 2013 13:35:25 +0200	[thread overview]
Message-ID: <20130726113525.GC16304@kuru.dyndns-at-home.com> (raw)
In-Reply-To: <CAKKEbDsq_w=Y8d3aa7P-5+URrhWJFipc6t0YNmqceCPMV=MPqw@mail.gmail.com>

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.

      reply	other threads:[~2013-07-26 11:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 22:29 Finding LAST copy of a given headline in a file Subhan Tindall
2013-07-25 22:51 ` Suvayu Ali
2013-07-25 23:39   ` Subhan Tindall
2013-07-26 11:35     ` Suvayu Ali [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130726113525.GC16304@kuru.dyndns-at-home.com \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=subhan.tindall@rentrakmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).