From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dima Kogan Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Date: Thu, 04 Feb 2016 10:21:34 -0800 Message-ID: <87h9ho2v69.fsf@secretsauce.net> References: <874mdz9th5.fsf@secretsauce.net> <87oabyuwbf.fsf@free.fr> <87powd2usq.fsf@secretsauce.net> <87mvrh2qbf.fsf@secretsauce.net> <87zivgoou6.fsf@nicolasgoaziou.fr> <87io243m32.fsf@secretsauce.net> <87mvrgoo72.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aROXd-0002i7-CC for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 13:22:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aROXa-0004N3-5X for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 13:22:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:52016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aROXa-0004Mv-1u for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 13:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aROXZ-0007ah-Tk for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 13:22:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87mvrgoo72.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Bastien Guerry , 22472@debbugs.gnu.org Nicolas Goaziou writes: > Dima Kogan writes: > >> Nicolas Goaziou writes: >> >>> Would the following patch (applied on maint) solve the problem? >> >> Hi. I didn't observe anything acting differently with this patch. What >> did you see it do? Was it supposed to unrender on revert, or to keep the >> render, but update the state? > > As the commit message says, it is supposed to remove the overlay when > text below is modified (e.g. when using a replace-regexp). E.g., > > 1. Write \(1 + 2\) > > 2. Toggle overlay with C-c C-x C-l > > 3. M-% 2 RET 3 RET > > 4. The overlay should have disappeared > > I didn't test it with the `revert-buffer' command, but I would be > surprised that it doesn't run any modification hook. 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. I think the overlays should all disappear on a revert. Thanks!