emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] %? has no effect for org-agenda-prefix-format


From: Christophe Schockaert
Subject: Re: [O] %? has no effect for org-agenda-prefix-format
Date: Wed, 16 Mar 2016 23:43:21 +0100

Markus Heller writes:

> Excerpt from describe-variable org-agenda-prefix-format:
>
> If the first character after `%' is a question mark, the entire field
> will only be included if the corresponding value applies to the current
> entry.  [...]
>
> [...]
> Here's the definition of org-agenda-prefix-format from my .emacs:
>
> <excerpt from .emacs>
> ((org-agenda-prefix-format "  %-5c %?-4(setq type (org-entry-get (point) 
> \"Type\")): ")
> </excerpt from .emacs>
Hi Markus,

Glad I could feed you with the trick you expected !

As for the "?" modifier, I wonder if I didn't stumble on that too.

However, we can achieve the functionnality we want in this field, since
we have free lisp there.

I used an "if" to return "" when the property is not defined, resulting in
a 0 width output, so I get the same behaviour as the "?".

Then, if you need formatting, I don't remember if the width formating is
taken into account. In any case, I think you could obtain that result
with string formatting inside the "%(expression)" itself
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html).

Format width aside, I guess the behavior for the "?" would not be easy
to define: as the content built within "%(expr)" is free, how can we define "the
corresponding value applies to the current entry" ?

It would be nice if it was explained in the docstring however.


Cheerfully,

Christophe

> There is a similar thread on stackexchange from March 10 on this 
> (http://stackoverflow.com/questions/35910204/org-agenda-prefix-format-
> does-not-work).
>
> Is this a bug?
>
> Thanks
> Markus

-- 
--------------->  mailto:address@hidden
Once it's perfectly aimed, the flying arrow goes straight to its target.
Thus, don't worry when things go right.
There will be enough time to worry about if they go wrong.
Then, it's time to fire a new arrow towards another direction.
Don't sink.  Adapt yourself !  The archer has to shoot accurately and quickly.
[Words of Erenthar, the bowman ranger] <---------------<<<<



reply via email to

[Prev in Thread] Current Thread [Next in Thread]