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: Wed, 03 Feb 2016 17:54:12 -0800 Message-ID: <87mvrh2qbf.fsf@secretsauce.net> References: <874mdz9th5.fsf@secretsauce.net> <87oabyuwbf.fsf@free.fr> <87powd2usq.fsf@secretsauce.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR98U-0004LD-DW for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 20:55:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR98Q-0001f5-BZ for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 20:55:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:49964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR98Q-0001ez-8F for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 20:55:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aR98P-0006nX-Ur for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 20:55:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87powd2usq.fsf@secretsauce.net> 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: Bastien Guerry Cc: 22472@debbugs.gnu.org Dima Kogan writes: > 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. This looks like an issue in emacs, rather than org. I think the right solution is for a revert to delete all overlays. I.e.: (add-hook 'before-revert-hook 'delete-all-overlays) This generally works, but is unideal because: 1. We'd want this to apply to org buffers, not to all emacs buffers 2. This works only if revert-buffer-function is nil or revert-buffer--default. If we don't want to delete overlays on revert, then org-latex-fragment-image-overlays must be properly set to reflect the overlay state, AND emacs should make sure the overlay is still valid on revert. Any particular thoughts?