Mercurial > emacs
comparison lispref/modes.texi @ 62652:e89d01c0c1c4
(Font Lock Basics, Syntactic Font Lock): Recommend
syntax-begin-function over font-lock-beginning-of-syntax-function.
author | Lute Kamstra <lute@gnu.org> |
---|---|
date | Mon, 23 May 2005 12:01:08 +0000 |
parents | 47219b2b8b6f |
children | 9f2d0e4a66d0 5b029ff3b08d |
comparison
equal
deleted
inserted
replaced
62651:8d965863dd8c | 62652:e89d01c0c1c4 |
---|---|
2366 . @var{string})}. These are used to set up a syntax table for | 2366 . @var{string})}. These are used to set up a syntax table for |
2367 syntactic fontification (@pxref{Syntax Table Functions}). The | 2367 syntactic fontification (@pxref{Syntax Table Functions}). The |
2368 resulting syntax table is stored in @code{font-lock-syntax-table}. | 2368 resulting syntax table is stored in @code{font-lock-syntax-table}. |
2369 | 2369 |
2370 The fifth element, @var{syntax-begin}, specifies the value of | 2370 The fifth element, @var{syntax-begin}, specifies the value of |
2371 @code{font-lock-beginning-of-syntax-function}. | 2371 @code{font-lock-beginning-of-syntax-function}. We recommend setting |
2372 this variable to @code{nil} and using @code{syntax-begin-function} | |
2373 instead. | |
2372 | 2374 |
2373 All the remaining elements (if any) are collectively called | 2375 All the remaining elements (if any) are collectively called |
2374 @var{other-vars}. Each of these elements should have the form | 2376 @var{other-vars}. Each of these elements should have the form |
2375 @code{(@var{variable} . @var{value})}---which means, make | 2377 @code{(@var{variable} . @var{value})}---which means, make |
2376 @var{variable} buffer-local and then set it to @var{value}. You can | 2378 @var{variable} buffer-local and then set it to @var{value}. You can |
2878 This variable holds the syntax table to use for fontification of | 2880 This variable holds the syntax table to use for fontification of |
2879 comments and strings. Specify it using @var{syntax-alist} in | 2881 comments and strings. Specify it using @var{syntax-alist} in |
2880 @code{font-lock-defaults}. | 2882 @code{font-lock-defaults}. |
2881 @end defvar | 2883 @end defvar |
2882 | 2884 |
2883 @c ??? | |
2884 @c The docstring says that font-lock-syntax-table is semi-obsolete. | |
2885 @c How the alternative should be used is not clear. --lute | |
2886 | |
2887 @defvar font-lock-beginning-of-syntax-function | 2885 @defvar font-lock-beginning-of-syntax-function |
2888 If this variable is non-@code{nil}, it should be a function to move | 2886 If this variable is non-@code{nil}, it should be a function to move |
2889 point back to a position that is syntactically at ``top level'' and | 2887 point back to a position that is syntactically at ``top level'' and |
2890 outside of strings or comments. Font Lock uses this when necessary | 2888 outside of strings or comments. Font Lock uses this when necessary |
2891 to get the right results for syntactic fontification. | 2889 to get the right results for syntactic fontification. |
2894 the beginning of any enclosing syntactic block. Typical values are | 2892 the beginning of any enclosing syntactic block. Typical values are |
2895 @code{beginning-of-line} (used when the start of the line is known to | 2893 @code{beginning-of-line} (used when the start of the line is known to |
2896 be outside a syntactic block), or @code{beginning-of-defun} for | 2894 be outside a syntactic block), or @code{beginning-of-defun} for |
2897 programming modes, or @code{backward-paragraph} for textual modes. | 2895 programming modes, or @code{backward-paragraph} for textual modes. |
2898 | 2896 |
2899 If the value is @code{nil}, the beginning of the buffer is used as a | 2897 If the value is @code{nil}, Font Lock uses |
2900 position outside of a syntactic block. This cannot be wrong, but it | 2898 @code{syntax-begin-function} to move back outside of any comment, |
2901 can be slow. | 2899 string, or sexp. This variable is semi-obsolete; we recommend setting |
2900 @code{syntax-begin-function} instead. | |
2902 | 2901 |
2903 Specify this variable using @var{syntax-begin} in | 2902 Specify this variable using @var{syntax-begin} in |
2904 @code{font-lock-defaults}. | 2903 @code{font-lock-defaults}. |
2905 @end defvar | 2904 @end defvar |
2906 | 2905 |