Subject: bug#22472: closed (Re: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 06 Feb 2016 08:55:02 +0000

Your bug report

#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert

which was filed against the org-mode package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
22472: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22472
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert
From: Dima Kogan <[email-masked]>
To: Nicolas Goaziou <[email-masked]>
Cc: Bastien Guerry <[email-masked]>, [email-masked]
Date: Sat, 06 Feb 2016 00:54:24 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Nicolas Goaziou <[email-masked]> writes:

> Dima Kogan <[email-masked]> writes:
>
>> Ah. Thanks for explaining. The patch helps somewhat, but one can still
>> get into an inconsistent state:
>>
>>   1. Write \(1 + 2\)
>>   2. Toggle overlay with C-c C-x C-l
>>   3. M-x revert-buffer
>>
>> After the revert, the overlay remains, which is arguably OK, since the
>> text has not changed. However after the revert org doesn't realize that
>> the overlay is still up: org-latex-fragment-image-overlays is nil.
>
> Indeed. 
>
> `org-latex-fragment-image-overlays' is a local variable and
> `revert-buffer' calls `normal-mode', which, in turn, calls
> `fundamental-mode'. The latter calls `kill-all-local-variables'.
> Information is lost.
>
> I don't think that `org-latex-fragment-image-overlays' is useful,
> anyway. So I removed it, along with that bug, hopefully.

Yes, things look consistent after your patch.

>> I think the overlays should all disappear on a revert.
>
> I'm not convinced that an unmodified overlay should disappear.

Sure. If we can keep everything consistent, then keeping the overlays is
probably better.

Thank you very much! I'm closing this bug.

Subject: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert
From: Dima Kogan <[email-masked]>
To: [email-masked]
Date: Wed, 27 Jan 2016 03:01:26 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi. I'm using a recent emacs from git, and a mostly-recent org-mode from
debian (Debian version 8.3.2-1). There's a bug:

1. emacs -Q

2. open an org-mode buffer that contains a latex fragment, for instance
==========
123

$\sqrt x$

123
=========

3. C-c C-x C-l

   This renders the latex fragment to show the equation graphically. It
   also tells the user (in the mini-buffer) that C-c C-c will remove the
   rendering, and go back to text

4. M-x revert-buffer

   At this point I would expect the render to revert to text, but it
   doesn't. This isn't necessarily a bug. However...

5. C-c C-c

   Here I ask emacs to un-render the fragment, but it does nothing. If
   #4 isn't a bug, then this is definitely a bug.

Thanks!