emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: Bastien Guerry <bzg@gnu.org>
Cc: 22472@debbugs.gnu.org
Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert
Date: Wed, 03 Feb 2016 16:17:25 -0800	[thread overview]
Message-ID: <87powd2usq.fsf@secretsauce.net> (raw)
In-Reply-To: <87oabyuwbf.fsf@free.fr>

Hi. Thank you for replying. I just tried with the latest daily snapshot
from org-mode.org, and this bug is still valid, although the problem at
least becomes recoverable without killing and re-opening the org buffer.


Bastien Guerry <bzg@gnu.org> writes:

> Dima Kogan <dima@secretsauce.net> writes:
>
>> 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
>
> Latest stable version from Org does not use C-c C-c to remove the
> rendering.

Indeed C-c C-c no longer does this. There're no instructions in the
mini-buffer about how to unrender anymore. C-c C-x C-l is supposed
unrender anything that's rendered, and this works.


>> 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...
>
> (Why would reverting the buffer unrender the LaTeX fragment if the
> text file hasn't change?)

The latest org-mode still keeps the renders on a revert. This is a bug
because when a revert happens, emacs does not assume that the file
hasn't changed. In fact, it COULD have changed, so keeping the (possibly
out-of-date) render up is just wrong. Contrived example:

1. tst.org contains $\sqrt x$
2. C-c C-x C-l to render it
3. in the shell (outside of emacs): perl -p -i -e s/sqrt/sin/ tst.org
4. M-x revert-buffer
   Observe that the render stays up, even though the latex the render
   represents is no longer there

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

Right. But I can now use C-c C-x C-l again. Continuing instructions from
above

5. C-c C-x C-l
   One would expect this to unrender the equation, but org thinks that
   it is not rendered, so it attempts to render it. You get a new render
   of \sin x

6. C-c C-x C-l
   This is now an unrender to get back to the new text



So a revert puts emacs into an inconsistent state, where the equation is
rendered, but the source may or may not be there anymore, and where org
doesn't think there's a render there at all.

  reply	other threads:[~2016-02-04  0:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <874mdz9th5.fsf@secretsauce.net>
2016-02-03  6:44 ` bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Bastien Guerry
2016-02-04  0:17   ` Dima Kogan [this message]
2016-02-04  1:54     ` Dima Kogan
2016-02-04  8:35       ` Nicolas Goaziou
2016-02-04  8:40         ` Dima Kogan
2016-02-04  8:49           ` Nicolas Goaziou
2016-02-04 18:21             ` Dima Kogan
2016-02-05 22:10               ` Nicolas Goaziou
2016-02-05 22:28                 ` bug#22472: " Stephen J. Barr
2016-02-06  8:54                 ` Dima Kogan

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87powd2usq.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --cc=22472@debbugs.gnu.org \
    --cc=bzg@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).