From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Remote display-time-mail-file Date: Thu, 16 Sep 2010 23:01:35 +0200 Message-ID: <87pqwdbdxs.fsf@gmx.de> References: <837hil355j.fsf@gnu.org> <83zkvh1m4j.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1284671330 19600 80.91.229.12 (16 Sep 2010 21:08:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2010 21:08:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 16 23:08:49 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OwLhI-00044D-Pj for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 23:08:49 +0200 Original-Received: from localhost ([127.0.0.1]:59165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwLhI-0007dp-6a for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 17:08:48 -0400 Original-Received: from [140.186.70.92] (port=56404 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwLaS-0004Fu-Gc for emacs-devel@gnu.org; Thu, 16 Sep 2010 17:01:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwLaQ-0006rp-8q for emacs-devel@gnu.org; Thu, 16 Sep 2010 17:01:44 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:54222 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OwLaP-0006rS-T2 for emacs-devel@gnu.org; Thu, 16 Sep 2010 17:01:42 -0400 Original-Received: (qmail invoked by alias); 16 Sep 2010 21:01:38 -0000 Original-Received: from p4FC18F3D.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [79.193.143.61] by mail.gmx.net (mp005) with SMTP; 16 Sep 2010 23:01:38 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+1GLwMuWa1rJFHNXKn/0c/jPWOwubItnYG527DEP 6emWjJ3i3W8nYd In-Reply-To: <83zkvh1m4j.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 16 Sep 2010 22:14:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:130270 Archived-At: Eli Zaretskii writes: >> Date: Thu, 16 Sep 2010 20:38:32 +0200 >> From: Eli Zaretskii >> Cc: emacs-devel@gnu.org >> >> Is this supposed to work: >> >> (setq display-time-mail-file "/plink:eliz@fencepost.gnu.org:/var/mail/eliz") >> >> ? >> >> It doesn't work well for me in Emacs 23.2 on MS-Windows, and the >> reason seems to be that file-attributes, called by >> display-time-file-nonempty-p, only probes the file once, and >> thereafter returns the same attributes, even when the file's size >> changes. Is there some cache somewhere? > > The same happens in 3-day old Emacs 24, FWIW, and for the same reason. In order to check, whether Tramp's cache is involved, you might test the following patch (it might not be the final solution, 'tho): --8<---------------cut here---------------start------------->8--- *** /home/albinus/src/emacs/lisp/time.el.~101446~ 2010-09-16 22:56:41.003703326 +0200 --- /home/albinus/src/emacs/lisp/time.el 2010-09-16 22:56:09.068503672 +0200 *************** *** 454,461 **** (force-mode-line-update)) (defun display-time-file-nonempty-p (file) ! (and (file-exists-p file) ! (< 0 (nth 7 (file-attributes (file-chase-links file)))))) ;;;###autoload (define-minor-mode display-time-mode --- 454,462 ---- (force-mode-line-update)) (defun display-time-file-nonempty-p (file) ! (let ((tramp-cache-inhibit-cache t)) ! (and (file-exists-p file) ! (< 0 (nth 7 (file-attributes (file-chase-links file))))))) ;;;###autoload (define-minor-mode display-time-mode --8<---------------cut here---------------end--------------->8--- Best regards, Michael.