GNU bug report logs -
#17706
24.4.50; locked file error in rmail-insert-inbox-text
Previous Next
Reported by: Ken Olum <kdo <at> cosmos.phy.tufts.edu>
Date: Thu, 5 Jun 2014 20:11:01 UTC
Severity: normal
Found in version 24.4.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
From: Eli Zaretskii <eliz <at> gnu.org>
Date: Sat, 07 Jun 2014 11:34:39 +0300
Maybe we should improve what Emacs does in this case by calling
ask-user-about-lock instead of just erroring out?
Thinking about this more, I'm not sure it is such a good idea. For one
thing, there is the possibility of races, since we aren't actually
locking the file but just checking if it is locked. Perhaps more
importantly, if the user says to steal the file, I don't know how to
actually do so. This is normally done by lock_file after
ask-user-about-lock returns t. And if the user says to ignore the
lock, I don't know how to prevent this query again when the buffer
actually is modified.
So maybe it would be better to actually lock the file. Then we'd be
using file locks as intended. The way I'd do it is to lock the file in
rmail-get-new-mail-1 before calling rmail-insert-inbox-text and then
unlock it after saving the file with the new messages or after
discovering that there are none.
Unfortunately, there doesn't seem to be any lisp interface to lock_file,
but I guess I could set buffer-modified-p and then call lock-buffer.
What do you think?
Ken
This bug report was last modified 8 years and 364 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.