[Python-modules-team] Bug#560755: Potential patch to fix this bug

Kumar Appaiah a.kumar at alumni.iitm.ac.in
Sun Dec 13 16:40:43 UTC 2009

On Sun, Dec 13, 2009 at 05:22:47PM +0100, Jakub Wilk wrote:
> * Jakub Wilk <ubanus at users.sf.net>, 2009-12-12, 19:49:
>>> I have a potential fix for this bug. My approach is based on the
>>> premise that the make-temp-file function provided from Emacs 22
>>> onwards is safe. So, I backport the method to the rst.el file, and
>>> bind it to the symbol rst--make-temp-file as follows:
>> Thank you very much for your patch!
>> I think we could avoid backporting code, if we created a temporary  
>> directory (and then a file with an arbitrary name and proper suffix  
>> inside it) rather than a temporary file.
>>> I don't see a solution for removing the temporary files, though.
>> Is it possible to somehow store the name of temporary thing that has  
>> been created? That way maybe we could re-use it on next invocation of  
>> the preview function and delete it in some kind of exit hook.
> I attach my patch proposition.
> For a reason I don't understand, temporary directory is removed when
> I kill a buffer (C-x k), but not when I kill Emacs (C-x C-c)... On the  
> other hand, with this patch we are not cluttering /tmp any more than the  
> original rst.el.

Nice work. You might want to look at kill-emacs-hook as well for
exiting Emacs.

If you shed tears when you miss the sun, you also miss the stars.
- Rabindranath Tagore (Stray Birds, 1916)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20091213/59b4e3a6/attachment-0001.pgp>

More information about the Python-modules-team mailing list