geiser-users
[Top][All Lists]
Advanced

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

Re: [Geiser-users] Showing images in windows


From: Gustav Wikström
Subject: Re: [Geiser-users] Showing images in windows
Date: Mon, 10 Dec 2012 18:58:16 +0100

Hi Jose!

No, emacs don't understand the path with backslashes unfortunately. I tried it with (insert-image (create-image "c:\temp\img.png")) but no luck (unless I turned the slashes around!). Tried it both "vanilla" (with the -q flag) and with my custom initialization.

But my root is not polluted, that was just a simple example to illustrate the difference. So no worries there!

Regards
Gustav


On Mon, Dec 10, 2012 at 6:20 PM, Jose A. Ortega Ruiz <address@hidden> wrote:

Hi,

On Mon, Dec 10 2012, Gustav Wikström wrote:

> Hi!
>
> I've been trying to get the image-functionality to work with geiser
> and Racket. On windows. The dll's are downloaded and images work in
> general. Just not in geiser.
>
> Trying to debug a bit I realize the problem is with the image pattern
> that is scanned in geiser-image--replace-images. Not necessarily in
> that function, but in the function that creates the string to be
> parsed..

If you can see image files being created in C:\, please try replacing
line 93 in geiser-image.el (you can open it quickly with M-x
find-library RET geiser-image RET) by:

        (while (re-search-forward "\"?#<Image: \\([-+.\\\\/_0-9a-zA-Z]+\\)>\"?" nil t)

(there's just a change in the regular _expression_ recognizing where
images need to be inserted): i think it's actually a bug in that
very function.

> On my system the string is generated with "\" instead of "/" between
> folders.
>
> Eg. 
> c:\image.png
>
> instead of 
> c:/image.png
>
> Emacs cannot handle that (at least not my emacs!).

Unless i'm mistaken, it's not Emacs, but Geiser's
geiser-imag--replace-images who cannot cope :) Let's see if the above
fix is really a fix, if you can try.

>
> I haven't found the function generating the image-string, but maybe
> that is Racket-specific? Anyhow, is there anyone in here who knows how
> to "fix" this - if it needs to be fixed - or can give me some advice
> on how to configure this if it is a user-based error by me?

Even if the above fixes the problem, you might want to change the
customizable variable geiser-image-cache-dir to a path of your liking.
If you then restart the REPL with this variable set, Geiser will tell
Racket to use that directory to store cached image files, instead of
polluting your root directory.

Hope this helps,
jao
--
One reason that life is complex is that it has a real part and an
imaginary part.
 -Andrew Koenig


reply via email to

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