From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: RMAIL file locking problem?
Date: Wed, 11 May 2005 12:28:59 -0400 [thread overview]
Message-ID: <E1DVu4x-0003nz-8x@fencepost.gnu.org> (raw)
In-Reply-To: <umzr36aum.fsf@boris.laptop> (message from Evil Boris on Mon, 09 May 2005 23:03:45 -0400)
I think I have fixed this; does this give good results?
*** fileio.c 09 May 2005 16:51:43 -0400 1.540
--- fileio.c 11 May 2005 03:26:34 -0400
*** 3728,3733 ****
--- 3732,3739 ----
int set_coding_system = 0;
int coding_system_decided = 0;
int read_quit = 0;
+ int old_Vdeactivate_mark = Vdeactivate_mark;
+ int we_locked_file = 0;
if (current_buffer->base_buffer && ! NILP (visit))
error ("Cannot do file visiting in an indirect buffer");
***************
*** 4400,4407 ****
/* For a special file, all we can do is guess. */
total = READ_BUF_SIZE;
! if (NILP (visit) && total > 0)
! prepare_to_modify_buffer (PT, PT, NULL);
move_gap (PT);
if (GAP_SIZE < total)
--- 4406,4422 ----
/* For a special file, all we can do is guess. */
total = READ_BUF_SIZE;
! if (NILP (visit) && inserted > 0)
! {
! #ifdef CLASH_DETECTION
! if (!NILP (current_buffer->file_truename)
! /* Make binding buffer-file-name to nil effective. */
! && !NILP (current_buffer->filename)
! && SAVE_MODIFF >= MODIFF)
! we_locked_file = 1;
! #endif /* CLASH_DETECTION */
! prepare_to_modify_buffer (GPT, GPT, NULL);
! }
move_gap (PT);
if (GAP_SIZE < total)
***************
*** 4491,4496 ****
--- 4506,4521 ----
}
}
+ /* 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. */
GAP_SIZE -= inserted;
GPT += inserted;
next prev parent reply other threads:[~2005-05-11 16:28 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 [this message]
2005-05-12 0:32 ` Evil Boris
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1DVu4x-0003nz-8x@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.