From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/71014 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] Use `url' rather than curl Date: Sat, 18 Sep 2010 21:14:54 +0100 Message-ID: References: <87eicrmaly.fsf@keller.adm.naquadah.org> <1284834162-24257-1-git-send-email-julien@danjou.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1284840923 21550 80.91.229.12 (18 Sep 2010 20:15:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Sep 2010 20:15:23 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M19387@lists.math.uh.edu Sat Sep 18 22:15:22 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ox3oc-0007mC-RK for ding-account@gmane.org; Sat, 18 Sep 2010 22:15:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Ox3oY-0002rE-La; Sat, 18 Sep 2010 15:15:14 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Ox3oX-0002r1-Bf for ding@lists.math.uh.edu; Sat, 18 Sep 2010 15:15:13 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Ox3oW-0003yk-HJ for ding@lists.math.uh.edu; Sat, 18 Sep 2010 15:15:13 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Ox3oV-0006cd-00 for ; Sat, 18 Sep 2010 22:15:11 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ox3oR-0007fi-NU for ding@gnus.org; Sat, 18 Sep 2010 22:15:07 +0200 Original-Received: from cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com ([86.9.122.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Sep 2010 22:15:07 +0200 Original-Received: from sdl.web by cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Sep 2010 22:15:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAMFBMVEUaFRZLMy1dTENxVzKQ WiCrXQ97cmO/dSqSh3akjGTApXy5sJ7Sxo/Sz8Xo6eP9//xJbkruAAAAAWJLR0QAiAUdSAAAAAlw SFlzAAACxQAAAsUBidZ/7wAAAAd0SU1FB9cBBwMJOwHXewoAAAIBSURBVCjPVdNBiNNAFADQ6J4F x3hThHZBBC+WCFI8SS0iezRDcMHLHkLAg6gJH/fgYQ9xYlj2sLK4KHgqCgXFhda2Idmr4kkQPZQ0 nkQMbTypbMmMM2m7ZgYSmMef/5OZPwo7HFnx3uKPcmj0Dht1LWZJ+Hvr7dIFZXRUwl9VRTuuKDJ+ U44gjscknK4hhJaCkYRsWjmBtLqXlJAG2wipNe18OZJu1BBq1E8xafl4s6Jq2mUZGftU1y7CCxnp FVUDWJXx4C66BKBnErbuoaYNtoRTu6EZBsCbMn7W+5qOAR6WvxNOby9jHWC9hAf3n304CdiAByXs 3Nh9roLDkyb/sWV712vYwaLSAn8CPMHIAAzOPDKP2COAFm4Y4ODVWc6xG7KXsN7UeUJjjimx2uwd gCgNhr0i8C/xyCD5CiCKAMY3Bf5oDzx//w/fimscdcAZU2jv9sedx6+nYPPFIoWI/GK6QZ+EFGOR ErAjCnV3vPZ7XqlTIMbOLY7fLcvvmT7rXNWaGDexIY44N12TG2PDp7vqyl57dnCeuWwyNpnEURxk fTbDYeBnKRn4oejPYI4sH6WviBumEZ/GxX4X/x6EcURFZ7E071bjQGAxpcOAEOJuTiroDEea5Szv rVWLYfl7ZiQwSUToxrkux7OLixAWGz22+HIyWTRYcVfomOwvzusfjtVIGgLHf3MAAAAASUVORK5C YII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4) Cancel-Lock: sha1:jorgs0n4gK0EIhvSt2lr2924N4w= X-Spam-Score: -1.0 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:71014 Archived-At: 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