From juri@jurta.org Wed Feb 11 15:17:20 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Feb 2009 23:17:20 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1BNHGdg013661 for ; Wed, 11 Feb 2009 15:17:18 -0800 Received: from mail.gnu.org ([199.232.76.166]:42045 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LXOIY-0000eG-Fc for emacs-pretest-bug@gnu.org; Wed, 11 Feb 2009 18:15:18 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LXOKQ-00011g-Ff for emacs-pretest-bug@gnu.org; Wed, 11 Feb 2009 18:17:15 -0500 Received: from relay03.kiev.sovam.com ([62.64.120.201]:60776) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXOKP-00011T-VL for emacs-pretest-bug@gnu.org; Wed, 11 Feb 2009 18:17:14 -0500 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LXOKO-000Axf-DR for emacs-pretest-bug@gnu.org; Thu, 12 Feb 2009 01:17:12 +0200 From: Juri Linkov To: emacs-pretest-bug@gnu.org Subject: Viewing images with image-mode changes directory time Organization: JURTA Date: Thu, 12 Feb 2009 00:55:48 +0200 Message-ID: <873aepkksk.fsf@jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: 8fcfa5a562f326ba64a474cd1db6e25e X-DrWeb-checked: yes X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Using image-mode to visit image files touches directory modification dates. This is especially annoying when image files are in an old archive. The problem is in the function `add-text-properties' that temporarily modifies the image buffer causing lock-file to create a lock file in the current directory that modifies the directory timestamp. As a solution I propose to let-bind `buffer-file-truename' to nil around the call to `add-text-properties' to prevent directory time modification: Index: lisp/image-mode.el =================================================================== RCS file: /sources/emacs/emacs/lisp/image-mode.el,v retrieving revision 1.55 diff -c -r1.55 image-mode.el *** lisp/image-mode.el 7 Feb 2009 15:29:14 -0000 1.55 --- lisp/image-mode.el 11 Feb 2009 22:52:35 -0000 *************** *** 457,464 **** (buffer-undo-list t) (modified (buffer-modified-p))) (image-refresh image) ! (add-text-properties (point-min) (point-max) props) ! (set-buffer-modified-p modified) ;; Inhibit the cursor when the buffer contains only an image, ;; because cursors look very strange on top of images. (setq cursor-type nil) --- 457,465 ---- (buffer-undo-list t) (modified (buffer-modified-p))) (image-refresh image) ! (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file ! (add-text-properties (point-min) (point-max) props) ! (set-buffer-modified-p modified)) ;; Inhibit the cursor when the buffer contains only an image, ;; because cursors look very strange on top of images. (setq cursor-type nil) -- Juri Linkov http://www.jurta.org/emacs/ From monnier@iro.umontreal.ca Wed Feb 11 18:41:03 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 12 Feb 2009 02:41:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1C2euff032716 for ; Wed, 11 Feb 2009 18:40:57 -0800 Received: from mx10.gnu.org ([199.232.76.166]:48129) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LXRTe-0007RR-3f for emacs-pretest-bug@gnu.org; Wed, 11 Feb 2009 21:38:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LXRVX-0007i2-OA for emacs-pretest-bug@gnu.org; Wed, 11 Feb 2009 21:40:56 -0500 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:36435 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LXRVX-0007hy-GD for emacs-pretest-bug@gnu.org; Wed, 11 Feb 2009 21:40:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArwEAKQak0lFxIvi/2dsb2JhbACBbtJhhBsGgyQ X-IronPort-AV: E=Sophos;i="4.38,194,1233550800"; d="scan'208";a="33748157" Received: from 69-196-139-226.dsl.teksavvy.com (HELO pastel.home) ([69.196.139.226]) by ironport2-out.teksavvy.com with ESMTP; 11 Feb 2009 21:40:54 -0500 Received: by pastel.home (Postfix, from userid 20848) id A57C57FE6; Wed, 11 Feb 2009 21:40:54 -0500 (EST) From: Stefan Monnier To: Juri Linkov Cc: 2295@debbugs.gnu.org, emacs-pretest-bug@gnu.org Subject: Re: bug#2295: Viewing images with image-mode changes directory time Message-ID: References: <873aepkksk.fsf@jurta.org> Date: Wed, 11 Feb 2009 21:40:54 -0500 In-Reply-To: <873aepkksk.fsf@jurta.org> (Juri Linkov's message of "Thu, 12 Feb 2009 00:55:48 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > As a solution I propose to let-bind `buffer-file-truename' to nil > around the call to `add-text-properties' to prevent directory time > modification: That sounds OK. We should provide at least a macro for that. BTW, while you're there, change set-buffer-modified-p to restore-buffer-modified-p. Stefan From juri@jurta.org Thu Feb 12 13:52:44 2009 Received: (at 2295-done) by emacsbugs.donarmstrong.com; 12 Feb 2009 21:52:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1CLqWrj028867 for <2295-done@emacsbugs.donarmstrong.com>; Thu, 12 Feb 2009 13:52:33 -0800 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LXjTy-0009GL-9B; Thu, 12 Feb 2009 23:52:30 +0200 From: Juri Linkov To: Stefan Monnier Cc: 2295-done@debbugs.gnu.org Subject: Re: bug#2295: Viewing images with image-mode changes directory time Organization: JURTA References: <873aepkksk.fsf@jurta.org> Date: Thu, 12 Feb 2009 23:49:52 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 11 Feb 2009 21:40:54 -0500") Message-ID: <878wob496n.fsf@jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: 5389b9e13478507b5d7b23e4ed053241 X-DrWeb-checked: yes >> As a solution I propose to let-bind `buffer-file-truename' to nil >> around the call to `add-text-properties' to prevent directory time >> modification: > > That sounds OK. We should provide at least a macro for that. Maybe it would be better (after the release) to improve `add-text-properties' to not modify the current buffer (with a new flag to keep the default behavior unchanged). This is an old problem with buffers that don't save text properties, so modifying them is meaningless and sometimes harmful. > BTW, while you're there, change set-buffer-modified-p to > restore-buffer-modified-p. Done. -- Juri Linkov http://www.jurta.org/emacs/ From unknown Wed Jun 25 09:13:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Fri, 13 Mar 2009 14:24:06 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 28 12:53:25 2012 Received: (at control) by debbugs.gnu.org; 28 Sep 2012 16:53:25 +0000 Received: from localhost ([127.0.0.1]:60727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1THdoa-0003xx-Rh for submit@debbugs.gnu.org; Fri, 28 Sep 2012 12:53:25 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:50842 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1THdoZ-0003xq-8L for control@debbugs.gnu.org; Fri, 28 Sep 2012 12:53:23 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 8D1B5451CCA1 for ; Fri, 28 Sep 2012 09:53:11 -0700 (PDT) From: Juri Linkov To: control@debbugs.gnu.org Subject: unarchive 2295 Organization: JURTA Date: Fri, 28 Sep 2012 19:52:57 +0300 Message-ID: <8739222iom.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) unarchive 2295 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 28 13:05:08 2012 Received: (at 2295) by debbugs.gnu.org; 28 Sep 2012 17:05:08 +0000 Received: from localhost ([127.0.0.1]:60738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1THdzw-00056R-3H for submit@debbugs.gnu.org; Fri, 28 Sep 2012 13:05:08 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:56499 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1THdzt-00056I-WA for 2295@debbugs.gnu.org; Fri, 28 Sep 2012 13:05:07 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 202C8451CCA1; Fri, 28 Sep 2012 10:04:53 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#2295: Viewing archives with arc-mode changes directory time Organization: JURTA References: <873aepkksk.fsf@jurta.org> Date: Fri, 28 Sep 2012 19:59:19 +0300 In-Reply-To: (Stefan Monnier's message of "Wed, 11 Feb 2009 21:40:54 -0500") Message-ID: <874nmi13tk.fsf_-_@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 2295 Cc: 2295@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> Using image-mode to visit image files touches directory modification >> dates. This is especially annoying when image files are in an old >> archive. The problem is in the function `add-text-properties' that >> temporarily modifies the image buffer causing lock-file to create a lock >> file in the current directory that modifies the directory timestamp. >> >> As a solution I propose to let-bind `buffer-file-truename' to nil >> around the call to `add-text-properties' to prevent directory time >> modification: > > That sounds OK. We should provide at least a macro for that. I don't know how this macro could look, but there is exactly the same problem in arc-mode and tar-mode.el. Visiting an archive file modifies the mtime of its directory. This can be fixed with the same method as used to fix image-mode (by binding buffer-file-truename to nil): === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2012-05-04 06:13:18 +0000 +++ lisp/arc-mode.el 2012-09-28 16:51:56 +0000 @@ -787,7 +789,8 @@ (defun archive-summarize (&optional shut Optional argument SHUT-UP, if non-nil, means don't print messages when parsing the archive." (widen) - (let ((inhibit-read-only t)) + (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file + (inhibit-read-only t)) (setq archive-proper-file-start (copy-marker (point-min) t)) (set (make-local-variable 'change-major-mode-hook) 'archive-desummarize) (or shut-up === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2012-08-13 10:34:25 +0000 +++ lisp/tar-mode.el 2012-08-20 01:25:16 +0000 @@ -518,12 +518,13 @@ (defun tar-summarize-buffer () (progress-reporter-done progress-reporter) (message "Warning: premature EOF parsing tar file")) (goto-char (point-min)) - (let ((inhibit-read-only t) + (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file + (inhibit-read-only t) (total-summaries (mapconcat 'tar-header-block-summarize tar-parse-info "\n"))) - (insert total-summaries "\n")) + (insert total-summaries "\n") (goto-char (point-min)) - (restore-buffer-modified-p modified))) + (restore-buffer-modified-p modified)))) (defvar tar-mode-map (let ((map (make-keymap))) From unknown Wed Jun 25 09:13:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 27 Oct 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 08 20:14:49 2014 Received: (at control) by debbugs.gnu.org; 9 Dec 2014 01:14:49 +0000 Received: from localhost ([127.0.0.1]:58326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy9O5-0003GS-JP for submit@debbugs.gnu.org; Mon, 08 Dec 2014 20:14:49 -0500 Received: from ps18281.dreamhost.com ([69.163.222.226]:49026 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy9O3-0003GK-7m for control@debbugs.gnu.org; Mon, 08 Dec 2014 20:14:47 -0500 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 3F5B1348328E73 for ; Mon, 8 Dec 2014 17:14:46 -0800 (PST) From: Juri Linkov To: control@debbugs.gnu.org (GNU bug tracker automated control server) Subject: Re: Processed: Re: bug#10602: Visiting archives changes directory time Organization: LINKOV.NET References: <87k32164q1.fsf@mail.linkov.net> Date: Tue, 09 Dec 2014 03:14:09 +0200 In-Reply-To: (GNU bug tracker automated control server's message of "Mon, 08 Dec 2014 19:37:02 -0500") Message-ID: <87r3w94obi.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) unarchive 2295 forcemerge 2295 10602 thanks From unknown Wed Jun 25 09:13:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 06 Jan 2015 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator