Mercurial > hg > xemacs-beta
comparison src/font-lock.c @ 1296:87084e8445a7
[xemacs-hg @ 2003-02-14 09:50:15 by ben]
syntax-table fixes
1. the updating of mirror tables every time a syntax table was modified
was taking up huge amounts of time so i added a dirty flag and made the
updating "just-in-time".
2. no-longer-used char-table-entries were not getting "freed", generating
tons of garbage.
3. syntax_match() was being incorrectly called on mirror tables in the
cache, not the original syntax table.
buffer.c, syntax.c: Move syntax table description from buffer.c to syntax.c.
chartab.c, chartab.h: Free extra char table entries to avoid excessive garbage.
Add flags for dirty and mirror_table_p to char tables.
Add a back pointer from mirror tables to the original syntax table.
When modifying a syntax table, don't update the mirror table right
away, just mark as dirty.
Add various asserts to make sure we are dealing with the right type
of table (mirror or non-mirror).
font-lock.c, syntax.c, syntax.h: Add entry to syntax caches for the non-mirror table. Set it
appropriately when initializing the syntax table. Use it, not
the mirror table, for calls to syntax_match().
Don't create a bogus float each time, just once at startup.
Add some asserts, as in chartab.c.
syntax.h: When retrieving the syntax code, check the dirty flag and update
the mirror tables as appropriate.
Add some asserts, as above.
author | ben |
---|---|
date | Fri, 14 Feb 2003 09:50:17 +0000 |
parents | 804517e16990 |
children | ecf1ebac70d8 |
comparison
equal
deleted
inserted
replaced
1295:064ef1d07d63 | 1296:87084e8445a7 |
---|---|
1 /* Routines to compute the current syntactic context, for font-lock mode. | 1 /* Routines to compute the current syntactic context, for font-lock mode. |
2 Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. | 2 Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Sun Microsystems, Inc. | 3 Copyright (C) 1995 Sun Microsystems, Inc. |
4 Copyright (C) 2002 Ben Wing. | 4 Copyright (C) 2002, 2003 Ben Wing. |
5 | 5 |
6 This file is part of XEmacs. | 6 This file is part of XEmacs. |
7 | 7 |
8 XEmacs is free software; you can redistribute it and/or modify it | 8 XEmacs is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | 9 under the terms of the GNU General Public License as published by the |
560 context_cache.scontext = '\000'; | 560 context_cache.scontext = '\000'; |
561 } | 561 } |
562 else if (context_cache.context == context_none) | 562 else if (context_cache.context == context_none) |
563 { | 563 { |
564 Lisp_Object stringtermobj = | 564 Lisp_Object stringtermobj = |
565 syntax_match (scache->current_syntax_table, c); | 565 syntax_match (scache->syntax_table, c); |
566 Ichar stringterm; | 566 Ichar stringterm; |
567 | 567 |
568 if (CHARP (stringtermobj)) | 568 if (CHARP (stringtermobj)) |
569 stringterm = XCHAR (stringtermobj); | 569 stringterm = XCHAR (stringtermobj); |
570 else | 570 else |