On Sun, 4 Aug 2019, Eric S Fraga had the gall to write :

> By the way, you might be interested in the following configuration
> snippet which makes org insert \(\) when you type a single $ (and a $
> if you type 2 of them in a row).
> 
> #+begin_src emacs-lisp :tangle "esf-org.el"
>   ;; from Nicolas Richard <address@hidden>
>   ;; Date: Fri, 8 Mar 2013 16:23:02 +0100
>   ;; Message-ID: <address@hidden>
>   (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

A bitt too much reminescent of this xkcd [horror](
https://www.xkcd.com/1806/)...

HTH(BASIWn't)

--
Emmanuel Charpentier



Reply via email to