From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul R Newsgroups: gmane.emacs.help Subject: Re: automatic dired update Date: Mon, 05 Jan 2009 10:40:44 +0100 Message-ID: <87zli6gkf7.fsf@gmail.com> References: <91299a37-5cd2-4b3e-a7c3-381bdf7f69a5@q30g2000prq.googlegroups.com> <90548140-00a8-44f8-b8f0-6b4530f49933@v39g2000pro.googlegroups.com> <001c01c96ed8$d69107b0$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231148489 26411 80.91.229.12 (5 Jan 2009 09:41:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Jan 2009 09:41:29 +0000 (UTC) To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 05 10:42:40 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LJlyi-0002MU-8q for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Jan 2009 10:42:33 +0100 Original-Received: from localhost ([127.0.0.1]:56634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJlxS-0001A3-Qf for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Jan 2009 04:41:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJlx5-000197-Ei for help-gnu-emacs@gnu.org; Mon, 05 Jan 2009 04:40:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJlx3-000188-SQ for help-gnu-emacs@gnu.org; Mon, 05 Jan 2009 04:40:50 -0500 Original-Received: from [199.232.76.173] (port=42367 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJlx3-000185-Me for help-gnu-emacs@gnu.org; Mon, 05 Jan 2009 04:40:49 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.156]:38401) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJlx3-0002bB-6S for help-gnu-emacs@gnu.org; Mon, 05 Jan 2009 04:40:49 -0500 Original-Received: by fg-out-1718.google.com with SMTP id l26so2754695fgb.30 for ; Mon, 05 Jan 2009 01:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=U0AEr0PZ2tPlQLXHPDWXRWIl5QEOx6jVLW2d1k3iu8A=; b=X/4n3Jm/IjiincPCMPUSUwFZNkCkKuQe9SiFetwtPaaD4HBU72XwfKPHUfJ4eGg+tA hu8DxEFoa9mOCVa2FTrPwxVi+JvF2ZtRZ/5R7aHw6ih1AKGX9PqHMuyT+GTU+K/QjIax 5j7jpWLJnU8TfotTV8AR7o/dTFYU9e+1hXL2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; b=S2DP2oIuQVmSjataQUbB7krfQlRVJWnTF1dZYgOf08Frk7hUcML+hm8R2rwnR284Uj C6i7NNbP9qdFggiwHOvmQW64rFSx/pGqRMaXlOpOgsCrxkr7nrzdgI7FjKrmF3Q8YT5F HQ0eFOFsrXA/zpkBJPtJi2zY90eC5VmKWiYFo= Original-Received: by 10.86.59.2 with SMTP id h2mr4444897fga.30.1231148447159; Mon, 05 Jan 2009 01:40:47 -0800 (PST) Original-Received: from ubuT42 (pdc35-1-82-242-132-111.fbx.proxad.net [82.242.132.111]) by mx.google.com with ESMTPS id 12sm4426531fgg.46.2009.01.05.01.40.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Jan 2009 01:40:46 -0800 (PST) In-Reply-To: <001c01c96ed8$d69107b0$0200a8c0@us.oracle.com> (Drew Adams's message of "Sun, 4 Jan 2009 17:56:33 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61070 Archived-At: >> Does anyone know how to make dired auto-refresh? For example, i have >> a dired buffer of dir xyz buried somewhere. Then, i renamed some >> files in OS's Desktop. Then, when i switch to dir xyz in emacs, >> i wish to see the updated list without me having to type g to >> refresh. originally i thought just some hook... something like >> (add-hook 'dired-load-hook 'revert-buffer) >> >> but when actually trying to do it, apparently not that simple. >> I thought it must be some function or variable that tells me when >> buffer display is switched or updated... can't locate it. Drew> Good question. To use a hook to call `dired-revert', you need to Drew> find a hook that represents the "change" in interaction state that Drew> you make when you "switch" to the dired buffer. I'm not sure what Drew> hook that might be. That would only work if the dired buffer is not currently displayed when the change happen. I think a real solution would be to use FS notifications systems. I know of inotify ( http://en.wikipedia.org/wiki/Inotify ) for linux but I suspect such systems exist for most widely used systems. That would be a very good addition to emacs. Drew> You could use a timer or, say, `display-time-hook' to do it Drew> periodically, but that's a sledge hammer. As a temporary solution, a combination of : - refresh display on "buffer gets diplayed" event and - refresh diplay every N seconds if buffer is already displayed could provide the wanted effect. Anybody aware of inotify-and-the-likes integration effort to emacs ? -- Paul