Gnus development mailing list
 help / color / mirror / Atom feed
From: Leo <sdl.web@gmail.com>
To: ding@gnus.org
Subject: Re: [PATCH] Use `url' rather than curl
Date: Sat, 18 Sep 2010 21:14:54 +0100	[thread overview]
Message-ID: <m1tylmizb5.fsf@cam.ac.uk> (raw)
In-Reply-To: <1284834162-24257-1-git-send-email-julien@danjou.info>

On 2010-09-18 19:22 +0100, Julien Danjou wrote:
> +(defun gnus-html-image-fetched (status buffer images)
> +  (let ((spec (pop images)))
> +    (when (and (buffer-live-p buffer)
> +               ;; If the position of the marker is 1, then that
> +               ;; means that the text it was in has been deleted;
> +               ;; i.e., that the user has selected a different
> +               ;; article before the image arrived.
> +               (not (= (marker-position (cadr spec)) (point-min))))
> +      (let ((file (gnus-html-image-id (car spec))))
> +        ;; Search the start of the image data
> +        (search-forward "\n\n")
> +        ;; Write region (image) silently
> +        (write-region (point) (point-max) file nil 1)
> +        (kill-buffer)
> +        (with-current-buffer buffer
> +          (let ((inhibit-read-only t)
> +                (string (buffer-substring (cadr spec) (caddr spec))))
> +            (delete-region (cadr spec) (caddr spec))
> +            (gnus-html-put-image file (cadr spec) string))))
>        (when images
> -	(gnus-html-schedule-image-fetching buffer images)))))
> +        (gnus-html-schedule-image-fetching buffer images)))))
>  
>  (defun gnus-html-put-image (file point string &optional url alt-text)
>    (when (gnus-graphic-display-p)

Another comment. May not be relevant since I am still using Gnus from
emacs-23.

Looks like we are doing a round trip here. Retrieve an image into a
buffer, save it to a file and then have it read back and displayed.
Would it be better in the image spec to use :data with value from
(string-to-unibyte (buffer-substring....)) and :type from
image-type-from-data?

Leo




  parent reply	other threads:[~2010-09-18 20:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-18  9:55 gnus-html, url and curl Julien Danjou
2010-09-18 11:50 ` Lars Magne Ingebrigtsen
2010-09-18 13:42   ` Julien Danjou
2010-09-18 14:14     ` Lars Magne Ingebrigtsen
2010-09-18 16:25       ` Steinar Bang
2010-09-18 16:34         ` Lars Magne Ingebrigtsen
2010-09-18 18:22     ` [PATCH] Use `url' rather than curl Julien Danjou
2010-09-18 18:30       ` Leo
2010-09-18 18:34         ` Julien Danjou
2010-09-18 19:07           ` Leo
2010-09-18 19:12             ` Lars Magne Ingebrigtsen
2010-09-18 19:25               ` Leo
2010-09-18 19:28                 ` Lars Magne Ingebrigtsen
2010-09-18 20:02                   ` Leo
2010-09-18 18:39       ` Lars Magne Ingebrigtsen
2010-09-18 19:08         ` Adam Sjøgren
2010-09-18 20:14       ` Leo [this message]
2010-09-18 20:21         ` [PATCH] " Lars Magne Ingebrigtsen
2010-09-18 20:24           ` Leo
2010-09-18 20:44       ` Adam Sjøgren
2010-09-22  1:03 ` gnus-html, url and curl Katsumi Yamaoka
2010-09-22 16:21   ` Lars Magne Ingebrigtsen
2010-09-23  1:29     ` Katsumi Yamaoka
2010-09-23  8:13       ` Robert Pluim
2010-09-23 15:57         ` Lars Magne Ingebrigtsen
2010-09-23 17:42           ` Adam Sjøgren
2010-09-23 17:47             ` Lars Magne Ingebrigtsen

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=m1tylmizb5.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=ding@gnus.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.
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 NNTP newsgroup(s).