From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Remote display-time-mail-file Date: Thu, 30 Sep 2010 15:29:38 +0200 Message-ID: <83bp7fpdfh.fsf@gnu.org> References: <837hil355j.fsf@gnu.org> <83zkvh1m4j.fsf@gnu.org> <87pqwdbdxs.fsf@gmx.de> <83r5gs1th2.fsf@gnu.org> <87ocbwnmkz.fsf@gmx.de> <87aangnl1j.fsf@gmx.de> <83sk18yrj6.fsf@gnu.org> <83r5grzaei.fsf@gnu.org> <878w2jv0q1.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1285853400 2462 80.91.229.12 (30 Sep 2010 13:30:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Sep 2010 13:30:00 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 30 15:29:59 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 1P1JCt-000444-3y for ged-emacs-devel@m.gmane.org; Thu, 30 Sep 2010 15:29:55 +0200 Original-Received: from localhost ([127.0.0.1]:59801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1JCs-0000he-Ai for ged-emacs-devel@m.gmane.org; Thu, 30 Sep 2010 09:29:54 -0400 Original-Received: from [140.186.70.92] (port=39260 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1JCk-0000gb-I3 for emacs-devel@gnu.org; Thu, 30 Sep 2010 09:29:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P1JCi-0007aQ-Qe for emacs-devel@gnu.org; Thu, 30 Sep 2010 09:29:46 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:56303) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P1JCi-0007aL-JR for emacs-devel@gnu.org; Thu, 30 Sep 2010 09:29:44 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0L9K00900ASY5200@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Thu, 30 Sep 2010 15:29:36 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.123.60]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L9K0089RATAZF40@a-mtaout22.012.net.il>; Thu, 30 Sep 2010 15:29:36 +0200 (IST) In-reply-to: <878w2jv0q1.fsf@gmx.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:131107 Archived-At: > From: Michael Albinus > Cc: Stefan Monnier , emacs-devel@gnu.org > Date: Thu, 30 Sep 2010 15:07:34 +0200 > > I did some tests. It is hard to predict, which primitive functions are > called where, and in majority thes are file-attributes, file-exists-p, > file-readable-p, file-writable-p. Other primitive functions do profit > from those cached values, or they aren't called as much that it is worth > to spend extra handling for caching. > > Therefore, I propose the following patch: Looks good, thanks. One suggestion for a more clear doc string: (defcustom remote-file-name-inhibit-cache 10 "Whether to use the remote file-name cache for read access. When `nil', always use the cached values. When `t', never use them. A number means use them for that amount of seconds since they were cached. File attributes of remote files are cached for better performance. If they are changed out of Emacs' control, the cached values become invalid, and must be invalidated. In case a remote file is checked regularly, it might be reasonable to let-bind this variable to a value less then the time period between two checks. Example: \(defun display-time-file-nonempty-p \(file) \(let \(\(remote-file-name-inhibit-cache \(- display-time-interval 5))) \(and \(file-exists-p file) \(< 0 \(nth 7 \(file-attributes \(file-chase-links file)))))))"