all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System)
To: Juri Linkov <juri@jurta.org>
Subject: bug#2295: marked as done (Viewing images with image-mode changes  directory time)
Date: Thu, 12 Feb 2009 22:00:04 +0000	[thread overview]
Message-ID: <handler.2295.D2295.123447556428873.ackdone@emacsbugs.donarmstrong.com> (raw)
In-Reply-To: 873aepkksk.fsf@jurta.org

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]


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 directory 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.)


-- 
2295: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2295
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3788 bytes --]

From: Juri Linkov <juri@jurta.org>
To: emacs-pretest-bug@gnu.org
Subject: Viewing images with image-mode changes directory time
Date: Thu, 12 Feb 2009 00:55:48 +0200
Message-ID: <873aepkksk.fsf@jurta.org>

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/



[-- Attachment #3: Type: message/rfc822, Size: 2234 bytes --]

From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 2295-done@emacsbugs.donarmstrong.com
Subject: Re: bug#2295: Viewing images with image-mode changes directory time
Date: Thu, 12 Feb 2009 23:49:52 +0200
Message-ID: <878wob496n.fsf@jurta.org>

>> 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/


      parent reply	other threads:[~2009-02-12 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <878wob496n.fsf@jurta.org>
2009-02-11 22:55 ` bug#2295: Viewing images with image-mode changes directory time Juri Linkov
2009-02-12  2:40   ` Stefan Monnier
2012-09-28 16:59     ` bug#2295: Viewing archives with arc-mode " Juri Linkov
2009-02-12 22:00   ` Emacs bug Tracking System [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=handler.2295.D2295.123447556428873.ackdone@emacsbugs.donarmstrong.com \
    --to=owner@emacsbugs.donarmstrong.com \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.