aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.c
diff options
context:
space:
mode:
authorKenichi Handa2005-09-13 01:07:30 +0000
committerKenichi Handa2005-09-13 01:07:30 +0000
commitd008f7b7facd8851792d896be00d39ae1b1b2a5f (patch)
treec4ee11b14577b24d344a93df8af104ab87c2ce17 /src/composite.c
parentecab2fa2e426d35e74919e437a148db04040b1e4 (diff)
downloademacs-d008f7b7facd8851792d896be00d39ae1b1b2a5f.tar.gz
emacs-d008f7b7facd8851792d896be00d39ae1b1b2a5f.zip
(compose_chars_in_text): Delete it.
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c126
1 files changed, 0 insertions, 126 deletions
diff --git a/src/composite.c b/src/composite.c
index 02abb66e1e5..f03d5054c33 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -589,132 +589,6 @@ compose_text (start, end, components, modification_func, string)
589 Qcomposition, prop, string); 589 Qcomposition, prop, string);
590} 590}
591 591
592/* Compose sequences of characters in the region between START and END
593 by functions registered in Vcomposition_function_table. If STRING
594 is non-nil, operate on characters contained between indices START
595 and END in STRING. */
596
597void
598compose_chars_in_text (start, end, string)
599 int start, end;
600 Lisp_Object string;
601{
602 int count = 0;
603 struct gcpro gcpro1;
604 Lisp_Object tail, elt, val, to;
605 /* Set to nonzero if we don't have to compose ASCII characters. */
606 int skip_ascii;
607 int i, len, stop, c;
608 const unsigned char *ptr, *pend;
609
610 if (! CHAR_TABLE_P (Vcomposition_function_table))
611 return;
612
613 if (STRINGP (string))
614 {
615 count = SPECPDL_INDEX ();
616 GCPRO1 (string);
617 stop = end;
618 ptr = SDATA (string) + string_char_to_byte (string, start);
619 pend = SDATA (string) + SBYTES (string);
620 }
621 else
622 {
623 record_unwind_protect (save_excursion_restore, save_excursion_save ());
624 TEMP_SET_PT (start);
625 stop = (start < GPT && GPT < end ? GPT : end);
626 ptr = CHAR_POS_ADDR (start);
627 pend = CHAR_POS_ADDR (end);
628 }
629
630 /* Preserve the match data. */
631 record_unwind_save_match_data ();
632
633 /* If none of ASCII characters have composition functions, we can
634 skip them quickly. */
635 for (i = 0; i < 128; i++)
636 if (!NILP (CHAR_TABLE_REF (Vcomposition_function_table, i)))
637 break;
638 skip_ascii = (i == 128);
639
640
641 while (1)
642 {
643 if (skip_ascii)
644 while (start < stop && ASCII_BYTE_P (*ptr))
645 start++, ptr++;
646
647 if (start >= stop)
648 {
649 if (stop == end || start >= end)
650 break;
651 stop = end;
652 if (STRINGP (string))
653 ptr = SDATA (string) + string_char_to_byte (string, start);
654 else
655 ptr = CHAR_POS_ADDR (start);
656 }
657
658 c = STRING_CHAR_AND_LENGTH (ptr, pend - ptr, len);
659 tail = CHAR_TABLE_REF (Vcomposition_function_table, c);
660 while (CONSP (tail))
661 {
662 elt = XCAR (tail);
663 if (CONSP (elt)
664 && STRINGP (XCAR (elt))
665 && !NILP (Ffboundp (XCDR (elt))))
666 {
667 if (STRINGP (string))
668 val = Fstring_match (XCAR (elt), string, make_number (start));
669 else
670 {
671 val = Flooking_at (XCAR (elt));
672 if (!NILP (val))
673 val = make_number (start);
674 }
675 if (INTEGERP (val) && XFASTINT (val) == start)
676 {
677 to = Fmatch_end (make_number (0));
678 val = call4 (XCDR (elt), val, to, XCAR (elt), string);
679 if (INTEGERP (val) && XINT (val) > 1)
680 {
681 start += XINT (val);
682 if (STRINGP (string))
683 {
684 ptr = SDATA (string) + string_char_to_byte (string, start);
685 pend = SDATA (string) + SBYTES (string);
686 }
687 else
688 ptr = CHAR_POS_ADDR (start);
689 }
690 else if (STRINGP (string))
691 {
692 start++;
693 ptr = SDATA (string) + string_char_to_byte (string, start);
694 pend = SDATA (string) + SBYTES (string);
695 }
696 else
697 {
698 start++;
699 ptr += len;
700 }
701 break;
702 }
703 }
704 tail = XCDR (tail);
705 }
706 if (!CONSP (tail))
707 {
708 /* No composition done. Try the next character. */
709 start++;
710 ptr += len;
711 }
712 }
713
714 unbind_to (count, Qnil);
715 if (STRINGP (string))
716 UNGCPRO;
717}
718 592
719/* Emacs Lisp APIs. */ 593/* Emacs Lisp APIs. */
720 594