comparison src/font-lock.c @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 0293115a14e9
children 131b0175ea99
comparison
equal deleted inserted replaced
19:ac1f612d5250 20:859a2309aef8
633 default: abort (); 633 default: abort ();
634 } 634 }
635 return Qnil; /* suppress compiler warning */ 635 return Qnil; /* suppress compiler warning */
636 } 636 }
637 637
638 DEFUN ("buffer-syntactic-context", Fbuffer_syntactic_context, 638 DEFUN ("buffer-syntactic-context", Fbuffer_syntactic_context, 0, 1, 0, /*
639 Sbuffer_syntactic_context, 0, 1, 0 /*
640 Return the syntactic context of BUFFER at point. 639 Return the syntactic context of BUFFER at point.
641 If BUFFER is nil or omitted, the current buffer is assumed. 640 If BUFFER is nil or omitted, the current buffer is assumed.
642 The returned value is one of the following symbols: 641 The returned value is one of the following symbols:
643 642
644 nil ; meaning no special interpretation 643 nil ; meaning no special interpretation
650 the current nesting-depth within all parenthesis-syntax delimiters 649 the current nesting-depth within all parenthesis-syntax delimiters
651 and the function `syntactically-sectionize', which will map a function 650 and the function `syntactically-sectionize', which will map a function
652 over each syntactic context in a region. 651 over each syntactic context in a region.
653 652
654 WARNING: this may alter match-data. 653 WARNING: this may alter match-data.
655 */ ) 654 */
656 (buffer) 655 (buffer))
657 Lisp_Object buffer;
658 { 656 {
659 /* This function can GC */ 657 /* This function can GC */
660 struct buffer *buf = decode_buffer (buffer, 0); 658 struct buffer *buf = decode_buffer (buffer, 0);
661 find_context (buf, BUF_PT (buf)); 659 find_context (buf, BUF_PT (buf));
662 return context_to_symbol (context_cache.context); 660 return context_to_symbol (context_cache.context);
663 } 661 }
664 662
665 DEFUN ("buffer-syntactic-context-depth", Fbuffer_syntactic_context_depth, 663 DEFUN ("buffer-syntactic-context-depth",
666 Sbuffer_syntactic_context_depth, 0, 1, 0 /* 664 Fbuffer_syntactic_context_depth, 0, 1, 0, /*
667 Return the depth within all parenthesis-syntax delimiters at point. 665 Return the depth within all parenthesis-syntax delimiters at point.
668 If BUFFER is nil or omitted, the current buffer is assumed. 666 If BUFFER is nil or omitted, the current buffer is assumed.
669 WARNING: this may alter match-data. 667 WARNING: this may alter match-data.
670 */ ) 668 */
671 (buffer) 669 (buffer))
672 Lisp_Object buffer;
673 { 670 {
674 /* This function can GC */ 671 /* This function can GC */
675 struct buffer *buf = decode_buffer (buffer, 0); 672 struct buffer *buf = decode_buffer (buffer, 0);
676 find_context (buf, BUF_PT (buf)); 673 find_context (buf, BUF_PT (buf));
677 return make_int (context_cache.depth); 674 return make_int (context_cache.depth);
678 } 675 }
679 676
680 677
681 DEFUN ("syntactically-sectionize", Fsyntactically_sectionize, 678 DEFUN ("syntactically-sectionize", Fsyntactically_sectionize, 3, 4, 0, /*
682 Ssyntactically_sectionize, 3, 4, 0 /*
683 Calls FUNCTION for each contiguous syntactic context in the region. 679 Calls FUNCTION for each contiguous syntactic context in the region.
684 Calls the given function with four arguments: the start and end of the 680 Calls the given function with four arguments: the start and end of the
685 region, a symbol representing the syntactic context, and the current 681 region, a symbol representing the syntactic context, and the current
686 depth (as returned by the functions `buffer-syntactic-context' and 682 depth (as returned by the functions `buffer-syntactic-context' and
687 `buffer-syntactic-context-depth'). When this function is called, the 683 `buffer-syntactic-context-depth'). When this function is called, the
688 current buffer will be set to BUFFER. 684 current buffer will be set to BUFFER.
689 685
690 WARNING: this may alter match-data. 686 WARNING: this may alter match-data.
691 */ ) 687 */
692 (function, start, end, buffer) 688 (function, start, end, buffer))
693 Lisp_Object function, start, end, buffer;
694 { 689 {
695 /* This function can GC */ 690 /* This function can GC */
696 Bufpos s, pt, e; 691 Bufpos s, pt, e;
697 int edepth; 692 int edepth;
698 enum syntactic_context this_context; 693 enum syntactic_context this_context;
765 { 760 {
766 defsymbol (&Qcomment, "comment"); 761 defsymbol (&Qcomment, "comment");
767 defsymbol (&Qblock_comment, "block-comment"); 762 defsymbol (&Qblock_comment, "block-comment");
768 defsymbol (&Qbeginning_of_defun, "beginning-of-defun"); 763 defsymbol (&Qbeginning_of_defun, "beginning-of-defun");
769 764
770 defsubr (&Sbuffer_syntactic_context); 765 DEFSUBR (Fbuffer_syntactic_context);
771 defsubr (&Sbuffer_syntactic_context_depth); 766 DEFSUBR (Fbuffer_syntactic_context_depth);
772 defsubr (&Ssyntactically_sectionize); 767 DEFSUBR (Fsyntactically_sectionize);
773 } 768 }
774 769
775 void 770 void
776 vars_of_font_lock (void) 771 vars_of_font_lock (void)
777 { 772 {