emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: Formatting Agenda entries
Date: Mon, 30 Jul 2012 14:34:21 -0400	[thread overview]
Message-ID: <3694.1343673261@alphaville> (raw)
In-Reply-To: Message from Rasmus <rasmus@gmx.us> of "Mon\, 30 Jul 2012 19\:20\:16 BST." <87r4rtw1pb.fsf@pank.lan>

Rasmus <rasmus@gmx.us> wrote:

> Hi,
> 
> I use org-google-weather.el to display the weather condition of a couple
> of cities in my Agenda.  I would like to format the strings so that
> certain elements are aligned.
> 
> Sometimes it looks like this: 
> 
>    W:    I Clear, 19-35 ᵒC    (Florence)
>    W:    I Partly Sunny, 19-26 ᵒC    (Berlin)
> 
> (I is the icon).  I want it to look like:
> 
>    W:    I Clear,        19-35 ᵒC    (Florence)
>    W:    I Partly Sunny, 19-26 ᵒC    (Berlin)
> 
> The string I use is:
> 
> (setq org-google-weather-format
>        "%i %c, %l-%h %s    (%L)")
> 
> I tried something like 
> 
>    (format "%s %-7s %s %s %s" "%i" "%c," "%l-%h" "%s" "(%L)")
> 
> but this obviously doesn't work as the strings are only expanded in the
> Agenda buffer.  Thus, I need to format my string after placeholders have
> been expanded but before it's actually displayed in the Agenda buffer.
> 
> Is that somehow possible?
> 

Have you tried something like

(setq org-google-weather-format "%i %-30c, %l-%h %s (%L)")

perhaps? Seems to work for me.

Nick

  reply	other threads:[~2012-07-30 18:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 18:20 Formatting Agenda entries Rasmus
2012-07-30 18:34 ` Nick Dokos [this message]
2012-07-30 18:46   ` Rasmus

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=3694.1343673261@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).