From: Evil Boris <evilborisnet@netscape.net>
Subject: Re: RMAIL file locking problem?
Date: Wed, 11 May 2005 20:32:34 -0400 [thread overview]
Message-ID: <u8y2l4731.fsf@boris.laptop> (raw)
In-Reply-To: E1DVu4x-0003nz-8x@fencepost.gnu.org
Richard Stallman <rms@gnu.org> 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
next prev parent reply other threads:[~2005-05-12 0:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 16:16 RMAIL file locking problem? Evil Boris
2005-04-20 14:56 ` Richard Stallman
2005-04-28 4:03 ` Evil Boris
2005-04-29 0:13 ` Richard Stallman
2005-04-30 20:05 ` Evil Boris
2005-05-01 23:37 ` Richard Stallman
2005-05-10 3:03 ` Evil Boris
2005-05-11 16:28 ` Richard Stallman
2005-05-12 0:32 ` Evil Boris [this message]
2005-05-12 14:54 ` Richard Stallman
2005-05-14 3:46 ` Evil Boris
2005-05-14 15:13 ` Richard Stallman
2005-05-14 4:17 ` Evil Boris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u8y2l4731.fsf@boris.laptop \
--to=evilborisnet@netscape.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).