From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anders Johansson Subject: Re: Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits Date: Sat, 15 Mar 2014 14:54:52 +0100 Message-ID: <53245BAC.9020307@gmail.com> References: <5309DA59.3070905@gmail.com> <5309E086.8030505@gmail.com> <530A11A4.1070608@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOp3M-0003HS-JA for emacs-orgmode@gnu.org; Sat, 15 Mar 2014 09:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOp3E-0002Dh-6A for emacs-orgmode@gnu.org; Sat, 15 Mar 2014 09:55:08 -0400 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:48089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOp3D-0002DW-U3 for emacs-orgmode@gnu.org; Sat, 15 Mar 2014 09:55:00 -0400 Received: by mail-la0-f46.google.com with SMTP id hr17so2530400lab.19 for ; Sat, 15 Mar 2014 06:54:58 -0700 (PDT) Received: from [130.238.77.127] (pc127.kvk.uu.se. [130.238.77.127]) by mx.google.com with ESMTPSA id qf1sm8887017lbc.8.2014.03.15.06.54.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Mar 2014 06:54:57 -0700 (PDT) In-Reply-To: <530A11A4.1070608@gmail.com> 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 2014-02-23 16:20, Anders Johansson wrote: > >>> Hi, >>> I used the configuration: >>> >>> org-catch-invisible-edits 'show >>> org-pretty-entities t >>> >>> together with org-cdlatex. This breaks the insertion of subscripts >>> and superscripts through org-cdlatex because _{} is fontified and the >>> {} are hidden so typing for example: "a _ bc" results in "a_{b}c" (or >>> sometimes "a_bc", but should be "a_{bc}") and gives the message >>> "Unfolding invisible region around point before editing". >>> >>> Setting org-catch-invisible-edits to nil let's cdlatex do it's work >>> so I guess an easy solution would be to "let" that in >>> org-cdlatex-underscore-caret. >>> >> Hi, >> I realized that my solution won't work since >> "org-check-before-invisible-edit" does it's work after >> "org-cdlatex-underscore-caret" has called "cdlatex-sub-superscript" >> and inserted "_{}". >> >> Maybe then org-catch-invisible-edits should be nil all the time in >> org-cdlatex-mode? But this would be unexpected. Maybe this can be >> treated as a special case in "org-check-before-invisible-edit" in some >> way? >> > Digging into it some more it's actually the "pretty entities" folding > which is the problem, regardless of org-check-before-invisible-edit. The > cursor jumps out of the {}-brackets after the first character, when the > hiding/folding is done. I have no idea what should be done about this. > In case anyone has the same problem, my current workaraound for this is disabling "pretty entities" for sub/superscript when using cdlatex: (add-hook 'cdlatex-mode-hook (lambda () (when (eq major-mode 'org-mode) (make-local-variable 'org-pretty-entities-include-sub-superscripts) (setq org-pretty-entities-include-sub-superscripts nil)))) Cheers, Anders Johansson