From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Lennart Borgman" Newsgroups: gmane.emacs.devel Subject: Re: Popup when buffer file is changed on disk Date: Sun, 6 Feb 2005 01:51:43 +0100 Message-ID: <001701c50be6$0eb9fa20$0200a8c0@sedrcw11488> References: <200502040036.j140atb03430@raven.dms.auburn.edu> <009d01c50bbb$9aa2fd50$0200a8c0@sedrcw11488> <000c01c50bc5$248dc1e0$6501a8c0@y8h26> <01c50bd6$Blat.v2.4$48866000@zahav.net.il> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1107652462 25212 80.91.229.2 (6 Feb 2005 01:14:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 6 Feb 2005 01:14:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 06 02:14:21 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Cxazt-00057H-1o for ged-emacs-devel@m.gmane.org; Sun, 06 Feb 2005 02:13:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CxbBR-0003Lz-GS for ged-emacs-devel@m.gmane.org; Sat, 05 Feb 2005 20:25:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CxbB6-0003Dz-EC for emacs-devel@gnu.org; Sat, 05 Feb 2005 20:25:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CxbAv-00039f-Cy for emacs-devel@gnu.org; Sat, 05 Feb 2005 20:25:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CxbAv-00039c-8w for emacs-devel@gnu.org; Sat, 05 Feb 2005 20:25:21 -0500 Original-Received: from [81.228.11.115] (helo=av9-1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cxaev-0005hk-E5; Sat, 05 Feb 2005 19:52:17 -0500 Original-Received: by av9-1-sn1.fre.skanova.net (Postfix, from userid 502) id 9BC8D37E73; Sun, 6 Feb 2005 01:52:15 +0100 (CET) Original-Received: from smtp3-1-sn1.fre.skanova.net (smtp3-1-sn1.fre.skanova.net [81.228.11.163]) by av9-1-sn1.fre.skanova.net (Postfix) with ESMTP id 89ECA37E45; Sun, 6 Feb 2005 01:52:15 +0100 (CET) Original-Received: from sedrcw11488 (t5o58p115.telia.com [195.67.196.115]) by smtp3-1-sn1.fre.skanova.net (Postfix) with SMTP id 2A74237E46; Sun, 6 Feb 2005 01:52:14 +0100 (CET) Original-To: "Eli Zaretskii" , "moheb missaghi" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:32925 ----- Original Message ----- From: "Eli Zaretskii" > > Most IDE's prompt the user when the file is changed outside them > > (for example by an editor such as emacs) by poping up a dialog box > > asking the user if he/she wants to reload the file. emacs gives this > > warning a bit too late in my opinion, i.e., when the buffer is about > > to be modified rather than when its frame gets the focus. > > Would switching on auto-revert-mode solve your problem here? I have been missing this feature too. Emacs behaviour is quite confusing if you are used to the behavior Moheb mentions. I do not believe that auto-revert-mode can do what Moheb (and I myself) wants. What we want to happen is that Emacs should warn at the moment when it gets focus that the file has changed. So the message that the operating system sends to Emacs to tell it that it has got focus must be catched by Emacs message queue and given to elisp. I do not know exactly how to do that but it should be done by letting the detection of the message start a timer that then runs the wanted code. (I mean I don't remember the message name and I do not know how Emacs handles messages.) This description is from my knowledge of w32 but I guess something similar should apply to for example GNU/Linux?