@findex prettify-symbols-mode
Prettify Symbols mode is a buffer-local minor mode that replaces
-certain strings with more attractive versions for display
-purposes. For example, in Emacs Lisp mode, it replaces the string
-@samp{lambda} with the Greek lambda character @samp{λ}. You may wish
-to use this
-in non-programming modes as well. You can customize the mode by
-adding more entries to @code{prettify-symbols-alist}. There is also a
-global version, @code{global-prettify-symbols-mode}, which enables the
-mode in all buffers that support it.
+certain strings with more attractive versions for display purposes.
+For example, in Emacs Lisp mode, it replaces the string @samp{lambda}
+with the Greek lambda character @samp{λ}. You may wish to use this in
+non-programming modes as well. You can customize the mode by adding
+more entries to @code{prettify-symbols-alist}. More elaborate
+customization is available via customizing
+@code{prettify-symbols-compose-predicate} if its default value
+@code{prettify-symbols-default-compose-p} is not appropriate. There
+is also a global version, @code{global-prettify-symbols-mode}, which
+enables the mode in all buffers that support it.
+
+ The symbol at point can be shown in its original form. This is
+controlled by the variable @code{prettify-symbols-unprettify-at-point}:
+if non-@code{nil}, the original form of symbol at point will be
+restored for as long as point is at it.
@node C Modes
** Prettify Symbols mode
++++
*** 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
+specify in which contexts a symbol may be displayed as 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).
++++
*** Symbols can be unprettified while point is inside them.
New variable `prettify-symbols-unprettify-at-point' configures this.
matching SYMBOL (a string, not a regexp) will be shown as
CHARACTER instead.
-CHARACTER can be a character or it can be a list or vector, in
+CHARACTER can be a character, or it can be a list or vector, in
which case it will be used to compose the new symbol as per the
third argument of `compose-region'.")
(defun prettify-symbols-default-compose-p (start end _match)
"Return true iff the symbol MATCH should be composed.
The symbol starts at position START and ends at position END.
-This is default `prettify-symbols-compose-predicate' which is
-suitable for most programming languages such as C or Lisp."
+This is the default for `prettify-symbols-compose-predicate'
+which is suitable for most programming languages such as C or Lisp."
;; Check that the chars should really be composed into a symbol.
(let* ((syntaxes-beg (if (memq (char-syntax (char-after start)) '(?w ?_))
'(?w ?_) '(?. ?\\)))
(defvar-local prettify-symbols-compose-predicate
#'prettify-symbols-default-compose-p
- "A predicate deciding if the currently matched symbol is to be composed.
+ "A predicate for deciding if the currently matched symbol is to be composed.
The matched symbol is the car of one entry in `prettify-symbols-alist'.
-The predicate receives the match's start and end position as well
+The predicate receives the match's start and end positions as well
as the match-string as arguments.")
(defun prettify-symbols--compose-symbol (alist)
"Compose a sequence of characters into a symbol.
-Regexp match data 0 points to the chars."
+Regexp match data 0 specifies the characters to be composed."
;; Check that the chars should really be composed into a symbol.
(let ((start (match-beginning 0))
(end (match-end 0))