Re: [Orgmode] Re: Agenda and weather forecast

2010-09-12 Thread Julien Danjou
On Sun, Sep 12 2010, Richard Riley wrote:

> Here is a small patch to make it a bit cleaner in non GUI emacs (-nw) :-

Good idea, merged, thanks.

-- 
Julien Danjou
// ᐰhttp://julien.danjou.info


pgp41IIMG94UO.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-11 Thread Richard Riley

Julien Danjou  writes:

> Hi folks,
>
> If anybody is interested, I've wrote an small extension to put some
> weather forecasts in the agenda.
>
> It can be found here[1]. I've blogged about it yesterday, so if you're
> curious you can read the entry[2].
>
> Happy hacking,
>
> [1]  http://julien.danjou.info/google-weather-el.html
> [2]  http://julien.danjou.info/blog/

Here is a small patch to make it a bit cleaner in non GUI emacs (-nw) :-

--8<---cut here---start->8---
Modified google-weather.el
diff --git a/google-weather.el b/google-weather.el
index 393a3cf..898c91b 100644
--- a/google-weather.el
+++ b/google-weather.el
@@ -162,8 +162,8 @@ See `google-weather-retrieve-data' for the use of 
EXPIRE-TIME."
  `(,forecast-encoded-date
(low ,(google-weather-assoc 'low forecast))
(high ,(google-weather-assoc 'high forecast))
-   (icon ,(concat google-weather-image-url
-  (google-weather-assoc 'icon forecast)))
+   (icon ,(if (window-system) (concat google-weather-image-url
+  (google-weather-assoc 'icon forecast)) ""))
(condition ,(google-weather-assoc 'condition forecast)
  (loop for entry in (google-weather-data->weather data)
when (eq (car entry) 'forecast_conditions)
--8<---cut here---end--->8---


-- 
☘ http://www.shamrockirishbar.com, http://www.richardriley.net

"Learning French is trivial: the word for horse is 'cheval' and
 everything follows thusly."


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast

2010-09-11 Thread Julien Danjou
On Fri, Sep 10 2010, Eric Abrahamsen wrote:

> (icon is a sun, "domestic" is the name of the file I put the weather
> statement in). So the cedillas... Something's definitely off with
> encoding -- where do I start to look? My language environment is utf-8,
> I've got Chinese fonts, if that's the problem... What else?

That's probably my fault. I don't know well the Emacs API, and my
tempting to encode correctly the data fetched from the Web is probably
not bullet-proof. So it might be that.

The code is in `google-weather-retrieve-data':

  (decode-coding-region
   (point) (point-max)
   (detect-coding-region (point) (point-max) t))
  (set-buffer-multibyte t)
  (setq data (xml-parse-region (point) (point-max)))

This may not be the good way to do it. zh-cn pages seems to be in GB2312
encoding.

Any hint welcome.
-- 
Julien Danjou
// ᐰhttp://julien.danjou.info


pgpVcBUvok531.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-10 Thread d . tchin
Hi,

Just to follow previous discussion about having city.

Julien Danjou add a new entry in org-google-weather-format
that allows to get City for which the weather is asked for.
It is possible to customize this variable. 

The default format is "%i %c, %l-%h %s" . 
If you can add %C for city : "%C %i %c, %l-%h %s".

For example I have the following entry :

#+CATEGORY: Meteo 
%%(org-google-weather "Caen" "FR")


When I display agenda, I have the following :

 Meteo:  Caen, Lower-Normandy icon  Couverture nuageuse partielle, 12-22 ℃

Curiously, I have the city following by the region in english whereas the 
other outputs are in french as expected.




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-10 Thread Eric Abrahamsen
On Thu, Sep 09 2010, Julien Danjou wrote:

> On Thu, Sep 09 2010, Sven Bretfeld wrote:
>
>> I had °F at first instead of °C what I would prefer. I'm in Germany;
>> adding ("DE" . "°C") in the customization of "Google Weather Unit System
>> Temperature Assoc" didn't help. In the screenshot I noticed that you
>> have a string "en-gb" which is not documented. Sounds like
>> "English-GB", although you are in Paris. I also added this string, and I
>> have °C now. Is that the correct way?
>
> Yeah, but this is totally undocumented. I found the "en-gb" by trying
> various random strings.
>
> I wanted english text in °C, and that's the way I found. If you put "en"
> you will have °F.
>
> If you want german in °F… I think you're screwed up I think. :-)

So following suit I set my google weather thing to:

%%(org-google-weather "Beijing" "ZH-CN")

Because I'm in China, right? But when the entries show up in my agenda,
that all look like:

domestic:   icon  Çç, 17-33 ℃

(icon is a sun, "domestic" is the name of the file I put the weather
statement in). So the cedillas... Something's definitely off with
encoding -- where do I start to look? My language environment is utf-8,
I've got Chinese fonts, if that's the problem... What else?

Thanks!
Eric


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast

2010-09-10 Thread Simon Guest
At Thu, 09 Sep 2010 09:30:11 -0400,
George McNinch wrote:
> I had the same trouble at first. Fixed by making sure
> that 
> 
> %%(org-google-weather) 
> 
> isn't literally "at the top" of a .org file. 

Together with the recent patch, this works just fine.  Now using
version 5bea6c8 from Thursday 9th September.  All is good.

cheers,
Simon

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast

2010-09-10 Thread Ian Barton
On 09/09/10 19:18, Ian Barton wrote:
> 
>>
>>> "Simon" == Simon Guest  writes:
>>
>>  Simon>  I downloaded google-weather-el-236b269, and stuck
>>  Simon>  %%(org-google-weather) at the top of one of my org files,
>> but
>>  Simon>  when building the agenda, Emacs complains [...]
>>
>> I had the same trouble at first. Fixed by making sure
>> that
>>
>> %%(org-google-weather)
>>
>> isn't literally "at the top" of a .org file.
>>
>> I'm a newbie for org-mode, but it seems that entry needs to be below
>> at least one "*"; the following works, e.g.
>>
>> (top of file)
>> %---
>> * Weather
>> #+CATEGORY: Weather
>> %%(org-google-weather "Boston" "en-us")
>>
>> -gm
>>
> 
> I am also getting the sexp error. This is what I ave in my org file:
> 
> * Weather.
> #+CATEGORY: London
> 
> %%(org-google-weather "London" "en-gb")
> 
> I have tried several other locations with the same result. Any
> suggestions on how to get more debugging info?
> 
Sorted now. It was something to do with the order that things were
listed in my .emacs. Thanks for this great addition to org!

Ian.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Flavio Souza

This is a very nice add-on for orgmode. Cool!

-- 
Flávio Souza
http://www.flaviosouza.org

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Ivan Vilata i Balaguer
Julien Danjou (2010-09-09 08:19:17 +0200) wrote:

> If anybody is interested, I've wrote an small extension to put some
> weather forecasts in the agenda.

Certainly impressive!  Your fellow Debian developer Jordi Mallach just
told me about your Emacs projects this morning and I've been having a
look at them.  For instance, the OfflineIMAP and Google Maps modes also
look great.  Keep the good work! :)

-- 
Ivan Vilata i Balaguer -- http://ivan.lovesgazpacho.net/


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Ian Barton





"Simon" == Simon Guest  writes:


 Simon>  I downloaded google-weather-el-236b269, and stuck
 Simon>  %%(org-google-weather) at the top of one of my org files, but
 Simon>  when building the agenda, Emacs complains [...]

I had the same trouble at first. Fixed by making sure
that

%%(org-google-weather)

isn't literally "at the top" of a .org file.

I'm a newbie for org-mode, but it seems that entry needs to be below
at least one "*"; the following works, e.g.

(top of file)
%---
* Weather
#+CATEGORY: Weather
%%(org-google-weather "Boston" "en-us")

-gm



I am also getting the sexp error. This is what I ave in my org file:

* Weather.
#+CATEGORY: London

%%(org-google-weather "London" "en-gb")

I have tried several other locations with the same result. Any 
suggestions on how to get more debugging info?


Thanks,

Ian.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Julien Danjou
On Thu, Sep 09 2010, Bernt Hansen wrote:

> Would it be possible to have the weather entry inherit the tags of the
> parent task?  This would allow multiple location entries like this with
> tag filtering to limit the display to the desired items only.

I don't think this is something related to org-google-weather. Isn't
is related to Org property inheritance directly?

-- 
Julien Danjou
// ᐰhttp://julien.danjou.info


pgp9JLVEjweu7.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Bernt Hansen
Julien Danjou  writes:

> On Thu, Sep 09 2010, Bernt Hansen wrote:
>
>> Would it be possible to have the weather entry inherit the tags of the
>> parent task?  This would allow multiple location entries like this with
>> tag filtering to limit the display to the desired items only.
>
> I don't think this is something related to org-google-weather. Isn't
> is related to Org property inheritance directly?

It's not the property I'm interested in -- but the tag on the parent
task.  Other agenda entries show the tag on the right for filtering but
no tags are included on the weather entry.

-Bernt


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast | language and units

2010-09-09 Thread Jason McBrayer
On Thu, Sep 9, 2010 at 10:52 AM, Rafael  wrote:
> Juan Pechiar  writes:
>
>> E.g. %%(org-google-weather "Montevideo,Uruguay" "es")
>
> Unfortunately, none of "Pachuca", "Pachuca,Mexico",
> "Pachuca,Hidalgo,Mexico" work for me (I get a Bad sexp error) :(
> ("New York" is fine, however..).

Apply my tiny patch from the other thread (or just customize
org-google-icon-alist to fix the missing "." in chance_of_storm).
Strangely, it's the chance of a storm in your location, and not the
location itself that's causing the bad sexp error. Talk about a bug
depending on the weather!

-- 
Jason F. McBrayer
http://jfm.carcosa.net/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast | language and units

2010-09-09 Thread Rafael
Juan Pechiar  writes:

> E.g. %%(org-google-weather "Montevideo,Uruguay" "es")

Unfortunately, none of "Pachuca", "Pachuca,Mexico",
"Pachuca,Hidalgo,Mexico" work for me (I get a Bad sexp error) :(
("New York" is fine, however..).

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread d . tchin
  writes:

I didn't use the level I would like to use for answering.
As I reply to Juan, I like your suggestion of using CATEGORY. 

Thank you for your help.



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Bernt Hansen
Julien Danjou  writes:

> If anybody is interested, I've wrote an small extension to put some
> weather forecasts in the agenda.
>
> It can be found here[1]. I've blogged about it yesterday, so if you're
> curious you can read the entry[2].
>
> Happy hacking,
>
> [1]  http://julien.danjou.info/google-weather-el.html
> [2]  http://julien.danjou.info/blog/

Hi Julien,

I like this a lot!  Thanks!

Would it be possible to have the weather entry inherit the tags of the
parent task?  This would allow multiple location entries like this with
tag filtering to limit the display to the desired items only.

As it is now multiple entries in the agenda are always present.

,[ todo.org ]
| ** Weather
| [2010-09-09 Thu 08:54]
| *** Farm:@farm:
| :PROPERTIES:
| :Category: Farm
| :END:
| [2010-09-09 Thu 09:03]
| %%(org-google-weather "enterprise ontario" "en-gb")
| *** Caledon :@home:
| :PROPERTIES:
| :Category: Caledon
| :END:
| [2010-09-09 Thu 09:03]
| %%(org-google-weather "caledon village" "en-gb")
| *** Markham   :@office:
| :PROPERTIES:
| :Category: Markham
| :END:
| [2010-09-09 Thu 09:03]
| %%(org-google-weather "markham" "en-gb")
`

Regards,
Bernt

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast | multiple forecasts

2010-09-09 Thread d . tchin
Juan  computer.org> writes:

> 
> A simple way is to use the category declaration:
> 
> #+CATEGORY: Paris
> %%(org-google-weather "Paris" "FR")
> #+CATEGORY: Caen
> %%(org-google-weather "Caen" "FR")
> #+CATEGORY: Agenda
> ... other stuff
> 
> Regards,
> .j.
> 

Thank you for your answer. 

In fact I was thought that the information was already
in expression (org-google-weather "Paris" "FR") and 
the way was to extract it. But I like your suggestion.








___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Julien Danjou
On Thu, Sep 09 2010, d.tchin wrote:

> How can we had the locations. Something like :
>
>   Agenda: *Paris*, icon Couverture nuageuse partielle, 13-24 °C
>   Agenda: *Caen*, icon Brouillard, 13-23 °C

People gave you the category trick already.

OTOH, I'll add the possibility to customize the returned string soon.

-- 
Julien Danjou
// ᐰhttp://julien.danjou.info


pgpIWIrfJTyDV.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread George McNinch

> "Simon" == Simon Guest  writes:

Simon> I downloaded google-weather-el-236b269, and stuck
Simon> %%(org-google-weather) at the top of one of my org files, but
Simon> when building the agenda, Emacs complains [...]

I had the same trouble at first. Fixed by making sure
that 

%%(org-google-weather) 

isn't literally "at the top" of a .org file. 

I'm a newbie for org-mode, but it seems that entry needs to be below
at least one "*"; the following works, e.g.

(top of file)
%---
* Weather
#+CATEGORY: Weather
%%(org-google-weather "Boston" "en-us")

-gm

-- 
  |=|   George McNinch 
  |=|   http://www.tufts.edu/~gmcnin01


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Richard Riley

Julien Danjou  writes:

> Hi folks,
>
> If anybody is interested, I've wrote an small extension to put some
> weather forecasts in the agenda.
>
> It can be found here[1]. I've blogged about it yesterday, so if you're
> curious you can read the entry[2].
>
> Happy hacking,
>
> [1]  http://julien.danjou.info/google-weather-el.html

That is really, really, really neat ;)

> [2]  http://julien.danjou.info/blog/


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast | multiple forecasts

2010-09-09 Thread Juan
A simple way is to use the category declaration:

#+CATEGORY: Paris
%%(org-google-weather "Paris" "FR")
#+CATEGORY: Caen
%%(org-google-weather "Caen" "FR")
#+CATEGORY: Agenda
... other stuff

Regards,
.j.

On Thu, Sep 09, 2010 at 12:06:22PM +, d.tchin wrote:
> I would like to ask one question. I would like to be able
> to do several forecast for different locations.
> For example I had the following entries :
> %%(org-google-weather "Paris" "FR")
> %%(org-google-weather "Caen" "FR")
>
> In the agenda I have the forecasts for the two locations but
> I have no idea on the output about the related locations.
> I have following ouput :
>
>   Agenda: icon Couverture nuageuse partielle, 13-24 °C
>   Agenda: icon Brouillard, 13-23 °C
>
> How can we had the locations. Something like :
>
>   Agenda: *Paris*, icon Couverture nuageuse partielle, 13-24 °C
>   Agenda: *Caen*, icon Brouillard, 13-23 °C

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread Sven Bretfeld
d.tchin  writes:

> In the agenda I have the forecasts for the two locations but 
> I have no idea on the output about the related locations. 
> I have following ouput :
>
>   Agenda: icon Couverture nuageuse partielle, 13-24 °C
>   Agenda: icon Brouillard, 13-23 °C
>
> How can we had the locations. Something like :
>
>   Agenda: *Paris*, icon Couverture nuageuse partielle, 13-24 °C
>   Agenda: *Caen*, icon Brouillard, 13-23 °C

I have done that this way:

** Wetter
*** Bochum
   :PROPERTIES:
   :CATEGORY: Wetter in BO
   :END:
%%(org-google-weather "Bochum" "de")
*** Heidelberg
:PROPERTIES:
:CATEGORY: Wetter in HD
:END:
%%(org-google-weather "Heidelberg" "de")

Greetings,

Sven

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Agenda and weather forecast

2010-09-09 Thread d . tchin
Julien Danjou  danjou.info> writes:

> 
> Hi folks,
> 
> If anybody is interested, I've wrote an small extension to put some
> weather forecasts in the agenda.
> 
> It can be found here[1]. I've blogged about it yesterday, so if you're
> curious you can read the entry[2].
> 
> Happy hacking,
> 
> [1]  http://julien.danjou.info/google-weather-el.html
> [2]  http://julien.danjou.info/blog/
> 


It is really beautiful extension. 

I would like to ask one question. I would like to be able
to do several forecast for different locations. 
For example I had the following entries : 
%%(org-google-weather "Paris" "FR")
%%(org-google-weather "Caen" "FR")

In the agenda I have the forecasts for the two locations but 
I have no idea on the output about the related locations. 
I have following ouput :

  Agenda: icon Couverture nuageuse partielle, 13-24 °C
  Agenda: icon Brouillard, 13-23 °C

How can we had the locations. Something like :

  Agenda: *Paris*, icon Couverture nuageuse partielle, 13-24 °C
  Agenda: *Caen*, icon Brouillard, 13-23 °C

Regards



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode