[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] sub and superscripts: without «_» and «^»
From: |
Uwe Brauer |
Subject: |
Re: [AUCTeX-devel] sub and superscripts: without «_» and «^» |
Date: |
Thu, 03 Sep 2015 09:49:26 +0000 |
User-agent: |
Gnus/5.13001 (Ma Gnus v0.10) Emacs/25.0.50 (gnu/linux) |
> Stefan Monnier <address@hidden> writes:
> I guess what Uwe wants is that `prettify-symbols-mode' in a (La)TeX
> buffer (with stock latex-mode or AUCTeX; doesn't really matter) could
> have the option to make the ^ and _ invisible, too.
> I already told him that this is not what p-s-m is meant for. But it's
> easy enough to write a custom font-lock rule for that:
> (defun th/invisible-super-sub-scripts ()
> (interactive)
> (cl-pushnew 'invisible font-lock-extra-managed-props)
> (font-lock-add-keywords
> nil
> '(("[^\\\\]\\([_^]\\)" (1 '(face nil invisible t) t))))
> (font-lock-flush))
> Uwe, if you want you could do something like that:
> (add-hook 'prettify-symbols-mode-hook
> (lambda ()
> (when (eq major-mode 'latex-mode)
> (th/invisible-super-sub-scripts))))
Thanks again Tassilo.
With these new setting and functions, prettify-symbols-mode behaves
almost as x-symbol-mode[1]
I strongly recommend to include the code in Auctex, maybe with a
additional variable, something like this
(defvar prettify-invisible-super-sub-scripts t
"*Variable which makes the «_» and «^» invisible.")
Or use defcustom
(add-hook 'prettify-symbols-mode-hook
(lambda ()
(when (eq major-mode 'latex-mode)
(if prettify-invisible-super-sub-scripts
(th/invisible-super-sub-scripts)))))
Uwe Brauer
Footnotes:
[1] the only difference is that in x-symbol-mode
\includegraphics{fig.png} is, via imagemagick, presented as an embedded
image. I am pretty sure GNU emacs could do this as well....
- Re: [AUCTeX-devel] sub and superscripts: without «_» and «^»,
Uwe Brauer <=
- Re: [AUCTeX-devel] sub and superscripts: without «_» and «^», Tassilo Horn, 2015/09/03
- Re: [AUCTeX-devel] sub and superscripts: without «_» and «^», Uwe Brauer, 2015/09/03
- Re: [AUCTeX-devel] sub and superscripts: without «_» and «^», Tassilo Horn, 2015/09/03
- [AUCTeX-devel] [some testing] (was: sub and superscripts: without «_» and «^»), Uwe Brauer, 2015/09/04
- Re: [AUCTeX-devel] [some testing], Tassilo Horn, 2015/09/04
- Re: [AUCTeX-devel] [some testing], Uwe Brauer, 2015/09/04
- Re: [AUCTeX-devel] [some testing], Tassilo Horn, 2015/09/04