all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christophe Schockaert <R3vLibre@citadels.eu>
To: Markus Heller <hellerm2@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: %? has no effect for org-agenda-prefix-format
Date: Wed, 16 Mar 2016 23:43:21 +0100	[thread overview]
Message-ID: <8737rqdoxi.fsf@artlab.createcnix.lan> (raw)
In-Reply-To: <loom.20160316T224949-149@post.gmane.org>


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:R3vLibre@citadels.eu
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	other threads:[~2016-03-16 22:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 21:58 %? has no effect for org-agenda-prefix-format Markus Heller
2016-03-16 22:43 ` Christophe Schockaert [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

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

  git send-email \
    --in-reply-to=8737rqdoxi.fsf@artlab.createcnix.lan \
    --to=r3vlibre@citadels.eu \
    --cc=emacs-orgmode@gnu.org \
    --cc=hellerm2@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 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.