help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetching an image from the net and inserting into the buffer


From: Tom
Subject: Re: Fetching an image from the net and inserting into the buffer
Date: Sat, 25 Oct 2014 07:31:06 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> You need to pass an additional argument to create-image, like this:
> 
>   (create-image (buffer-substring (point) (point-max)) 'png t)
> 
> That 't' tells create-image it should create an image from the data
> that is its 1st argument.  Please see the doc string of the function
> for details.
> 

Ah, yes. Thanks. It's working now.

But it's a bit strange, because without the t I guess it interprets
the string as a file name and tries to read from it.

I could imagine some heuristics the other way around. That is if
the file is not found then it should try to read the string as 
data.

In practice it's very unlikely that a string can be both a valid
file name and valid image data. So if it's not a valid file
name then it could assume it's data and then there would be no
need for the data param.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]