all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Olum <kdo@cosmos.phy.tufts.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 17706@debbugs.gnu.org
Subject: bug#17706: 24.4.50; locked file error in rmail-insert-inbox-text
Date: Sat, 14 Jun 2014 08:16:39 -0400	[thread overview]
Message-ID: <q52tx7nu1nc.fsf@cosmos.phy.tufts.edu> (raw)
In-Reply-To: <q52lhtb5d8u.fsf@cosmos.phy.tufts.edu>

   From: Eli Zaretskii <eliz@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







  parent reply	other threads:[~2014-06-14 12:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 20:10 bug#17706: 24.4.50; locked file error in rmail-insert-inbox-text Ken Olum
2014-06-06  8:03 ` Eli Zaretskii
2014-06-06 15:09   ` Ken Olum
2014-06-06 15:39     ` Eli Zaretskii
2014-06-06 15:50       ` Eli Zaretskii
2014-06-06 16:29         ` Ken Olum
2014-06-07  8:34           ` Eli Zaretskii
2014-06-07 12:42             ` Ken Olum
2014-06-14 12:16 ` Ken Olum [this message]
2014-06-14 13:16   ` Eli Zaretskii
2014-06-26 19:52     ` Ken Olum
2014-06-27  9:34       ` Eli Zaretskii
2014-06-27 15:54         ` Glenn Morris
2014-06-27 19:39           ` Eli Zaretskii
2014-06-27 19:54             ` Glenn Morris
2014-06-27 20:03               ` Eli Zaretskii
2016-05-23 20:23 ` Mark Lillibridge
2016-05-28 10:48   ` Eli Zaretskii

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=q52tx7nu1nc.fsf@cosmos.phy.tufts.edu \
    --to=kdo@cosmos.phy.tufts.edu \
    --cc=17706@debbugs.gnu.org \
    --cc=eliz@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.