diff options
| author | Gerd Moellmann | 2000-06-20 19:44:44 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-06-20 19:44:44 +0000 |
| commit | 06568bbfecf0917d68d8ca9cf4d8ba08c7f4cc52 (patch) | |
| tree | 7597c32514d0b1791f5bd9d20920fd0915f268f0 | |
| parent | 3e9ac4b71e3321bda20a5f7d3d90a30eff9ed62c (diff) | |
| download | emacs-06568bbfecf0917d68d8ca9cf4d8ba08c7f4cc52.tar.gz emacs-06568bbfecf0917d68d8ca9cf4d8ba08c7f4cc52.zip | |
(single_display_prop_intangible_p)
(display_prop_intangible_p): New functions.
| -rw-r--r-- | src/xdisp.c | 96 |
1 files changed, 91 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 4f0449383c6..1822e81f386 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -609,6 +609,7 @@ enum move_it_result | |||
| 609 | 609 | ||
| 610 | /* Function prototypes. */ | 610 | /* Function prototypes. */ |
| 611 | 611 | ||
| 612 | static int single_display_prop_intangible_p P_ ((Lisp_Object)); | ||
| 612 | static void ensure_echo_area_buffers P_ ((void)); | 613 | static void ensure_echo_area_buffers P_ ((void)); |
| 613 | static struct glyph_row *row_containing_pos P_ ((struct window *, int, | 614 | static struct glyph_row *row_containing_pos P_ ((struct window *, int, |
| 614 | struct glyph_row *, | 615 | struct glyph_row *, |
| @@ -2304,7 +2305,6 @@ handle_single_display_prop (it, prop, object, position) | |||
| 2304 | { | 2305 | { |
| 2305 | Lisp_Object value; | 2306 | Lisp_Object value; |
| 2306 | int space_or_image_found_p = 0; | 2307 | int space_or_image_found_p = 0; |
| 2307 | |||
| 2308 | Lisp_Object form; | 2308 | Lisp_Object form; |
| 2309 | 2309 | ||
| 2310 | /* If PROP is a list of the form `(when FORM . VALUE)', FORM is | 2310 | /* If PROP is a list of the form `(when FORM . VALUE)', FORM is |
| @@ -2561,6 +2561,77 @@ handle_single_display_prop (it, prop, object, position) | |||
| 2561 | } | 2561 | } |
| 2562 | 2562 | ||
| 2563 | 2563 | ||
| 2564 | /* Check if PROP is a display sub-property value whose text should be | ||
| 2565 | treated as intangible. */ | ||
| 2566 | |||
| 2567 | static int | ||
| 2568 | single_display_prop_intangible_p (prop) | ||
| 2569 | Lisp_Object prop; | ||
| 2570 | { | ||
| 2571 | /* Skip over `when FORM'. */ | ||
| 2572 | if (CONSP (prop) && EQ (XCAR (prop), Qwhen)) | ||
| 2573 | { | ||
| 2574 | prop = XCDR (prop); | ||
| 2575 | if (!CONSP (prop)) | ||
| 2576 | return 0; | ||
| 2577 | prop = XCDR (prop); | ||
| 2578 | } | ||
| 2579 | |||
| 2580 | if (!CONSP (prop)) | ||
| 2581 | return 0; | ||
| 2582 | |||
| 2583 | /* Skip over `margin LOCATION'. If LOCATION is in the margins, | ||
| 2584 | we don't need to treat text as intangible. */ | ||
| 2585 | if (EQ (XCAR (prop), Qmargin)) | ||
| 2586 | { | ||
| 2587 | prop = XCDR (prop); | ||
| 2588 | if (!CONSP (prop)) | ||
| 2589 | return 0; | ||
| 2590 | |||
| 2591 | prop = XCDR (prop); | ||
| 2592 | if (!CONSP (prop) | ||
| 2593 | || EQ (XCAR (prop), Qleft_margin) | ||
| 2594 | || EQ (XCAR (prop), Qright_margin)) | ||
| 2595 | return 0; | ||
| 2596 | } | ||
| 2597 | |||
| 2598 | return CONSP (prop) && EQ (XCAR (prop), Qimage); | ||
| 2599 | } | ||
| 2600 | |||
| 2601 | |||
| 2602 | /* Check if PROP is a display property value whose text should be | ||
| 2603 | treated as intangible. */ | ||
| 2604 | |||
| 2605 | int | ||
| 2606 | display_prop_intangible_p (prop) | ||
| 2607 | Lisp_Object prop; | ||
| 2608 | { | ||
| 2609 | if (CONSP (prop) | ||
| 2610 | && CONSP (XCAR (prop)) | ||
| 2611 | && !EQ (Qmargin, XCAR (XCAR (prop)))) | ||
| 2612 | { | ||
| 2613 | /* A list of sub-properties. */ | ||
| 2614 | while (CONSP (prop)) | ||
| 2615 | { | ||
| 2616 | if (single_display_prop_intangible_p (XCAR (prop))) | ||
| 2617 | return 1; | ||
| 2618 | prop = XCDR (prop); | ||
| 2619 | } | ||
| 2620 | } | ||
| 2621 | else if (VECTORP (prop)) | ||
| 2622 | { | ||
| 2623 | /* A vector of sub-properties. */ | ||
| 2624 | int i; | ||
| 2625 | for (i = 0; i < XVECTOR (prop)->size; ++i) | ||
| 2626 | if (single_display_prop_intangible_p (XVECTOR (prop)->contents[i])) | ||
| 2627 | return 1; | ||
| 2628 | } | ||
| 2629 | else | ||
| 2630 | return single_display_prop_intangible_p (prop); | ||
| 2631 | |||
| 2632 | return 0; | ||
| 2633 | } | ||
| 2634 | |||
| 2564 | 2635 | ||
| 2565 | /*********************************************************************** | 2636 | /*********************************************************************** |
| 2566 | `composition' property | 2637 | `composition' property |
| @@ -10650,7 +10721,7 @@ dump_glyph_row (matrix, vpos, with_glyphs_p) | |||
| 10650 | 10721 | ||
| 10651 | if (glyph < glyph_end) | 10722 | if (glyph < glyph_end) |
| 10652 | { | 10723 | { |
| 10653 | fprintf (stderr, " Glyph Type Pos W Code C Face LR\n"); | 10724 | fprintf (stderr, " Glyph Type Pos O W Code C Face LR\n"); |
| 10654 | prev_had_glyphs_p = 1; | 10725 | prev_had_glyphs_p = 1; |
| 10655 | } | 10726 | } |
| 10656 | else | 10727 | else |
| @@ -10661,10 +10732,15 @@ dump_glyph_row (matrix, vpos, with_glyphs_p) | |||
| 10661 | if (glyph->type == CHAR_GLYPH) | 10732 | if (glyph->type == CHAR_GLYPH) |
| 10662 | { | 10733 | { |
| 10663 | fprintf (stderr, | 10734 | fprintf (stderr, |
| 10664 | " %5d %4c %6d %3d 0x%05x %c %4d %1.1d%1.1d\n", | 10735 | " %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n", |
| 10665 | glyph - row->glyphs[TEXT_AREA], | 10736 | glyph - row->glyphs[TEXT_AREA], |
| 10666 | 'C', | 10737 | 'C', |
| 10667 | glyph->charpos, | 10738 | glyph->charpos, |
| 10739 | (BUFFERP (glyph->object) | ||
| 10740 | ? 'B' | ||
| 10741 | : (STRINGP (glyph->object) | ||
| 10742 | ? 'S' | ||
| 10743 | : '-')), | ||
| 10668 | glyph->pixel_width, | 10744 | glyph->pixel_width, |
| 10669 | glyph->u.ch, | 10745 | glyph->u.ch, |
| 10670 | (glyph->u.ch < 0x80 && glyph->u.ch >= ' ' | 10746 | (glyph->u.ch < 0x80 && glyph->u.ch >= ' ' |
| @@ -10677,10 +10753,15 @@ dump_glyph_row (matrix, vpos, with_glyphs_p) | |||
| 10677 | else if (glyph->type == STRETCH_GLYPH) | 10753 | else if (glyph->type == STRETCH_GLYPH) |
| 10678 | { | 10754 | { |
| 10679 | fprintf (stderr, | 10755 | fprintf (stderr, |
| 10680 | " %5d %4c %6d %3d 0x%05x %c %4d %1.1d%1.1d\n", | 10756 | " %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n", |
| 10681 | glyph - row->glyphs[TEXT_AREA], | 10757 | glyph - row->glyphs[TEXT_AREA], |
| 10682 | 'S', | 10758 | 'S', |
| 10683 | glyph->charpos, | 10759 | glyph->charpos, |
| 10760 | (BUFFERP (glyph->object) | ||
| 10761 | ? 'B' | ||
| 10762 | : (STRINGP (glyph->object) | ||
| 10763 | ? 'S' | ||
| 10764 | : '-')), | ||
| 10684 | glyph->pixel_width, | 10765 | glyph->pixel_width, |
| 10685 | 0, | 10766 | 0, |
| 10686 | '.', | 10767 | '.', |
| @@ -10691,10 +10772,15 @@ dump_glyph_row (matrix, vpos, with_glyphs_p) | |||
| 10691 | else if (glyph->type == IMAGE_GLYPH) | 10772 | else if (glyph->type == IMAGE_GLYPH) |
| 10692 | { | 10773 | { |
| 10693 | fprintf (stderr, | 10774 | fprintf (stderr, |
| 10694 | " %5d %4c %6d %3d 0x%05x %c %4d %1.1d%1.1d\n", | 10775 | " %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n", |
| 10695 | glyph - row->glyphs[TEXT_AREA], | 10776 | glyph - row->glyphs[TEXT_AREA], |
| 10696 | 'I', | 10777 | 'I', |
| 10697 | glyph->charpos, | 10778 | glyph->charpos, |
| 10779 | (BUFFERP (glyph->object) | ||
| 10780 | ? 'B' | ||
| 10781 | : (STRINGP (glyph->object) | ||
| 10782 | ? 'S' | ||
| 10783 | : '-')), | ||
| 10698 | glyph->pixel_width, | 10784 | glyph->pixel_width, |
| 10699 | glyph->u.img_id, | 10785 | glyph->u.img_id, |
| 10700 | '.', | 10786 | '.', |