summaryrefslogtreecommitdiff
path: root/doc/emacs/programs.texi
diff options
context:
space:
mode:
authorXue Fuqiao <xfq@gnu.org>2014-02-28 11:04:12 +0800
committerXue Fuqiao <xfq@gnu.org>2014-02-28 11:04:12 +0800
commit4f07dcdce61f54524a8efe63493e5db6e605dd2d (patch)
tree8a08b2f15e0607e108b70758734bb35171342277 /doc/emacs/programs.texi
parent0a4d25e5d249d35a08959a2775229fef804e9edc (diff)
parent0fcfa97418aa7e7fa42887507e25b9bdf150cc66 (diff)
downloademacs-4f07dcdce61f54524a8efe63493e5db6e605dd2d.tar.gz
Document `prettify-symbols-mode' and `global-prettify-symbols-mode'.
* doc/emacs/emacs.texi (Top): * doc/emacs/programs.texi (Programs, Prettifying Symbols): Document `prettify-symbols-mode' and `global-prettify-symbols-mode'. * etc/NEWS: Markup changes.
Diffstat (limited to 'doc/emacs/programs.texi')
-rw-r--r--doc/emacs/programs.texi32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 4a6da9e4fd6..1cbf61970c0 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -38,6 +38,7 @@ Highlight program syntax (@pxref{Font Lock}).
* Symbol Completion:: Completion on symbol names of your program or language.
* MixedCase Words:: Dealing with identifiersLikeThis.
* Semantic:: Suite of editing tools based on source code parsing.
+* Prettifying Symbols:: Display symbols as composed characters.
* Misc for Programs:: Other Emacs features useful for editing programs.
* C Modes:: Special commands of C, C++, Objective-C, Java,
IDL, Pike and AWK modes.
@@ -1432,6 +1433,37 @@ is idle.
@xref{Top, Semantic,, semantic, Semantic}, for details.
@end ifnottex
+@node Prettifying Symbols
+@section Prettifying Symbols
+@cindex prettifying symbols
+@cindex symbol, prettifying
+
+@code{prettify-symbols-mode} and @code{global-prettify-symbols-mode}
+are two minor modes (@pxref{Minor Modes}) that can display specified
+symbols as composed characters. For instance, in Emacs Lisp mode
+(@pxref{Lisp Eval}), this mode will replace the string ``lambda'' with
+the Greek lambda character.
+
+@findex prettify-symbols-mode
+@vindex prettify-symbols-alist
+When Prettify Symbols mode and Font Lock mode (@pxref{Font Lock}) are
+enabled, symbols are prettified (displayed as composed characters)
+according to the rules in @code{prettify-symbols-alist}, which are
+locally defined by major modes (@pxref{Major Modes}) supporting
+prettifying. To add further customizations for a given major mode,
+you can modify @code{prettify-symbols-alist}. For example:
+
+@example
+(add-hook 'emacs-lisp-mode-hook
+ (lambda ()
+ (push '("<=" . ?≤) prettify-symbols-alist)))
+@end example
+
+@findex global-prettify-symbols-mode
+You can enable this mode locally in desired buffers, or use
+@code{global-prettify-symbols-mode} to enable it for all modes that
+support it.
+
@node Misc for Programs
@section Other Features Useful for Editing Programs