From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: proposal to make C-c C-c not remove latex overlays Date: Mon, 14 Jul 2014 20:33:54 -0400 Message-ID: <87k37fa2a5.fsf@gmail.com> References: <87wqbf37it.fsf@andrew.cmu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6qgv-0006nY-IF for emacs-orgmode@gnu.org; Mon, 14 Jul 2014 20:33:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6qgu-0000Ff-MT for emacs-orgmode@gnu.org; Mon, 14 Jul 2014 20:33:57 -0400 Received: from mail-qa0-x22d.google.com ([2607:f8b0:400d:c00::22d]:50838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6qgu-0000Fb-IW for emacs-orgmode@gnu.org; Mon, 14 Jul 2014 20:33:56 -0400 Received: by mail-qa0-f45.google.com with SMTP id cm18so2541493qab.32 for ; Mon, 14 Jul 2014 17:33:56 -0700 (PDT) In-Reply-To: <87wqbf37it.fsf@andrew.cmu.edu> 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: John Kitchin , emacs-orgmode@gnu.org Hi John, 2014ko uztailak 14an, John Kitchin-ek idatzi zuen: >=20 > I am using org-mode files with equations and code blocks in lectures, > and it is problematic that C-c C-c removes the equation overlays when > running a code block. First, you have to press C-c C-c twice to run the > block, since the first one gets rid of the equations, but then you have > run C-c C-x C-l to get the equations back! and the cycle repeats > throughout a lecture. >=20 > I would prefer that the equations stay untouched, and that the code > blocks run without modifying them.=20 >=20 > I think the best behavior would be for C-c C-x C-l to toggle the > equations, and to remove the C-c C-c behavior for latex overlays > completely. But it would be ok if this was done by a C-c C-c hook > function, so that a user could remove the latex overlay without touching > the org-code. >=20 > Maybe a new function like this: >=20 > #+BEGIN_SRC emacs-lisp > (defun org-toggle-latex-overlays (arg) > "Toggle LaTeX fragments." > (interactive "P") > (if org-latex-fragment-image-overlays > (org-remove-latex-fragment-image-overlays) > (org-preview-latex-fragment arg))) > #+END_SRC >=20 > could be added. Any thoughts? I don=E2=80=99t have a comment on the substance of the proposal, but rather= two suggestions for workarounds. The first is to use the C-c C-v C-e binding to execute source blocks rather than C-c C-c. The second is to let-bind =E2=80=98org-latex-fragment-image-overlays=E2=80= =99 to nil in an advice around the =E2=80=98org-ctrl-c-ctrl-c=E2=80=99 function, allow= ing you to still use the more convenient C-c C-c binding. --=20 Aaron Ecay