emacs-devel
[Top][All Lists]
Advanced

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

Re: RMAIL file locking problem?


From: Evil Boris
Subject: Re: RMAIL file locking problem?
Date: Wed, 11 May 2005 20:32:34 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt)

Richard Stallman <address@hidden> writes:

> I think I have fixed this; does this give good results?
>
> [...]
>   
> +   /* Now we have read all the file data into the gap.
> +      If it was empty, undo marking the buffer modified.  */
> + 
> +   if (inserted == 0)
> +     {
> +       if (we_locked_file)
> +     unlock_file (current_buffer->file_truename);
> +       Vdeactivate_mark = old_Vdeactivate_mark;
> +     }
> + 
>     /* Make the text read part of the buffer.  */

I will try it shortly.  I have one concern though---does this code
take care of the situation when the buffer was modified even before
insert-file-contents is called?  I do not understand the details of
the code, but I am worried that if you read in 0 bytes into an
already-modified buffer, you might remove a lock that was there
initially for reasons unrelated to the insert-file-contents.  

I wonder if one should use the functionality equivalent to 
file-locked-p to test for this.  Perhaps you are already doing it, as
I do not understand the "#ifdef CLASH_DETECTION" surrounded code.

--Boris





reply via email to

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