1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00

Use add-function for prettify-symbols-compose-predicate

* lisp/textmodes/tex-mode.el (tex-common-initialization): Set
prettify-symbols-compose-predicate in terms of add-function.

* etc/NEWS: Mention prettify-symbols-compose-predicate and
prettify-symbols-mode support in tex-mode.
This commit is contained in:
Tassilo Horn 2015-08-21 20:18:34 +02:00
parent 74881b6e06
commit 2649105ae3
2 changed files with 13 additions and 1 deletions

View File

@ -301,6 +301,13 @@ standards.
** Prog mode has some support for multi-mode indentation.
See `prog-indentation-context' and `prog-widen'.
** Prettify Symbols mode supports custom composition predicates. By
overriding the default `prettify-symbols-compose-predicate', modes can
specify in which contexts a symbol map be composed to some unicode
character. `prettify-symbols-default-compose-p' is the default which
is suitable for most programming languages such as C or Lisp (but not
(La)TeX).
** New `xterm-screen-extra-capabilities' config.
** The `save-place' variable is replaced by a `save-place-mode'.
@ -694,6 +701,10 @@ name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded.
*** New custom variable `tex-print-file-extension' to help users who
use PDF instead of DVI.
*** TeX mode now supports Prettify Symbols mode. When enabling
`prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and
many other math macros are displayed using unicode characters.
** whitespace-mode: new 'big-indent style highlighting too much indentation.
By default, 32 spaces and four TABs are considered to be too much but
`whitespace-big-indent-regexp' can be configured to change that.

View File

@ -1256,7 +1256,8 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook
(font-lock-unfontify-region-function
. tex-font-lock-unfontify-region)))
(setq-local prettify-symbols-alist tex--prettify-symbols-alist)
(setq-local prettify-symbols-compose-predicate #'tex--prettify-symbols-compose-p)
(add-function :override (local 'prettify-symbols-compose-predicate)
#'tex--prettify-symbols-compose-p)
(setq-local syntax-propertize-function
(syntax-propertize-rules latex-syntax-propertize-rules))
;; TABs in verbatim environments don't do what you think.