From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#2295: marked as done (Viewing images with image-mode changes directory time) Date: Thu, 12 Feb 2009 22:00:04 +0000 Message-ID: References: <878wob496n.fsf@jurta.org> <873aepkksk.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1234476004-30136-0" X-Trace: ger.gmane.org 1234476290 2711 80.91.229.12 (12 Feb 2009 22:04:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2009 22:04:50 +0000 (UTC) To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 12 23:06:04 2009 Return-path: Envelope-to: geb-bug-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 1LXjgl-0005WL-86 for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Feb 2009 23:05:53 +0100 Original-Received: from localhost ([127.0.0.1]:47910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXjfR-0002Dj-CO for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Feb 2009 17:04:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXjek-0001pe-C3 for bug-gnu-emacs@gnu.org; Thu, 12 Feb 2009 17:03:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXjej-0001ol-Fx for bug-gnu-emacs@gnu.org; Thu, 12 Feb 2009 17:03:37 -0500 Original-Received: from [199.232.76.173] (port=40342 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXjej-0001oZ-8j for bug-gnu-emacs@gnu.org; Thu, 12 Feb 2009 17:03:37 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35380) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXjei-00056c-H6 for bug-gnu-emacs@gnu.org; Thu, 12 Feb 2009 17:03:36 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1CM3YvA031264; Thu, 12 Feb 2009 14:03:34 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n1CM04Tu030236; Thu, 12 Feb 2009 14:00:04 -0800 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 2295 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25254 Archived-At: This is a multi-part message in MIME format... ------------=_1234476004-30136-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Thu, 12 Feb 2009 23:49:52 +0200 with message-id <878wob496n.fsf@jurta.org> and subject line Re: bug#2295: Viewing images with image-mode changes direc= tory time has caused the Emacs bug report #2295, regarding Viewing images with image-mode changes directory time to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 2295: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D2295 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1234476004-30136-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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/ ------------=_1234476004-30136-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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@emacsbugs.donarmstrong.com 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/ ------------=_1234476004-30136-0--