]> code.delx.au - gnu-emacs/commitdiff
Use add-function for prettify-symbols-compose-predicate
authorTassilo Horn <tsdh@gnu.org>
Fri, 21 Aug 2015 18:18:34 +0000 (20:18 +0200)
committerTassilo Horn <tsdh@gnu.org>
Fri, 21 Aug 2015 18:19:47 +0000 (20:19 +0200)
* 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.

etc/NEWS
lisp/textmodes/tex-mode.el

index 17a6c3a08285eb272c9d72afd5b2de846995edaa..72af95e8de579f7a6e182b3969b3b6183b897370 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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.
index 8f68c71fd17daa848504d7df234d8982bb9c2991..78cfbeaf895b0f50ce98795db9485a7abb2395d3 100644 (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.