diff options
| author | Karoly Lorentey | 2006-04-28 14:48:18 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-04-28 14:48:18 +0000 |
| commit | b33c71f58623306001d4d4fe4f7354d8c360edaa (patch) | |
| tree | 3bcc8154133fcb19081850754bb725f38f86b56f /lispref | |
| parent | 717a00ef34c0f55bfbad80584f00d86c090d547f (diff) | |
| parent | a48b489eb94a238c1eca6a0c4bdf7d5b80503240 (diff) | |
| download | emacs-b33c71f58623306001d4d4fe4f7354d8c360edaa.tar.gz emacs-b33c71f58623306001d4d4fe4f7354d8c360edaa.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-234
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-235
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-236
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-237
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-238
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-239
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-240
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-241
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-242
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-243
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-244
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-245
(Ffield_beginning, find_field): Undo change of 2006-04-23.
* emacs@sv.gnu.org/emacs--devo--0--patch-246
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-247
Rcirc patch from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-248
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-249
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-250
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-251
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-87
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-88
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-89
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-90
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-91
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-92
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-93
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-94
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-95
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-553
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | lispref/modes.texi | 129 | ||||
| -rw-r--r-- | lispref/syntax.texi | 4 |
3 files changed, 95 insertions, 42 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 48205488ef8..ac6bd07a175 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-04-26 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * syntax.texi (Parsing Expressions): Minor cleanup. | ||
| 4 | |||
| 1 | 2006-04-18 Richard Stallman <rms@gnu.org> | 5 | 2006-04-18 Richard Stallman <rms@gnu.org> |
| 2 | 6 | ||
| 3 | * tips.texi (Coding Conventions): Explain when the package's | 7 | * tips.texi (Coding Conventions): Explain when the package's |
diff --git a/lispref/modes.texi b/lispref/modes.texi index b33424a58be..3f56179231c 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -2336,8 +2336,6 @@ Search-based fontification happens second. | |||
| 2336 | * Font Lock Basics:: Overview of customizing Font Lock. | 2336 | * Font Lock Basics:: Overview of customizing Font Lock. |
| 2337 | * Search-based Fontification:: Fontification based on regexps. | 2337 | * Search-based Fontification:: Fontification based on regexps. |
| 2338 | * Customizing Keywords:: Customizing search-based fontification. | 2338 | * Customizing Keywords:: Customizing search-based fontification. |
| 2339 | * Region to Fontify:: Controlling which region gets refontified | ||
| 2340 | after a buffer change. | ||
| 2341 | * Other Font Lock Variables:: Additional customization facilities. | 2339 | * Other Font Lock Variables:: Additional customization facilities. |
| 2342 | * Levels of Font Lock:: Each mode can define alternative levels | 2340 | * Levels of Font Lock:: Each mode can define alternative levels |
| 2343 | so that the user can select more or less. | 2341 | so that the user can select more or less. |
| @@ -2347,6 +2345,8 @@ Search-based fontification happens second. | |||
| 2347 | * Syntactic Font Lock:: Fontification based on syntax tables. | 2345 | * Syntactic Font Lock:: Fontification based on syntax tables. |
| 2348 | * Setting Syntax Properties:: Defining character syntax based on context | 2346 | * Setting Syntax Properties:: Defining character syntax based on context |
| 2349 | using the Font Lock mechanism. | 2347 | using the Font Lock mechanism. |
| 2348 | * Multi line Font Lock Elements:: How to coerce Font Lock into properly | ||
| 2349 | highlighting multiline elements. | ||
| 2350 | @end menu | 2350 | @end menu |
| 2351 | 2351 | ||
| 2352 | @node Font Lock Basics | 2352 | @node Font Lock Basics |
| @@ -2623,16 +2623,9 @@ this value of @code{font-lock-keywords} is used in a buffer. | |||
| 2623 | Its value should have one of the forms described in this table. | 2623 | Its value should have one of the forms described in this table. |
| 2624 | @end table | 2624 | @end table |
| 2625 | 2625 | ||
| 2626 | @vindex font-lock-multiline | ||
| 2627 | @strong{Warning:} Do not design an element of @code{font-lock-keywords} | 2626 | @strong{Warning:} Do not design an element of @code{font-lock-keywords} |
| 2628 | to match text which spans lines; this does not work reliably. While | 2627 | to match text which spans lines; this does not work reliably. |
| 2629 | @code{font-lock-fontify-buffer} handles multi-line patterns correctly, | 2628 | For details, see @xref{Multi line Font Lock Elements}. |
| 2630 | updating when you edit the buffer does not, since it considers text one | ||
| 2631 | line at a time. If you have patterns that typically only span one | ||
| 2632 | line but can occasionally span two or three, such as | ||
| 2633 | @samp{<title>...</title>}, you can ask Font Lock to be more careful by | ||
| 2634 | setting @code{font-lock-multiline} to @code{t}. But it still will not | ||
| 2635 | work in all cases. | ||
| 2636 | 2629 | ||
| 2637 | You can use @var{case-fold} in @code{font-lock-defaults} to specify | 2630 | You can use @var{case-fold} in @code{font-lock-defaults} to specify |
| 2638 | the value of @code{font-lock-keywords-case-fold-search} which says | 2631 | the value of @code{font-lock-keywords-case-fold-search} which says |
| @@ -2718,36 +2711,6 @@ C mode @emph{and} all modes derived from it, do this instead: | |||
| 2718 | font-lock-keyword-face))))) | 2711 | font-lock-keyword-face))))) |
| 2719 | @end smallexample | 2712 | @end smallexample |
| 2720 | 2713 | ||
| 2721 | @node Region to Fontify | ||
| 2722 | @subsection Region to Fontify after a Buffer Change | ||
| 2723 | |||
| 2724 | When a buffer is changed, the region that Font Lock refontifies is by | ||
| 2725 | default the smallest sequence of whole lines that spans the change. | ||
| 2726 | While this works well most of the time, sometimes it doesn't---for | ||
| 2727 | example, when a buffer change has changed the syntactic meaning of text | ||
| 2728 | on an earlier line. | ||
| 2729 | |||
| 2730 | You can enlarge (or even reduce) the region to fontify by setting either | ||
| 2731 | of the following variables: | ||
| 2732 | |||
| 2733 | @defvar font-lock-extend-region-function | ||
| 2734 | This buffer-local variable is either @code{nil} or is a function that | ||
| 2735 | determines the region to fontify, which Emacs then calls after each | ||
| 2736 | buffer change. | ||
| 2737 | |||
| 2738 | The function is given three parameters, the standard @var{beg}, | ||
| 2739 | @var{end}, and @var{old-len} from after-change-functions (@pxref{Change | ||
| 2740 | Hooks}). It should return either a cons of the beginning and end buffer | ||
| 2741 | positions (in that order) of the region to fontify, or @code{nil} (which | ||
| 2742 | directs the caller to fontify the default region). This function need | ||
| 2743 | not preserve point or the match-data, but must preserve the current | ||
| 2744 | restriction. The region it returns may start or end in the middle of a | ||
| 2745 | line. | ||
| 2746 | |||
| 2747 | Since this function is called after every buffer change, it should be | ||
| 2748 | reasonably fast. | ||
| 2749 | @end defvar | ||
| 2750 | |||
| 2751 | @node Other Font Lock Variables | 2714 | @node Other Font Lock Variables |
| 2752 | @subsection Other Font Lock Variables | 2715 | @subsection Other Font Lock Variables |
| 2753 | 2716 | ||
| @@ -3052,6 +3015,90 @@ Major modes normally set this variable with @var{other-vars} in | |||
| 3052 | @code{font-lock-defaults}. | 3015 | @code{font-lock-defaults}. |
| 3053 | @end defvar | 3016 | @end defvar |
| 3054 | 3017 | ||
| 3018 | @node Multi line Font Lock Elements | ||
| 3019 | @subsection Multi line Font Lock Elements | ||
| 3020 | @cindex multi line font lock | ||
| 3021 | |||
| 3022 | Normally, Font Lock elements specified via @code{font-lock-keywords} | ||
| 3023 | should not match across multiple lines. If they do, Font Lock may | ||
| 3024 | fail to highlight them properly. This is fundamentally due to the | ||
| 3025 | fact that Font Lock does not always look at the whole buffer at | ||
| 3026 | a time, for obvious performance reasons, and instead only looks | ||
| 3027 | at a small chunk at a time. In order for the highlight to be correct, | ||
| 3028 | a chunk should not straddle an element matched by | ||
| 3029 | @code{font-lock-keywords}. The default heuristic used for this is to | ||
| 3030 | start and end chunks at the beginning resp. end of a line. | ||
| 3031 | |||
| 3032 | To work around this limitations, a few tools are provided. | ||
| 3033 | |||
| 3034 | @menu | ||
| 3035 | * Font Lock Multiline:: Marking multiline chunks with a text property | ||
| 3036 | * Region to Fontify:: Controlling which region gets refontified | ||
| 3037 | after a buffer change. | ||
| 3038 | @end menu | ||
| 3039 | |||
| 3040 | @node Font Lock Multiline | ||
| 3041 | @subsubsection Font Lock Multiline | ||
| 3042 | |||
| 3043 | In order to make it possible to properly highlight elements that span | ||
| 3044 | multiple lines, Font Lock obeys a special text property | ||
| 3045 | @code{font-lock-multiline} which if non-@code{nil} indicates that this | ||
| 3046 | piece of text is part of a multiline construct. So when Font Lock is | ||
| 3047 | asked to highlight a region, it first verifies the two boundaries and | ||
| 3048 | extends them as needed so they do not fall in the middle of a piece of | ||
| 3049 | text marked with the @code{font-lock-multiline} property. | ||
| 3050 | Immediately after that, it also erases all @code{font-lock-multiline} | ||
| 3051 | properties from the region it is about to highlight, so it is the | ||
| 3052 | responsability of the highlighting specification (mostly | ||
| 3053 | @code{font-lock-keywords}) to make sure that this property is re-added | ||
| 3054 | where needed so as to inform the next round of Font Locking of the | ||
| 3055 | presence of a multiline construct. | ||
| 3056 | |||
| 3057 | It is important to understand that the @code{font-lock-multiline} | ||
| 3058 | property should preferably only be used on Font Lock elements of | ||
| 3059 | moderate size: every time that text is modified within the multiline | ||
| 3060 | elements (or nearby), the whole multiline element will be completely | ||
| 3061 | re-highlighted, so if its size is large, the time to font-lock may | ||
| 3062 | render editing painfully slow. | ||
| 3063 | |||
| 3064 | @defvar font-lock-multiline | ||
| 3065 | If the @code{font-lock-multiline} variable is set to @code{t}, Font | ||
| 3066 | Lock will try to automatically add the @code{font-lock-multiline} | ||
| 3067 | property on the keywords that span several lines. This is no silver | ||
| 3068 | bullet however since it slows down Font Lock somewhat, and still does | ||
| 3069 | not always find all multiline constructs, especially when used with | ||
| 3070 | Jit Lock, which is enabled by default. | ||
| 3071 | @end defvar | ||
| 3072 | |||
| 3073 | @node Region to Fontify | ||
| 3074 | @subsubsection Region to Fontify after a Buffer Change | ||
| 3075 | |||
| 3076 | When a buffer is changed, the region that Font Lock refontifies is by | ||
| 3077 | default the smallest sequence of whole lines that spans the change. | ||
| 3078 | While this works well most of the time, sometimes it doesn't---for | ||
| 3079 | example, when a buffer change has changed the syntactic meaning of text | ||
| 3080 | on an earlier line. | ||
| 3081 | |||
| 3082 | You can enlarge (or even reduce) the region to fontify by setting @c either of | ||
| 3083 | the following variables: | ||
| 3084 | |||
| 3085 | @defvar font-lock-extend-region-function | ||
| 3086 | This buffer-local variable is either @code{nil} or is a function that | ||
| 3087 | determines the region to fontify, which Emacs then calls after each | ||
| 3088 | buffer change. | ||
| 3089 | |||
| 3090 | The function is given three parameters, the standard @var{beg}, | ||
| 3091 | @var{end}, and @var{old-len} from after-change-functions (@pxref{Change | ||
| 3092 | Hooks}). It should return either a cons of the beginning and end buffer | ||
| 3093 | positions (in that order) of the region to fontify, or @code{nil} (which | ||
| 3094 | directs the caller to fontify the default region). This function needs | ||
| 3095 | to preserve point, the match-data, and the current restriction. | ||
| 3096 | The region it returns may start or end in the middle of a line. | ||
| 3097 | |||
| 3098 | Since this function is called after every buffer change, it should be | ||
| 3099 | reasonably fast. | ||
| 3100 | @end defvar | ||
| 3101 | |||
| 3055 | @node Desktop Save Mode | 3102 | @node Desktop Save Mode |
| 3056 | @section Desktop Save Mode | 3103 | @section Desktop Save Mode |
| 3057 | @cindex desktop save mode | 3104 | @cindex desktop save mode |
diff --git a/lispref/syntax.texi b/lispref/syntax.texi index 7297f6b9104..1575ebeb850 100644 --- a/lispref/syntax.texi +++ b/lispref/syntax.texi | |||
| @@ -672,7 +672,9 @@ the parse: | |||
| 672 | 672 | ||
| 673 | @enumerate 0 | 673 | @enumerate 0 |
| 674 | @item | 674 | @item |
| 675 | The depth in parentheses, counting from 0. | 675 | The depth in parentheses, counting from 0. @strong{Warning:} this can |
| 676 | be negative if there are more close parens than open parens between | ||
| 677 | the start of the defun and point. | ||
| 676 | 678 | ||
| 677 | @item | 679 | @item |
| 678 | @cindex innermost containing parentheses | 680 | @cindex innermost containing parentheses |