diff options
| author | Tassilo Horn | 2015-08-21 20:18:34 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2015-08-21 20:19:47 +0200 |
| commit | 2649105ae30edf97ac5f543b269886103c42c91c (patch) | |
| tree | 15469c9fee409aa8a807909756ca400199aff908 | |
| parent | 74881b6e068e209725527b3776aaaa7955d4fb4a (diff) | |
| download | emacs-2649105ae30edf97ac5f543b269886103c42c91c.tar.gz emacs-2649105ae30edf97ac5f543b269886103c42c91c.zip | |
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.
| -rw-r--r-- | etc/NEWS | 11 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 3 |
2 files changed, 13 insertions, 1 deletions
| @@ -301,6 +301,13 @@ standards. | |||
| 301 | ** Prog mode has some support for multi-mode indentation. | 301 | ** Prog mode has some support for multi-mode indentation. |
| 302 | See `prog-indentation-context' and `prog-widen'. | 302 | See `prog-indentation-context' and `prog-widen'. |
| 303 | 303 | ||
| 304 | ** Prettify Symbols mode supports custom composition predicates. By | ||
| 305 | overriding the default `prettify-symbols-compose-predicate', modes can | ||
| 306 | specify in which contexts a symbol map be composed to some unicode | ||
| 307 | character. `prettify-symbols-default-compose-p' is the default which | ||
| 308 | is suitable for most programming languages such as C or Lisp (but not | ||
| 309 | (La)TeX). | ||
| 310 | |||
| 304 | ** New `xterm-screen-extra-capabilities' config. | 311 | ** New `xterm-screen-extra-capabilities' config. |
| 305 | 312 | ||
| 306 | ** The `save-place' variable is replaced by a `save-place-mode'. | 313 | ** 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. | |||
| 694 | *** New custom variable `tex-print-file-extension' to help users who | 701 | *** New custom variable `tex-print-file-extension' to help users who |
| 695 | use PDF instead of DVI. | 702 | use PDF instead of DVI. |
| 696 | 703 | ||
| 704 | *** TeX mode now supports Prettify Symbols mode. When enabling | ||
| 705 | `prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and | ||
| 706 | many other math macros are displayed using unicode characters. | ||
| 707 | |||
| 697 | ** whitespace-mode: new 'big-indent style highlighting too much indentation. | 708 | ** whitespace-mode: new 'big-indent style highlighting too much indentation. |
| 698 | By default, 32 spaces and four TABs are considered to be too much but | 709 | By default, 32 spaces and four TABs are considered to be too much but |
| 699 | `whitespace-big-indent-regexp' can be configured to change that. | 710 | `whitespace-big-indent-regexp' can be configured to change that. |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 8f68c71fd17..78cfbeaf895 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1256,7 +1256,8 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook | |||
| 1256 | (font-lock-unfontify-region-function | 1256 | (font-lock-unfontify-region-function |
| 1257 | . tex-font-lock-unfontify-region))) | 1257 | . tex-font-lock-unfontify-region))) |
| 1258 | (setq-local prettify-symbols-alist tex--prettify-symbols-alist) | 1258 | (setq-local prettify-symbols-alist tex--prettify-symbols-alist) |
| 1259 | (setq-local prettify-symbols-compose-predicate #'tex--prettify-symbols-compose-p) | 1259 | (add-function :override (local 'prettify-symbols-compose-predicate) |
| 1260 | #'tex--prettify-symbols-compose-p) | ||
| 1260 | (setq-local syntax-propertize-function | 1261 | (setq-local syntax-propertize-function |
| 1261 | (syntax-propertize-rules latex-syntax-propertize-rules)) | 1262 | (syntax-propertize-rules latex-syntax-propertize-rules)) |
| 1262 | ;; TABs in verbatim environments don't do what you think. | 1263 | ;; TABs in verbatim environments don't do what you think. |