emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Samuel Maynard <samwmaynard@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: custom props in `org-agenda-get-scheduled`
Date: Tue, 14 Apr 2020 12:50:12 +0800	[thread overview]
Message-ID: <87r1wqu0vv.fsf@localhost> (raw)
In-Reply-To: <a0670358-785a-0a07-eb2e-8c420f382f24@gmail.com>

> The problem is that there doesn't seem to be any hook available for me 
> to add a prop during the agenda creation process. Am I missing 
> something? Or do I just need to modify `org-agenda-get-scheduled` directly?

The closest to what you want is org-agenda-prefix-format, where you can
add user-defined functions to format prefix strings in agenda. The
function will be ran with point at the headline in org file. 

Alternatively, you may add a function cycling over the agenda headlines
to org-agenda-finalize-hook. Then, you can edit the agenda lines as you
wish. Every headline in agenda has 'org-hd-marker text property pointing
to the headline position in the org file.

Hope it helps.

Best,
Ihor


Samuel Maynard <samwmaynard@gmail.com> writes:

> Hi all,
>
> First time on the mailing list. Been using org-mode for about half a year.
>
> I'm trying to add a custom display to the agenda view, similar to 
> org-habit. I'm want to pull information from a task's `:LOGBOOK:` drawer 
> and display some stats next to the item in the agenda view.
>
> I've written the code that parses the stats I'm interested in, but I 
> can't seem to figure out how to show them in the agenda. Looking through 
> the org-habit code it seems I need to first use `org-add-props` (or 
> `add-text-properties`) to add a custom `text-property`, which I can then 
> process in an `org-finalize-hook`.
>
> The problem is that there doesn't seem to be any hook available for me 
> to add a prop during the agenda creation process. Am I missing 
> something? Or do I just need to modify `org-agenda-get-scheduled` directly?
>
> Thanks,
> Sam
>

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg


      reply	other threads:[~2020-04-14  4:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 19:52 custom props in `org-agenda-get-scheduled` Samuel Maynard
2020-04-14  4:50 ` Ihor Radchenko [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=87r1wqu0vv.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=samwmaynard@gmail.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).