[Bug: 21.5-b29] Syntactic font-lock confuses skip-syntax-forward

Marcus Harnisch marcus.harnisch at xemacs.org
Fri Apr 29 16:39:37 EDT 2011


After shaking out my initial issues when trying to debug XEmacs, I
observed that the syntax cache looked different, in both cases.

First of all, I have to correct myself, when I said "which uses
syntactic highlighting to locally modify the syntax-class of ?| (from ?$
to $w)". This last syntax code (or whatever it was) should have been
?_. So I changed the code of the vertical bar character from paired
delimiter (default in this mode) to symbol constituent.

,----[ search.h, 988-1007 ]
|     if (syntaxp)
|       {
| 	scache = setup_buffer_syntax_cache (buf, pos, forwardp ? 1 : -1);
| 	/* All syntax designators are normal chars so nothing strange
| 	   to worry about */
| 	if (forwardp)
| 	  {
| 	    if (pos < limit)
| 	      while (fastmap[(unsigned char)
| 			     syntax_code_spec
| 			     [(int) SYNTAX_FROM_CACHE
| 			      (scache, BYTE_BUF_FETCH_CHAR (buf, pos_byte))]])
| 		{
| 		  pos++;
| 		  INC_BYTEBPOS (buf, pos_byte);
| 		  if (pos >= limit)
| 		    break;
| 		  UPDATE_SYNTAX_CACHE_FORWARD (scache, pos);
| 		}
| 	  }
`----

In the case, where skip_chars() (called by #'s-s-f) would not work
correctly, scache contained this

,----[ wrong ]
| (gdb) p *scache
| $8 = {header = {type = 71, lisp_readonly = 0, free = 0, uid = 1102}, 
|   use_code = 1, no_syntax_table_prop = 0, object = 42788240, 
|   buffer = 0x28ce590, syntax_code = 3, syntax_table = 55533568, 
|   mirror_table = 55537664, start = 52909664, end = 52909712, 
|   next_change = 2436, prev_change = 1343}
`----

while after resetting the error state and re-executing the same code at
the same buffer position would have scache look like that:

,----[ right ]
| (gdb) p *scache
| $9 = {header = {type = 71, lisp_readonly = 0, free = 0, uid = 1102}, 
|   use_code = 0, no_syntax_table_prop = 1, object = 42788240, 
|   buffer = 0x28ce590, syntax_code = 3, syntax_table = 55533568, 
|   mirror_table = 55537664, start = 52909664, end = 52909712, 
|   next_change = 2436, prev_change = 1344}
`----

Notice the difference in the fields scache->use_code,
scache->no_syntax_table_prop, and scache->prev_change.

Does that ring a bell with anyone?

Thanks
-- 
Marcus

note that "property" can also be used as syntactic sugar to reference
a property, breaking the clean design of verilog; [...]

             (seen on http://www.veripool.com/verilog-mode_news.html)



More information about the XEmacs-Beta mailing list