From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jan 2016 11:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22472 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22472@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145389251415855 (code B ref -1); Wed, 27 Jan 2016 11:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Jan 2016 11:01:54 +0000 Received: from localhost ([127.0.0.1]:38104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aONrG-00047e-D5 for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51973) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aONrF-00047T-8o for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aONr0-0000DM-MV for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:48 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aONr0-0000DE-K1 for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aONqz-0004RC-Lk for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 06:01:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aONqu-0000BA-3v for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 06:01:37 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aONqt-0000AX-Tf for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 06:01:32 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2ECD82C5D3 for ; Wed, 27 Jan 2016 06:01:30 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Wed, 27 Jan 2016 06:01:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=/2+8rIB6xzBO6E2rI6Ap1bXKOAo =; b=WvAke7iNjBokDTYl6ElXAxpaLNp2betwoyb8LIoihN1NYS0+Wig2scMk/I1 DMagb4hO4SBKSIoj3n+j+fIM3DUqp+YaMzAoop8MHbdNcodeL96bXGbAPSZlvSBH u3yH8CFr/8EIQIrPwJky3vA0rE4Laiz3OQkIETDR5RPTq9mk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=/2 +8rIB6xzBO6E2rI6Ap1bXKOAo=; b=LZn3kIRwiA4RDSq3es599qvdOxZpcF4wAE AUM+M0UiGcXuTEwZLetJcOj/YfUhwX16WLp4bmhCiekvry4HqFrYMvzTrzzHvtL1 mdFUM/Z8Up1AsTP9HSl1GlElFnRX+7cIT//K+oplgZ43O1oqHvG2U3RcIdtNA9n1 dHY2oMnWI= X-Sasl-enc: 72K371oC6nyZ7yTkIq+KpbuL1/dUUulJIuNh1XVOpd4M 1453892489 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id C0F23C01715 for ; Wed, 27 Jan 2016 06:01:29 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aONqo-0002KB-KE for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 03:01:26 -0800 From: Dima Kogan Date: Wed, 27 Jan 2016 03:01:26 -0800 Message-ID: <874mdz9th5.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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! From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Bastien Guerry Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Wed, 03 Feb 2016 06:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Dima Kogan Cc: 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145448190219622 (code B ref 22472); Wed, 03 Feb 2016 06:46:02 +0000 Received: (at 22472) by debbugs.gnu.org; 3 Feb 2016 06:45:02 +0000 Received: from localhost ([127.0.0.1]:57378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQrBV-00056G-RK for submit@debbugs.gnu.org; Wed, 03 Feb 2016 01:45:02 -0500 Received: from z9.mailgun.us ([104.130.96.9]:41595) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQrBT-000562-K7 for 22472@debbugs.gnu.org; Wed, 03 Feb 2016 01:44:59 -0500 X-Mailgun-Sid: WyI1N2Y3YyIsICIyMjQ3MkBkZWJidWdzLmdudS5vcmciLCAiMjg4OGY5Il0= Received: from bzg.fr (fes75-4-78-192-157-63.fbxo.proxad.net [78.192.157.63]) by mxa.mailgun.org with ESMTP id 56b1a1e5.7fcd40759810-in2; Wed, 03 Feb 2016 06:44:53 -0000 (UTC) Received: by bzg.fr (Postfix, from userid 1000) id 7ACD141C9C; Wed, 3 Feb 2016 07:44:52 +0100 (CET) From: Bastien Guerry References: <874mdz9th5.fsf@secretsauce.net> Date: Wed, 03 Feb 2016 07:44:52 +0100 In-Reply-To: <874mdz9th5.fsf@secretsauce.net> (Dima Kogan's message of "Wed, 27 Jan 2016 03:01:26 -0800") Message-ID: <87oabyuwbf.fsf@free.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Dima, Dima Kogan 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. > 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?) > 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. AFAIK C-c C-c is not used to remove the rendering anymore. Any chance you can test with the stable Org from GNU ELPA? Thanks, -- Bastien From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Thu, 04 Feb 2016 00:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Bastien Guerry Cc: 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145454504817616 (code B ref 22472); Thu, 04 Feb 2016 00:18:01 +0000 Received: (at 22472) by debbugs.gnu.org; 4 Feb 2016 00:17:28 +0000 Received: from localhost ([127.0.0.1]:58519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aR7c0-0004a4-I0 for submit@debbugs.gnu.org; Wed, 03 Feb 2016 19:17:28 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:51487) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aR7bz-0004Zv-9O for 22472@debbugs.gnu.org; Wed, 03 Feb 2016 19:17:27 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DA2FF20AD7 for <22472@debbugs.gnu.org>; Wed, 3 Feb 2016 19:17:26 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 03 Feb 2016 19:17:26 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=sqE/I acEnKs/05W69fVLImvrTi8=; b=siGIVoLgatQo4wjwZNfmQNGuiszs61lRGGtPb N1ctg4fiEZbEbqQTsg02WsbP8lsE1D69srZx+acY/Arl7JUH6VmG8q76cNSvwd4a 63JIHlb0mzuSsujMi5Z5oW9YSvprurzvh6igwe4mWIigaEKw5VQnL+jl4VfbCara z0Cp0o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=sqE/IacEnKs/05W69fVLImvrTi8=; b=j63cr dQ+rG4g4pKbXVW9UfaKnyLpLe0KyYb3r7bDa4StN4qXMCEFxTMZBcXKYIRgFgDIZ VVjwjidgpF5RRNKFJx5FE2H/y36d+6avdiUqO8lkJPbo7jr7UUKVrfTAqCThA1UY p1sbAThjdGwTF4BmlA0a5NyZvz4903TtIrthJs= X-Sasl-enc: SAK/sGWwICUIuXpiXWnxbOBbxcAiLbugG/5ikR3mCipe 1454545046 Received: from shorty.local (174-28-85-47.albq.qwest.net [174.28.85.47]) by mail.messagingengine.com (Postfix) with ESMTPA id 764016800BD; Wed, 3 Feb 2016 19:17:26 -0500 (EST) Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aR7bx-0003Ka-3R; Wed, 03 Feb 2016 16:17:25 -0800 References: <874mdz9th5.fsf@secretsauce.net> <87oabyuwbf.fsf@free.fr> User-agent: mu4e 0.9.11; emacs 25.0.50.1 From: Dima Kogan In-reply-to: <87oabyuwbf.fsf@free.fr> Date: Wed, 03 Feb 2016 16:17:25 -0800 Message-ID: <87powd2usq.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 writes: > Dima Kogan 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. From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Thu, 04 Feb 2016 01:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Bastien Guerry Cc: 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145455085626075 (code B ref 22472); Thu, 04 Feb 2016 01:55:01 +0000 Received: (at 22472) by debbugs.gnu.org; 4 Feb 2016 01:54:16 +0000 Received: from localhost ([127.0.0.1]:58553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aR97g-0006mV-54 for submit@debbugs.gnu.org; Wed, 03 Feb 2016 20:54:16 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35555) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aR97e-0006mO-QO for 22472@debbugs.gnu.org; Wed, 03 Feb 2016 20:54:15 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9BF7E20897 for <22472@debbugs.gnu.org>; Wed, 3 Feb 2016 20:54:14 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Wed, 03 Feb 2016 20:54:14 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=hk2v7 YaCgedIQu9XfC4MVnR5+bc=; b=oZ6tSjieAfO6v6MR9K2IpSnvUgWnejA/I4bPJ +/H740F4EO53QHuf09JdHHFvlqQycSLlIJ/C9I7ciUNyBDX8Z+Z71uQRu3seiv97 Mo7P7QLbmPuOpoqqY7RDsKc8fvtg77Hf0Fgpl+SOHEVzWRjprN90ZlCXJJax9RXm XqXXPw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=hk2v7YaCgedIQu9XfC4MVnR5+bc=; b=QiETM odrOu5lZcQZ1n+NFcnNnnpsh3m0scA5frIJ5voc0HZkafa+PmURebXTK2d3mUvnv NgzgKU4nrjvyPaEydb7IhtVpt8oL7MOEVrkq0wicxyx5sDDTnYsG0U0FBB1OBWwF +kPgHo/Ora8tOcVuIDyZj2BkqahZHteDXiRMrw= X-Sasl-enc: 9hZGbl3gEdJWslou9wC9HrcklSRlLJNqQzG3EbUQFIUD 1454550854 Received: from shorty.local (174-28-85-47.albq.qwest.net [174.28.85.47]) by mail.messagingengine.com (Postfix) with ESMTPA id 3D6F9C0001A; Wed, 3 Feb 2016 20:54:14 -0500 (EST) Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aR97c-0004wK-Sj; Wed, 03 Feb 2016 17:54:12 -0800 References: <874mdz9th5.fsf@secretsauce.net> <87oabyuwbf.fsf@free.fr> <87powd2usq.fsf@secretsauce.net> User-agent: mu4e 0.9.11; emacs 25.0.50.1 From: Dima Kogan In-reply-to: <87powd2usq.fsf@secretsauce.net> Date: Wed, 03 Feb 2016 17:54:12 -0800 Message-ID: <87mvrh2qbf.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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? From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Thu, 04 Feb 2016 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Dima Kogan Cc: Bastien Guerry , 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145457479521221 (code B ref 22472); Thu, 04 Feb 2016 08:34:02 +0000 Received: (at 22472) by debbugs.gnu.org; 4 Feb 2016 08:33:15 +0000 Received: from localhost ([127.0.0.1]:58899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRFLn-0005WD-Ga for submit@debbugs.gnu.org; Thu, 04 Feb 2016 03:33:15 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60469) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRFLl-0005W4-PI for 22472@debbugs.gnu.org; Thu, 04 Feb 2016 03:33:14 -0500 Received: from selenimh (unknown [IPv6:2a03:a0a0:0:4301::2de]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 5DE1B1720B4; Thu, 4 Feb 2016 09:33:10 +0100 (CET) From: Nicolas Goaziou In-Reply-To: <87mvrh2qbf.fsf@secretsauce.net> (Dima Kogan's message of "Wed, 03 Feb 2016 17:54:12 -0800") References: <874mdz9th5.fsf@secretsauce.net> <87oabyuwbf.fsf@free.fr> <87powd2usq.fsf@secretsauce.net> <87mvrh2qbf.fsf@secretsauce.net> Date: Thu, 04 Feb 2016 09:35:13 +0100 Message-ID: <87zivgoou6.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Hello, Dima Kogan writes: > 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? Would the following patch (applied on maint) solve the problem? Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Remove-LaTeX-overlay-when-text-below-is-modified.patch >From eb1de6c2bcd02593a4a704f805faa9020f5fdddb Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 4 Feb 2016 09:32:51 +0100 Subject: [PATCH] Remove LaTeX overlay when text below is modified * lisp/org.el (org--format-latex-make-overlay): New function. (org-format-latex): Use new function. Reported-by: Dima Kogan --- lisp/org.el | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index fd08292..a48ae70 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -19079,6 +19079,27 @@ for all fragments in the buffer." (set-window-start nil window-start) (message (concat msg "done"))))))) +(defun org--format-latex-make-overlay (beg end image) + "Build an overlay between BEG and END using IMAGE file. +Register new overlay in `org-latex-fragment-image-overlays'." + (let ((ov (make-overlay beg end))) + (overlay-put ov 'org-overlay-type 'org-latex-overlay) + (overlay-put ov 'evaporate t) + (overlay-put ov + 'modification-hooks + (list (lambda (o flag beg end &optional l) + (unless flag + (org-remove-latex-fragment-image-overlays + (overlay-start o) (overlay-end o)))))) + (if (featurep 'xemacs) + (progn + (overlay-put ov 'invisible t) + (overlay-put ov 'end-glyph (make-glyph (vector 'png :file image)))) + (overlay-put ov + 'display + (list 'image :type 'png :file image :ascent 'center))) + (push ov org-latex-fragment-image-overlays))) + (defun org-format-latex (prefix &optional dir overlays msg forbuffer processing-type) "Replace LaTeX fragments with links to an image, and produce images. @@ -19170,25 +19191,7 @@ Some of the options can be changed using the variable (when (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay) (delete-overlay o))) - (let ((ov (make-overlay beg end))) - (overlay-put ov - 'org-overlay-type - 'org-latex-overlay) - (overlay-put ov 'evaporate t) - (if (featurep 'xemacs) - (progn - (overlay-put ov 'invisible t) - (overlay-put - ov 'end-glyph - (make-glyph - (vector 'png :file movefile)))) - (overlay-put - ov 'display - (list 'image - :type 'png - :file movefile - :ascent 'center))) - (push ov org-latex-fragment-image-overlays)) + (org--format-latex-make-overlay beg end movefile) (goto-char end)) (delete-region beg end) (insert -- 2.6.3 --=-=-=-- From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Thu, 04 Feb 2016 08:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Nicolas Goaziou Cc: Bastien Guerry , 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145457522221821 (code B ref 22472); Thu, 04 Feb 2016 08:41:02 +0000 Received: (at 22472) by debbugs.gnu.org; 4 Feb 2016 08:40:22 +0000 Received: from localhost ([127.0.0.1]:58905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRFSg-0005ft-Aw for submit@debbugs.gnu.org; Thu, 04 Feb 2016 03:40:22 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55048) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRFSf-0005fm-2n for 22472@debbugs.gnu.org; Thu, 04 Feb 2016 03:40:21 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 88C0F20AD5 for <22472@debbugs.gnu.org>; Thu, 4 Feb 2016 03:40:20 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 04 Feb 2016 03:40:20 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=De4xh KlxB3wjiSto3qUHOk8f/B8=; b=CK/7+JONOye7dkeT7Sv4k9Jqf7KBkPtVRsHm2 5mxjWLEflgYn7EMnHDWpBnXesCEFGsPfUh6rrP559jo0DgI0BnUywNBhZq4o08R8 jVxryjeyx60HfdIqyc+ygs0UkFwj7A7aheBJSHKcnBix2y/Fl9XLFKUCIJ/PmdHX TMo+Uo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=De4xhKlxB3wjiSto3qUHOk8f/B8=; b=RwGAC NNDdhD4VxyXZwDeOdY7fQynnRAhR+ZMAuMzuzHoekOTV4Kg/d1jeGDGDcpilUIds vkYUtmDEjmDyA0zxVpxKooyWa9/afVmvZBNTONeZs7yYjyqIR63Z8FT6jsVch+tN 5rCLjB7hAr/7BOpOn10cPW/xKiXLWwb2OS2k/0= X-Sasl-enc: p+ZdFQp8jvAPmwrTxl5Pkr3o313HPkqr776K6eWVvqUu 1454575220 Received: from shorty.local (174-28-85-47.albq.qwest.net [174.28.85.47]) by mail.messagingengine.com (Postfix) with ESMTPA id 1CECDC00016; Thu, 4 Feb 2016 03:40:20 -0500 (EST) Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aRFSb-0005VQ-QM; Thu, 04 Feb 2016 00:40:17 -0800 References: <874mdz9th5.fsf@secretsauce.net> <87oabyuwbf.fsf@free.fr> <87powd2usq.fsf@secretsauce.net> <87mvrh2qbf.fsf@secretsauce.net> <87zivgoou6.fsf@nicolasgoaziou.fr> User-agent: mu4e 0.9.11; emacs 25.0.50.1 From: Dima Kogan In-reply-to: <87zivgoou6.fsf@nicolasgoaziou.fr> Date: Thu, 04 Feb 2016 00:40:17 -0800 Message-ID: <87io243m32.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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? From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Thu, 04 Feb 2016 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Dima Kogan Cc: Bastien Guerry , 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145457562822473 (code B ref 22472); Thu, 04 Feb 2016 08:48:02 +0000 Received: (at 22472) by debbugs.gnu.org; 4 Feb 2016 08:47:08 +0000 Received: from localhost ([127.0.0.1]:58914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRFZE-0005qP-8T for submit@debbugs.gnu.org; Thu, 04 Feb 2016 03:47:08 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54279) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRFZC-0005qG-1t for 22472@debbugs.gnu.org; Thu, 04 Feb 2016 03:47:06 -0500 Received: from selenimh (unknown [IPv6:2a03:a0a0:0:4301::2de]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3B28B1720C2; Thu, 4 Feb 2016 09:47:03 +0100 (CET) From: Nicolas Goaziou In-Reply-To: <87io243m32.fsf@secretsauce.net> (Dima Kogan's message of "Thu, 04 Feb 2016 00:40:17 -0800") 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> Date: Thu, 04 Feb 2016 09:49:05 +0100 Message-ID: <87mvrgoo72.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. Regards, -- Nicolas From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Thu, 04 Feb 2016 18:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Nicolas Goaziou Cc: Bastien Guerry , 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145461010229154 (code B ref 22472); Thu, 04 Feb 2016 18:22:01 +0000 Received: (at 22472) by debbugs.gnu.org; 4 Feb 2016 18:21:42 +0000 Received: from localhost ([127.0.0.1]:60605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aROXF-0007a9-RC for submit@debbugs.gnu.org; Thu, 04 Feb 2016 13:21:42 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48771) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aROXD-0007a1-NU for 22472@debbugs.gnu.org; Thu, 04 Feb 2016 13:21:40 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CA31020A16 for <22472@debbugs.gnu.org>; Thu, 4 Feb 2016 13:21:37 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 04 Feb 2016 13:21:37 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=UuJhQ tolW90mnjiyzeT44gXZf4s=; b=rgyfUEuISe/3exKhxH83tuOQjJYP19YVgwKD+ ijVzO8P2DkR4B4UkElRwmcxyCM98hJMRIjEJ8Aq5+r3pfoZXkddw2q8QoN4q3q6L EV/1ovC4RfHQwH73Lh012brBBAOf+KHTdMjLfqYkZIq5Ml5u6L8+/V6q7srqGwIt KtCTaQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=UuJhQtolW90mnjiyzeT44gXZf4s=; b=t1zvx MpaO4/Aa9jjNRCnW3mpDL8bwpeYNRW+kG4lK+zelx3hTm46px0Xml1ycixAYh0GF sG5JW/7Y79hCLQLVl8FNw0OIS+8YVwPmqLmRrvvMVlQng+DYPS588gINfiXEVsoS X/oGoBMxmq4scYgvsn8HIUx1TlOQW+RTkWLFSY= X-Sasl-enc: Qcy/bawTyoEY222fbLOWkBJaNVmabXuguWB1pbO3tFJY 1454610097 Received: from shorty.local (174-28-85-47.albq.qwest.net [174.28.85.47]) by mail.messagingengine.com (Postfix) with ESMTPA id 618DBC00013; Thu, 4 Feb 2016 13:21:37 -0500 (EST) Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aROX8-0007gM-UI; Thu, 04 Feb 2016 10:21:34 -0800 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> User-agent: mu4e 0.9.11; emacs 25.0.50.1 From: Dima Kogan In-reply-to: <87mvrgoo72.fsf@nicolasgoaziou.fr> Date: Thu, 04 Feb 2016 10:21:34 -0800 Message-ID: <87h9ho2v69.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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! From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Fri, 05 Feb 2016 22:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Dima Kogan Cc: Bastien Guerry , 22472@debbugs.gnu.org Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145471011729079 (code B ref 22472); Fri, 05 Feb 2016 22:09:02 +0000 Received: (at 22472) by debbugs.gnu.org; 5 Feb 2016 22:08:37 +0000 Received: from localhost ([127.0.0.1]:34861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRoYP-0007Yx-HH for submit@debbugs.gnu.org; Fri, 05 Feb 2016 17:08:37 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:60331) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRoYN-0007Yo-Ir for 22472@debbugs.gnu.org; Fri, 05 Feb 2016 17:08:36 -0500 Received: from selenimh (unknown [IPv6:2a03:a0a0:0:4301::2de]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6F7AAA80CB; Fri, 5 Feb 2016 23:08:33 +0100 (CET) From: Nicolas Goaziou In-Reply-To: <87h9ho2v69.fsf@secretsauce.net> (Dima Kogan's message of "Thu, 04 Feb 2016 10:21:34 -0800") 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> <87h9ho2v69.fsf@secretsauce.net> Date: Fri, 05 Feb 2016 23:10:35 +0100 Message-ID: <87wpqiq04k.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hello, Dima Kogan 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. > I think the overlays should all disappear on a revert. I'm not convinced that an unmodified overlay should disappear. Thank you for the report. Regards, -- Nicolas Goaziou From unknown Sat Jun 21 05:19:57 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22472: [O] bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Resent-From: "Stephen J. Barr" Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Fri, 05 Feb 2016 22:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22472 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Nicolas Goaziou Cc: Bastien Guerry , 22472@debbugs.gnu.org, Dima Kogan Received: via spool by 22472-submit@debbugs.gnu.org id=B22472.145471149431288 (code B ref 22472); Fri, 05 Feb 2016 22:32:01 +0000 Received: (at 22472) by debbugs.gnu.org; 5 Feb 2016 22:31:34 +0000 Received: from localhost ([127.0.0.1]:34910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRoub-00088a-PA for submit@debbugs.gnu.org; Fri, 05 Feb 2016 17:31:34 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:37182) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRork-00082u-Ig for 22472@debbugs.gnu.org; Fri, 05 Feb 2016 17:28:37 -0500 Received: by mail-ig0-f173.google.com with SMTP id 5so23951694igt.0 for <22472@debbugs.gnu.org>; Fri, 05 Feb 2016 14:28:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uw-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Vhza8FHW/bSUcHDOfzrEtIvyZPMklKJk4bNwa6M7q1o=; b=ST8u50Dz6a5HdUP7d4SlVKHDBEl5LureNW5ek/VCExvc7MN1+lI4o3JvAAu4bR8T0Y PpkBFIHkDwchZCC55QHxPpd57Vwy99+weYLpl6/J91s3kTg6gj+UgxY88XKcxwA7kxr1 zbUpyOhQIu0hptHTiF3JTqtkImytzSJQSiV4xS1GsDh2kEk6ND9D7T+TmOBBA52ACPJv e/VvhmSi0mARZC6KLXRyVr5Cm8EMoX7sKJzvjRlItsRTSgBmvPG42jZpVnrHGfMdPkEk a9CKlbYKugWXxjJj5cSAx+qZLWKLBfLn1x5hZbYpHdTNH0IevJuvbMTSvPIW/2q7g09O j6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Vhza8FHW/bSUcHDOfzrEtIvyZPMklKJk4bNwa6M7q1o=; b=SnUC+uyEd27COL8nH/kTDbhEt+QbOhK6UKkweq2R4Pi0SofB+1bTPANEWraKwLn5Da h9FJiTswwsUBezRCGQzFAWvgBdBHiL/02SeYpIal3PsDSGLyXqpNiS64mWOik/Gp3uJP aY99dZdMpr9RIpVxW40/Nj3OZrP7XoSqeeSWmQfOordjkFZr2bd7CW0goORsKUq9VUWo fcm2yQZl3v9OBfQw0/y4WZFB9ac+rHf4odBDAsl2yRr5ZI73jn1s7nQnjNDOXTL268F1 BDKkBu+lEY0AM/alDVd66xEpowj9HhG0hudqR0rYnJakc9mXAq0twdbwoKHFzOsgYwy0 Y+Cw== X-Gm-Message-State: AG10YOQN8EEPshTSHWS4ci+Cis9R5+uEd0mUhHpFuMnb3xFq/u6WxCzpJ5lPuWBFXyMefqZW3pDGRl9lHytkww== MIME-Version: 1.0 X-Received: by 10.50.142.98 with SMTP id rv2mr17011964igb.61.1454711311154; Fri, 05 Feb 2016 14:28:31 -0800 (PST) Received: by 10.79.6.204 with HTTP; Fri, 5 Feb 2016 14:28:31 -0800 (PST) In-Reply-To: <87wpqiq04k.fsf@nicolasgoaziou.fr> 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> <87h9ho2v69.fsf@secretsauce.net> <87wpqiq04k.fsf@nicolasgoaziou.fr> Date: Fri, 5 Feb 2016 14:28:31 -0800 Message-ID: From: "Stephen J. Barr" Content-Type: multipart/alternative; boundary=001a1136b7d8f3dabe052b0d5e7d X-Spam-Score: -0.1 (/) X-Mailman-Approved-At: Fri, 05 Feb 2016 17:31:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --001a1136b7d8f3dabe052b0d5e7d Content-Type: text/plain; charset=UTF-8 I was in the progress of writing my own email about this same issue. I was not aware that C-c C-c is no longer used for disabling overlays. If this is the case, what is the correct workflow for toggling these previews on and off? Thanks, -Stephen Stephen J. Barr PhD Candidate, Operations Management Dept: Information Systems and Operations Management (ISOM) Michael G. Foster School of Business University of Washington Phone: 425 516 5012 Email: stevejb@uw.edu Twitter: @stevejb Website: http://stephen.planetbarr.com On Fri, Feb 5, 2016 at 2:10 PM, Nicolas Goaziou wrote: > Hello, > > Dima Kogan 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. > > > I think the overlays should all disappear on a revert. > > I'm not convinced that an unmodified overlay should disappear. > > Thank you for the report. > > > Regards, > > -- > Nicolas Goaziou > > > > --001a1136b7d8f3dabe052b0d5e7d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I was in the progress of writing my own email about this s= ame issue. I was not aware that C-c C-c is no longer used for disabling ove= rlays. If this is the case, what is the correct workflow for toggling these= previews on and off?

Thanks,

-= Stephen



Stephen J. Barr
PhD Candidate, = Operations Management
De= pt: Information Systems and Operations Management (ISOM)
Michael G. Foster School of B= usiness
University of Washington
Phone: =C2=A0425 516 5012=
Twitter: @= stevejb



On Fri, Feb 5, 2016 at 2:10 PM, Nicolas Goaz= iou <mail@nicolasgoaziou.fr> wrote:
Hello,

Dima Kogan <dima@secretsauce.net= > writes:

> Ah. Thanks for explaining. The patch helps som= ewhat, but one can still
> get into an inconsistent state:
>
>=C2=A0 =C2=A01. Write \(1 + 2\)
>=C2=A0 =C2=A02. Toggle overlay with C-c C-x C-l
>=C2=A0 =C2=A03. 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.

> I think the overlays should all disappear on a revert.

I'm not convinced that an unmodified overlay should disappear.
Thank you for the report.


Regards,

--
Nicolas Goaziou




--001a1136b7d8f3dabe052b0d5e7d-- From unknown Sat Jun 21 05:19:57 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dima Kogan Subject: bug#22472: closed (Re: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert) Message-ID: References: <87egcq2p8f.fsf@secretsauce.net> <874mdz9th5.fsf@secretsauce.net> X-Gnu-PR-Message: they-closed 22472 X-Gnu-PR-Package: org-mode Reply-To: 22472@debbugs.gnu.org Date: Sat, 06 Feb 2016 08:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1454748902-3537-1" This is a multi-part message in MIME format... ------------=_1454748902-3537-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a rev= ert 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 22472@debbugs.gnu.org. --=20 22472: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22472 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1454748902-3537-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 22472-done) by debbugs.gnu.org; 6 Feb 2016 08:54:31 +0000 Received: from localhost ([127.0.0.1]:35105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRydT-0000uH-05 for submit@debbugs.gnu.org; Sat, 06 Feb 2016 03:54:31 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51329) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aRydR-0000uA-8j for 22472-done@debbugs.gnu.org; Sat, 06 Feb 2016 03:54:29 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1F3412036F for <22472-done@debbugs.gnu.org>; Sat, 6 Feb 2016 03:54:29 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Sat, 06 Feb 2016 03:54:29 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=xEOST R7IJbV+HtC8Sq9qsMJm5Q8=; b=GAfbVkx+1eELaefY2AQGJtsGhaI6WvPf+COG0 QjsuZl+KtOHcT0PpvOCLb8siOjpA/K3nQ+wltIwt6kWVubUnS9Y58AL3Kw7aWP7x NCMbEc7khl7WyBg+ZeRZGLc5TUp3FtWWPJhtDpPT/72wECXhLem/KHJbFMDjMk2R GmcTz8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=xEOSTR7IJbV+HtC8Sq9qsMJm5Q8=; b=JC5cJ bz9ClKtX+070uPerwLWnUhT1NuOUffmHja2HSkdwXO/BlNEQ+5v1BPCeX8DF+8ht leQEynidgPZHqTxx3B3XTLx1u0QzXOCvkg70zfK9Hyrin4VwANjEyNuB0NMCBLW2 RxjMINkmnqJm7gPHX1A2+wisFxWcyxoBDjvCDk= X-Sasl-enc: vr/EX9O8V5WDhVfZkzSL7krlDsCAcD8cuRpsiHcl2mlb 1454748868 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E888C00014; Sat, 6 Feb 2016 03:54:28 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aRydM-0001Hl-93; Sat, 06 Feb 2016 00:54:24 -0800 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> <87h9ho2v69.fsf@secretsauce.net> <87wpqiq04k.fsf@nicolasgoaziou.fr> User-agent: mu4e 0.9.11; emacs 25.0.50.1 From: Dima Kogan To: Nicolas Goaziou Subject: Re: bug#22472: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert In-reply-to: <87wpqiq04k.fsf@nicolasgoaziou.fr> Date: Sat, 06 Feb 2016 00:54:24 -0800 Message-ID: <87egcq2p8f.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22472-done Cc: Bastien Guerry , 22472-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Nicolas Goaziou writes: > Dima Kogan 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. ------------=_1454748902-3537-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 27 Jan 2016 11:01:54 +0000 Received: from localhost ([127.0.0.1]:38104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aONrG-00047e-D5 for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51973) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aONrF-00047T-8o for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aONr0-0000DM-MV for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:48 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aONr0-0000DE-K1 for submit@debbugs.gnu.org; Wed, 27 Jan 2016 06:01:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aONqz-0004RC-Lk for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 06:01:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aONqu-0000BA-3v for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 06:01:37 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aONqt-0000AX-Tf for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 06:01:32 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2ECD82C5D3 for ; Wed, 27 Jan 2016 06:01:30 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Wed, 27 Jan 2016 06:01:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=/2+8rIB6xzBO6E2rI6Ap1bXKOAo =; b=WvAke7iNjBokDTYl6ElXAxpaLNp2betwoyb8LIoihN1NYS0+Wig2scMk/I1 DMagb4hO4SBKSIoj3n+j+fIM3DUqp+YaMzAoop8MHbdNcodeL96bXGbAPSZlvSBH u3yH8CFr/8EIQIrPwJky3vA0rE4Laiz3OQkIETDR5RPTq9mk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=/2 +8rIB6xzBO6E2rI6Ap1bXKOAo=; b=LZn3kIRwiA4RDSq3es599qvdOxZpcF4wAE AUM+M0UiGcXuTEwZLetJcOj/YfUhwX16WLp4bmhCiekvry4HqFrYMvzTrzzHvtL1 mdFUM/Z8Up1AsTP9HSl1GlElFnRX+7cIT//K+oplgZ43O1oqHvG2U3RcIdtNA9n1 dHY2oMnWI= X-Sasl-enc: 72K371oC6nyZ7yTkIq+KpbuL1/dUUulJIuNh1XVOpd4M 1453892489 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id C0F23C01715 for ; Wed, 27 Jan 2016 06:01:29 -0500 (EST) Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aONqo-0002KB-KE for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2016 03:01:26 -0800 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 25.0.50; org-mode: latex fragments can't be un-rendered after a revert Date: Wed, 27 Jan 2016 03:01:26 -0800 Message-ID: <874mdz9th5.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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! ------------=_1454748902-3537-1--