unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
@ 2014-01-21 17:42 Gooch, Allen
  2014-01-21 19:56 ` Michael Heerdegen
  0 siblings, 1 reply; 8+ messages in thread
From: Gooch, Allen @ 2014-01-21 17:42 UTC (permalink / raw)
  To: 16515

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

After starting 'emacs -Q', eval the following:

(add-hook 'image-mode-hook (lambda ()
                             (auto-revert-mode 1)))

Next perform the following steps:
1) load a PNG file (opens in image-mode buffer)
2) modify PNG file
3) notice that PNG in image-mode buffer does NOT automatically revert

In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.7) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Image[png]

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
h e n SPC a u t o - r e v e r t SPC m o d e SPC i n
<backspace> <backspace> e n a b l e d SPC f o r SPC
i m e g a <backspace> <backspace> <backspace> a g -
<backspace> e - m o d e <C-left> <C-left> <C-left>
<C-left> <C-left> <C-left> <C-left> <C-left> o n SPC
f i l e SPC m o d i f i c a t i o n SPC <end> . <return>
S t a r t i n g SPC w i t h SPC ` e m a c s SPC - `
' : <return> <return> L a u n c h SPC e m a c s . SPC
SPC L o a d SPC a C-x k <return> y e s <return> C-x
C-g C-x o C-x o k q C-x b s c r <tab> <return> C-x
C-f ~ <backspace> . e m <tab> i n <tab> <return> <C-end>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <down> <down> <down> <down> <up>
<up> <delete> <delete> <delete> <down> <delete> <delete>
<tab> <up> <tab> <down> <tab> <up> <home> <S-down>
<S-down> <escape> w C-x b <return> C-y <left> C-x C-e
C-x b <tab> m a t <tab> <return> <return> C-x C-f C-g
C-x o C-x C-f S e <tab> u <return> <C-home> <down>
<down> <end> <left> <left> <left> <left> <left> <left>
<left> <left> a C-x C-s <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> <down-mouse-1> <mouse-1> <escape> x r e p
o <tab> r <tab> <return>

Recent messages:
Checking for load-path shadows...done
Loading vc-git...done
Mark set [3 times]
((lambda nil (auto-revert-mode 1)))
Making completion list...
Quit
Mark set
Saving file c:/Users/agooch/Projects/match-tdd/SeqDiag-0-User-initiates-match.pu...
Wrote c:/Users/agooch/Projects/match-tdd/SeqDiag-0-User-initiates-match.pu
Making completion list...

Load-path shadows:
None found.

Features:
(vc-git help-mode shadow sort gnus-util mail-extr emacsbug message
format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils image-mode dired
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process w32 multi-tty emacs)


[-- Attachment #2: Type: text/html, Size: 6950 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2014-01-21 17:42 bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode Gooch, Allen
@ 2014-01-21 19:56 ` Michael Heerdegen
  2014-01-21 21:12   ` Michael Heerdegen
  2019-09-26 17:08   ` Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Heerdegen @ 2014-01-21 19:56 UTC (permalink / raw)
  To: Gooch, Allen; +Cc: 16515

"Gooch, Allen" <agooch@bioware.com> writes:

> (add-hook 'image-mode-hook (lambda ()
>                               (auto-revert-mode 1)))
>  
> Next perform the following steps:
> 1) load a PNG file (opens in image-mode buffer)
> 2) modify PNG file
> 3) notice that PNG in image-mode buffer does NOT automatically revert

More precisely, reverting happens, but after it the image is displayed
as text (at least that's what you said in gnu.emacs.help, and that's
what I see).

Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2014-01-21 19:56 ` Michael Heerdegen
@ 2014-01-21 21:12   ` Michael Heerdegen
  2019-09-26 17:08   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Heerdegen @ 2014-01-21 21:12 UTC (permalink / raw)
  To: Gooch, Allen; +Cc: 16515

Michael Heerdegen <michael_heerdegen@web.de> writes:

> > (add-hook 'image-mode-hook (lambda ()
> >                               (auto-revert-mode 1)))
> >  
> > Next perform the following steps:
> > 1) load a PNG file (opens in image-mode buffer)
> > 2) modify PNG file
> > 3) notice that PNG in image-mode buffer does NOT automatically revert
>
> More precisely, reverting happens, but after it the image is displayed
> as text (at least that's what you said in gnu.emacs.help, and that's
> what I see).

When adding

  0)  (auto-image-file-mode +1)

to the recipe, reverting happens as expected.  I must admit that I don't
understand this.  Why does `auto-image-file-mode' help here?  And why
does emacs -Q display a png automatically as image when finding it
although `auto-image-file-mode' is off by default?


Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2014-01-21 19:56 ` Michael Heerdegen
  2014-01-21 21:12   ` Michael Heerdegen
@ 2019-09-26 17:08   ` Lars Ingebrigtsen
  2019-09-27  8:39     ` Michael Heerdegen
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-26 17:08 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Gooch, Allen, 16515

Michael Heerdegen <michael_heerdegen@web.de> writes:

> "Gooch, Allen" <agooch@bioware.com> writes:
>
>> (add-hook 'image-mode-hook (lambda ()
>>                               (auto-revert-mode 1)))
>>  
>> Next perform the following steps:
>> 1) load a PNG file (opens in image-mode buffer)
>> 2) modify PNG file
>> 3) notice that PNG in image-mode buffer does NOT automatically revert
>
> More precisely, reverting happens, but after it the image is displayed
> as text (at least that's what you said in gnu.emacs.help, and that's
> what I see).

I tried opening an image, touching it, and I then got

Reverting buffer ‘emacs.png’.

in the echo area, and I don't get the image displayed as text.  So this
seems to work for me in Emacs 27 -- are you still able to reproduce this
bug?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2019-09-26 17:08   ` Lars Ingebrigtsen
@ 2019-09-27  8:39     ` Michael Heerdegen
  2019-09-27 14:02       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Heerdegen @ 2019-09-27  8:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Gooch, Allen, 16515

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

Lars Ingebrigtsen <larsi@gnus.org> writes:


> I tried opening an image, touching it, and I then got
>
> Reverting buffer ‘emacs.png’.
>
> in the echo area, and I don't get the image displayed as text.  So this
> seems to work for me in Emacs 27 -- are you still able to reproduce this
> bug?

I see something new, which is probably also not good.

I opened an image with emacs -Q, turned on auto-revert-mode, edited the
image externally with an image editor, saved there to the original file,
and then emacs asked "[image file name] changed on disk, really edit the
buffer?  ".  Here is an image of the backtrace (an image because I used
SIGUSR2 to get a backtrace, and after that, Emacs is gaga - is
there a better way to get a backtrace for a y-or-n prompt)?

I used v from dired to open the image file if it matters.


[-- Attachment #2: Screenshot_2019-09-27_10-28-13.png --]
[-- Type: image/png, Size: 275362 bytes --]

[-- Attachment #3: Type: text/plain, Size: 21 bytes --]



Regards,

Michael.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2019-09-27  8:39     ` Michael Heerdegen
@ 2019-09-27 14:02       ` Lars Ingebrigtsen
  2019-09-27 14:41         ` Michael Heerdegen
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-27 14:02 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Gooch, Allen, 16515

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I opened an image with emacs -Q, turned on auto-revert-mode, edited the
> image externally with an image editor, saved there to the original file,
> and then emacs asked "[image file name] changed on disk, really edit the
> buffer?  ".

I'm unable to reproduce this on the trunk.  I copied a .jpg file to
/tmp, started emacs -Q, `v' in the dired buffer, `M-x auto-revert-mode',
and then I edited the file in gimp.

Emacs said "Revering buffer 'foo.jpg'." and the new version of the image
was displayed.

> Here is an image of the backtrace (an image because I used
> SIGUSR2 to get a backtrace, and after that, Emacs is gaga - is
> there a better way to get a backtrace for a y-or-n prompt)?

(setq debug-on-quit t) usually works unless whatever is calling y-or-n-p
has disabled that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2019-09-27 14:02       ` Lars Ingebrigtsen
@ 2019-09-27 14:41         ` Michael Heerdegen
  2019-09-27 14:44           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Heerdegen @ 2019-09-27 14:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16515

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I'm unable to reproduce this on the trunk.  I copied a .jpg file to
> /tmp, started emacs -Q, `v' in the dired buffer, `M-x auto-revert-mode',
> and then I edited the file in gimp.

Hmm, I did the same, but with two running Emacsen (one -Q and one with
my .emacs loaded, both master - but I guess that doesn't matter), and I
guess they somehow interfered.  Seems a lock is created when reverting
happens because the buffer is modified, and that causes the trouble when
multiple Emacsen hang around.

With only one running session, I can't reproduce either.  So the
original issue seems to be fixed indeed.

Regards,

Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode.
  2019-09-27 14:41         ` Michael Heerdegen
@ 2019-09-27 14:44           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-27 14:44 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 16515

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hmm, I did the same, but with two running Emacsen (one -Q and one with
> my .emacs loaded, both master - but I guess that doesn't matter), and I
> guess they somehow interfered.  Seems a lock is created when reverting
> happens because the buffer is modified, and that causes the trouble when
> multiple Emacsen hang around.

Ah, that makes sense -- Emacs creates a lock on files you have open.

> With only one running session, I can't reproduce either.  So the
> original issue seems to be fixed indeed.

Yup; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-27 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 17:42 bug#16515: 24.3; Images do not automatically revert on file modification when auto-revert mode enabled for image-mode Gooch, Allen
2014-01-21 19:56 ` Michael Heerdegen
2014-01-21 21:12   ` Michael Heerdegen
2019-09-26 17:08   ` Lars Ingebrigtsen
2019-09-27  8:39     ` Michael Heerdegen
2019-09-27 14:02       ` Lars Ingebrigtsen
2019-09-27 14:41         ` Michael Heerdegen
2019-09-27 14:44           ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).