From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: proposal to make C-c C-c not remove latex overlays Date: Tue, 15 Jul 2014 17:13:05 -0400 Message-ID: <85zjgaxr4u.fsf@andrew.cmu.edu> References: <87wqbf37it.fsf@andrew.cmu.edu> <87k37fa2a5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7A1l-0006OC-Oi for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 17:12:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7A1e-0007le-A1 for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 17:12:45 -0400 Received: from mail-qc0-x236.google.com ([2607:f8b0:400d:c01::236]:34033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7A1e-0007k0-44 for emacs-orgmode@gnu.org; Tue, 15 Jul 2014 17:12:38 -0400 Received: by mail-qc0-f182.google.com with SMTP id r5so4786707qcx.13 for ; Tue, 15 Jul 2014 14:12:37 -0700 (PDT) Received: from CHEME-PC (JKITCHIN-WIN.CHEME.CMU.EDU. [128.2.52.109]) by mx.google.com with ESMTPSA id p15sm27860334qar.34.2014.07.15.14.12.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jul 2014 14:12:36 -0700 (PDT) In-Reply-To: <87k37fa2a5.fsf@gmail.com> (Aaron Ecay's message of "Mon, 14 Jul 2014 20:33:54 -0400") 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: emacs-orgmode@gnu.org Aaron Ecay writes: Thanks for the advice idea, that is a nice one. It doesn't work for me like this though: #+BEGIN_SRC emacs-lisp (defadvice org-ctrl-c-ctrl-c (around latex-overlays) "ignore latex overlays in C-cC-c" (let ((org-latex-fragment-image-overlays nil)) ad-do-it)) #+END_SRC maybe because that is a buffer local variable? > 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=A1=AFt 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 =A1=AEorg-latex-fragment-image-overlays=A1=AF t= o nil > in an advice around the =A1=AEorg-ctrl-c-ctrl-c=A1=AF function, allowing = you to > still use the more convenient C-c C-c binding. --=20 ----------------------------------- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu