GNU bug report logs -
#22472
25.0.50; org-mode: latex fragments can't be un-rendered after a revert
Previous Next
Reported by: Dima Kogan <dima <at> secretsauce.net>
Date: Wed, 27 Jan 2016 11:02:02 UTC
Severity: normal
Found in version 25.0.50
Done: Dima Kogan <dima <at> secretsauce.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 06 Feb 2016 00:54:24 -0800
with message-id <87egcq2p8f.fsf <at> secretsauce.net>
and subject line Re: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert
has caused the debbugs.gnu.org bug report #22472,
regarding 25.0.50; org-mode: latex fragments can't be un-rendered after a revert
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
22472: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22472
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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!
[Message part 3 (message/rfc822, inline)]
Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:
> Dima Kogan <dima <at> secretsauce.net> 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.
This bug report was last modified 9 years and 158 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.