comparison src/font-lock.c @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents 3d6bfa290dbd
children 7df0dd720c89
comparison
equal deleted inserted replaced
271:c7b7086b0a39 272:c5d627a313b1
430 for (; pt < target; pt++, context_cache.cur_point = pt) 430 for (; pt < target; pt++, context_cache.cur_point = pt)
431 { 431 {
432 if (context_cache.needs_its_head_reexamined) 432 if (context_cache.needs_its_head_reexamined)
433 { 433 {
434 if (context_cache.depth == 0 434 if (context_cache.depth == 0
435 && context_cache.context == ccontext_none) 435 && context_cache.context == context_none)
436 { 436 {
437 /* We've found an anchor spot. 437 /* We've found an anchor spot.
438 Try to put the start of defun within 6000 chars of 438 Try to put the start of defun within 6000 chars of
439 the target, and the end of defun as close as possible. 439 the target, and the end of defun as close as possible.
440 6000 is also arbitrary but tries to strike a balance 440 6000 is also arbitrary but tries to strike a balance
626 static Lisp_Object 626 static Lisp_Object
627 context_to_symbol (enum syntactic_context context) 627 context_to_symbol (enum syntactic_context context)
628 { 628 {
629 switch (context) 629 switch (context)
630 { 630 {
631 case context_none: return (Qnil); 631 case context_none: return Qnil;
632 case context_string: return (Qstring); 632 case context_string: return Qstring;
633 case context_comment: return (Qcomment); 633 case context_comment: return Qcomment;
634 case context_block_comment: return (Qblock_comment); 634 case context_block_comment: return Qblock_comment;
635 default: abort (); 635 default: abort (); return Qnil; /* suppress compiler warning */
636 } 636 }
637 return Qnil; /* suppress compiler warning */
638 } 637 }
639 638
640 DEFUN ("buffer-syntactic-context", Fbuffer_syntactic_context, 0, 1, 0, /* 639 DEFUN ("buffer-syntactic-context", Fbuffer_syntactic_context, 0, 1, 0, /*
641 Return the syntactic context of BUFFER at point. 640 Return the syntactic context of BUFFER at point.
642 If BUFFER is nil or omitted, the current buffer is assumed. 641 If BUFFER is nil or omitted, the current buffer is assumed.
676 return make_int (context_cache.depth); 675 return make_int (context_cache.depth);
677 } 676 }
678 677
679 678
680 DEFUN ("syntactically-sectionize", Fsyntactically_sectionize, 3, 4, 0, /* 679 DEFUN ("syntactically-sectionize", Fsyntactically_sectionize, 3, 4, 0, /*
681 Calls FUNCTION for each contiguous syntactic context in the region. 680 Call FUNCTION for each contiguous syntactic context in the region.
682 Calls the given function with four arguments: the start and end of the 681 Call the given function with four arguments: the start and end of the
683 region, a symbol representing the syntactic context, and the current 682 region, a symbol representing the syntactic context, and the current
684 depth (as returned by the functions `buffer-syntactic-context' and 683 depth (as returned by the functions `buffer-syntactic-context' and
685 `buffer-syntactic-context-depth'). When this function is called, the 684 `buffer-syntactic-context-depth'). When this function is called, the
686 current buffer will be set to BUFFER. 685 current buffer will be set to BUFFER.
687 686
770 } 769 }
771 770
772 void 771 void
773 vars_of_font_lock (void) 772 vars_of_font_lock (void)
774 { 773 {
775 memset (&context_cache, 0, sizeof (context_cache)); 774 xzero (context_cache);
776 memset (&bol_context_cache, 0, sizeof (bol_context_cache)); 775 xzero (bol_context_cache);
777 } 776 }