all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* custom props in `org-agenda-get-scheduled`
@ 2020-04-12 19:52 Samuel Maynard
  2020-04-14  4:50 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Maynard @ 2020-04-12 19:52 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: custom props in `org-agenda-get-scheduled`
  2020-04-12 19:52 custom props in `org-agenda-get-scheduled` Samuel Maynard
@ 2020-04-14  4:50 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2020-04-14  4:50 UTC (permalink / raw)
  To: Samuel Maynard, emacs-orgmode

> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-14  4:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-12 19:52 custom props in `org-agenda-get-scheduled` Samuel Maynard
2020-04-14  4:50 ` Ihor Radchenko

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.