From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs ltstat,readlink on slow filesyste. Date: Sat, 14 Feb 2009 16:38:45 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1234647540 15917 80.91.229.12 (14 Feb 2009 21:39:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2009 21:39:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: kenneth johansson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 14 22:40:15 2009 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.50) id 1LYSFD-0002Ia-5U for ged-emacs-devel@m.gmane.org; Sat, 14 Feb 2009 22:40:15 +0100 Original-Received: from localhost ([127.0.0.1]:57340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYSDt-00025h-1o for ged-emacs-devel@m.gmane.org; Sat, 14 Feb 2009 16:38:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LYSDo-00025P-A7 for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:38:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LYSDm-00024n-PZ for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:38:47 -0500 Original-Received: from [199.232.76.173] (port=55727 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYSDm-00024i-KL for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:38:46 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:10993 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LYSDm-0007hc-8C for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:38:46 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgEAP7IlklLd+Q0/2dsb2JhbACBbc92hBwGgzI X-IronPort-AV: E=Sophos;i="4.38,207,1233550800"; d="scan'208";a="33895690" Original-Received: from 75-119-228-52.dsl.teksavvy.com (HELO pastel.home) ([75.119.228.52]) by ironport2-out.teksavvy.com with ESMTP; 14 Feb 2009 16:38:45 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7A80084C5; Sat, 14 Feb 2009 16:38:45 -0500 (EST) In-Reply-To: (kenneth johansson's message of "Sat, 14 Feb 2009 12:36:52 +0000 (UTC)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.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:109076 Archived-At: > strace -f -etrace=lstat,readlink emacs -Q test_file.c > then just move around in the file and you should see the lstats and > readlink calls. The patch below should fix this problem. Thanks for reporting it. Note that using M-x report-emacs-bug would have made it even better, Stefan --- jit-lock.el.~1.66.~ 2009-01-12 15:41:49.000000000 -0500 +++ jit-lock.el 2009-02-14 16:37:04.000000000 -0500 @@ -45,14 +45,16 @@ "Execute BODY in current buffer, overriding several variables. Preserves the `buffer-modified-p' state of the current buffer." (declare (debug t)) - `(with-buffer-unmodified - (let ((buffer-undo-list t) + `(let ((buffer-undo-list t) (inhibit-read-only t) (inhibit-point-motion-hooks t) (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename) + ;; Do reset the modification status from within the let, since + ;; otherwise set-buffer-modified-p may try to unlock the file. + (with-buffer-unmodified ,@body))))