emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: [OT] Icon problem with org-google-weather
Date: Mon, 06 Jun 2011 09:51:19 -0400	[thread overview]
Message-ID: <29857.1307368279@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Tassilo Horn <tassilo@member.fsf.org> of "Mon, 06 Jun 2011 09:38:32 +0200." <871uz7v287.fsf@member.fsf.org>

Tassilo Horn <tassilo@member.fsf.org> wrote:

> > Nevertheless, when I insert foo, the icon is shown, but when I insert
> > bar, the icon is an empty box. What am I missing?
> 
> I have a similar problem.  In one of my org files, I have
> 
>   %%(org-google-weather "Montabaur" "de")
> 
> and since lately, I get only squares.
> 
> That said, while trying your example, `org-google-weather' always
> returned nil.  The reason is that I don't have
> `org-google-weather-location' set explicitly to something different as
> the default value.  But that default is a form and it is never evaluated
> AFAICS.  So that seems to be another bug.
> 
> Ok, so when I change your testcase to this...
> 
> --8<---------------cut here---------------start------------->8---
> (defun foobar ()
>   (interactive)
>   (let ((date '(6 6 2011)))
>     (setq bar (org-google-weather "Montabaur" "DE"))
>     (setq foo (let ((org-google-weather-cache-time 0))
> 		(org-google-weather "Montabaur" "DE")))
>     (string= foo bar)
>     (insert foo)
>     (insert bar)))
> --8<---------------cut here---------------end--------------->8---
> 
> I get an error at the foo value evaluation.  The evaluation of bar seems
> to work fine...
> 
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (error "Data not found")

Yes, the "Data not found" problem is an org-google-weather problem,

I sent Julien the following patch - either apply it by hand or
check Julien's git repo: it may be there already.

--8<---------------cut here---------------start------------->8---
diff --git a/org-google-weather.el b/org-google-weather.el
index 3ff0aa3..02db878 100644
--- a/org-google-weather.el
+++ b/org-google-weather.el
@@ -70,6 +70,7 @@ Valid %-sequences are:
 (defun org-google-weather-get-icon (url)
   (with-current-buffer
       (google-weather-retrieve-data-raw url org-google-weather-cache-time)
+    (goto-char (point-min))
     (unless (search-forward "\n\n" nil t)
       (error "Data not found"))
     (let ((data (buffer-substring (point) (point-max))))
--8<---------------cut here---------------end--------------->8---

Nick

  reply	other threads:[~2011-06-06 13:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06  0:27 [OT] Icon problem with org-google-weather Nick Dokos
2011-06-06  7:38 ` Tassilo Horn
2011-06-06 13:51   ` Nick Dokos [this message]
2011-06-06 15:27     ` Tassilo Horn
2011-06-06 15:40       ` Nick Dokos
2011-06-06 16:35         ` Nick Dokos
2011-06-07  4:53 ` Nick Dokos

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=29857.1307368279@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tassilo@member.fsf.org \
    /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).