From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Missing `with' macro? Date: Tue, 08 Aug 2006 14:01:51 -0400 Message-ID: References: <7dbe73ed0607240317g1bcdd564g66d075f809bcb7b2@mail.gmail.com> <33776.128.165.123.18.1154052850.squirrel@webmail.lanl.gov> <21839.128.165.0.81.1154394370.squirrel@webmail.lanl.gov> <48104.128.165.123.18.1154986690.squirrel@webmail.lanl.gov> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1155060195 13239 80.91.229.2 (8 Aug 2006 18:03:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Aug 2006 18:03:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 08 20:03:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GAVuZ-0003Wm-Fs for ged-emacs-devel@m.gmane.org; Tue, 08 Aug 2006 20:02:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GAVuY-0002XY-Tf for ged-emacs-devel@m.gmane.org; Tue, 08 Aug 2006 14:02:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GAVtp-00027A-Ay for emacs-devel@gnu.org; Tue, 08 Aug 2006 14:01:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GAVto-00026b-Qe for emacs-devel@gnu.org; Tue, 08 Aug 2006 14:01:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GAVto-00026O-OM for emacs-devel@gnu.org; Tue, 08 Aug 2006 14:01:52 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GAVyK-0004bw-9s for emacs-devel@gnu.org; Tue, 08 Aug 2006 14:06:32 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GAVtn-00062o-Tw; Tue, 08 Aug 2006 14:01:52 -0400 Original-To: herring@lanl.gov In-reply-to: <48104.128.165.123.18.1154986690.squirrel@webmail.lanl.gov> (herring@lanl.gov) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58181 Archived-At: OK, I've done my homework now. The querying function is `ask-user-about-supersession-threat'; it's called from lock_file() in filelock.c, which uses get_truename_buffer() to find the buffer whose modification time to examine. This means that if an existing buffer visiting the file is out of date, and get_truename_buffer() happens to return it instead of the up-to-date buffer created by `with-file', the supersession query will be raised. I see. When there is more than one candidate, get_truename_buffer picks the one that comes first in the buffer list. So the cleanest solution would be to make sure it always finds with-file's buffer. The simplest and most natural way is to put that buffer at the front of the buffer list. There are kludgy ways to do this from Lisp, but the cleanest way is just to make a primitive to do it.