emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: tumme messages in the echo area


From: Stefan Monnier
Subject: Re: tumme messages in the echo area
Date: Thu, 13 Jul 2006 10:18:47 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> -          (setq ret (shell-command command nil))
>>> +          (setq ret (call-process shell-file-name nil nil nil "-c" 
>>> command))
>>> (if (not (= 0 ret))
>>> (error "Could not resize image")))
>>> (copy-file file new-file t))
>> 
>> BTW, I strongly suspect that the above can suffer from quoting problems if
>> `new-file' happens to contain spaces or quotes.

> Well it could, if you change the default value of
> `tumme-cmd-create-temp-image-options' too much:

> (defcustom tumme-cmd-create-temp-image-options
>   "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\""
>   "*Format of command used to create temporary image for display window.
> Available options are %p which is replaced by
> `tumme-cmd-create-temp-image-program', %w and %h which is replaced by
> the calculated max size for width and height in the image display window,
> %f which is replaced by the file name of the original image and %t which
> is replaced by the file name of the temporary file."
>   :type 'string
>   :group 'tumme)

> See those \" around %f and %t? They are supposed to take care of the
> problem you mention (at least spaces, I am not so sure about
> quotes). 

I *am* sure about quotes.  E.g. if

   %f

is replaced by a file name such as

   a"; rm -rf ~/.;"

you may even get a nasty surprise.


        Stefan




reply via email to

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