2014-02-23 16:20, Anders Johansson wrote:

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

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

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))))

Anders Johansson

Reply via email to