On Wednesday, 6 May 2015 at 13:35, Titus von der Malsburg wrote: [...]
> So if the problem is only due to mistaken optimization, it would perhaps > be best to just revert to the previous code. Or if the "optimisation" was key to getting acceptable performance, maybe discourage the use of $...$ and emphasise the use of \(...\). The latter is less fragile and is easy to generate by typing $ using the following function and binding: #+begin_src emacs-lisp ;; from Nicolas Richard <theonewiththeevill...@yahoo.fr> ;; Date: Fri, 8 Mar 2013 16:23:02 +0100 ;; Message-ID: <87vc913oh5....@yahoo.fr> (defun yf/org-electric-dollar nil "When called once, insert \\(\\) and leave point in between. When called twice, replace the previously inserted \\(\\) by one $." (interactive) (if (and (looking-at "\\\\)") (looking-back "\\\\(")) (progn (delete-char 2) (delete-char -2) (insert "$")) (insert "\\(\\)") (backward-char 2))) (define-key org-mode-map (kbd "$") 'yf/org-electric-dollar) #+end_src The problem with $ in org mode is that it is a valid standalone character (i.e. currency symbol). Having it perform two functions (symbol and LaTeX directive) makes it difficult to optimise performance. -- : Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-820-gd92ef9