diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 43dc440ae74..12756206a65 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -32,7 +32,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 32 | #include "dispextern.h" | 32 | #include "dispextern.h" |
| 33 | #include "frame.h" | 33 | #include "frame.h" |
| 34 | #include "blockinput.h" | 34 | #include "blockinput.h" |
| 35 | /* #include "window.h" */ | 35 | #include "window.h" |
| 36 | 36 | ||
| 37 | /* Display Context for the icons */ | 37 | /* Display Context for the icons */ |
| 38 | #include <X11/Intrinsic.h> | 38 | #include <X11/Intrinsic.h> |
| @@ -519,9 +519,9 @@ free_frame_faces (f) | |||
| 519 | /* Find a match for NEW_FACE in a FRAME's face array, and add it if we don't | 519 | /* Find a match for NEW_FACE in a FRAME's face array, and add it if we don't |
| 520 | find one. */ | 520 | find one. */ |
| 521 | int | 521 | int |
| 522 | intern_frame_face (new_face, frame) | 522 | intern_frame_face (frame, new_face) |
| 523 | struct face *new_face; | ||
| 524 | struct frame *frame; | 523 | struct frame *frame; |
| 524 | struct face *new_face; | ||
| 525 | { | 525 | { |
| 526 | int len = FRAME_N_FACES (frame); | 526 | int len = FRAME_N_FACES (frame); |
| 527 | int i; | 527 | int i; |
| @@ -626,11 +626,10 @@ compute_char_face (f, w, pos, endptr) | |||
| 626 | int *endptr; | 626 | int *endptr; |
| 627 | { | 627 | { |
| 628 | struct face face; | 628 | struct face face; |
| 629 | Lisp_Object prop, position, length; | 629 | Lisp_Object prop, position; |
| 630 | Lisp_Object overlay, start, end; | ||
| 631 | int i, j, noverlays; | 630 | int i, j, noverlays; |
| 632 | int facecode; | 631 | int facecode; |
| 633 | int endpos; | 632 | int endpos = BUF_ZV (XBUFFER (w->buffer)); |
| 634 | Lisp_Object *overlay_vec; | 633 | Lisp_Object *overlay_vec; |
| 635 | int len; | 634 | int len; |
| 636 | struct sortvec *sortvec; | 635 | struct sortvec *sortvec; |
| @@ -639,11 +638,26 @@ compute_char_face (f, w, pos, endptr) | |||
| 639 | XSET (frame, Lisp_Frame, f); | 638 | XSET (frame, Lisp_Frame, f); |
| 640 | 639 | ||
| 641 | XFASTINT (position) = pos; | 640 | XFASTINT (position) = pos; |
| 642 | prop = Fget_text_property (position, Qface); | 641 | prop = Fget_text_property (position, Qface, w->buffer); |
| 642 | { | ||
| 643 | Lisp_Object end; | ||
| 643 | 644 | ||
| 644 | len = 10; | 645 | end = Fnext_single_property_change (position, Qface, w->buffer); |
| 645 | overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); | 646 | if (INTEGERP (end)) |
| 646 | noverlays = overlays_at (pos, &overlay_vec, &len, &endpos); | 647 | endpos = XINT (end); |
| 648 | } | ||
| 649 | |||
| 650 | { | ||
| 651 | int end; | ||
| 652 | |||
| 653 | len = 10; | ||
| 654 | overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); | ||
| 655 | noverlays = overlays_at (pos, &overlay_vec, &len, &end); | ||
| 656 | if (end < endpos) | ||
| 657 | endpos = end; | ||
| 658 | } | ||
| 659 | |||
| 660 | *endptr = endpos; | ||
| 647 | 661 | ||
| 648 | /* Optimize the default case. */ | 662 | /* Optimize the default case. */ |
| 649 | if (noverlays == 0 && NILP (prop)) | 663 | if (noverlays == 0 && NILP (prop)) |
| @@ -664,7 +678,7 @@ compute_char_face (f, w, pos, endptr) | |||
| 664 | 678 | ||
| 665 | for (i = 0, j = 0; i < noverlays; i++) | 679 | for (i = 0, j = 0; i < noverlays; i++) |
| 666 | { | 680 | { |
| 667 | overlay = overlay_vec[i]; | 681 | Lisp_Object overlay = overlay_vec[i]; |
| 668 | 682 | ||
| 669 | if (OVERLAY_VALID (overlay) | 683 | if (OVERLAY_VALID (overlay) |
| 670 | && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0 | 684 | && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0 |
| @@ -810,6 +824,9 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal, | |||
| 810 | if (id < 0 || id >= next_face_id) | 824 | if (id < 0 || id >= next_face_id) |
| 811 | error ("Face id out of range"); | 825 | error ("Face id out of range"); |
| 812 | 826 | ||
| 827 | if (! FRAME_X_P (f)) | ||
| 828 | return; | ||
| 829 | |||
| 813 | ensure_face_ready (f, id); | 830 | ensure_face_ready (f, id); |
| 814 | face = FRAME_FACES (f) [XFASTINT (face_id)]; | 831 | face = FRAME_FACES (f) [XFASTINT (face_id)]; |
| 815 | 832 | ||
| @@ -894,6 +911,8 @@ face_name_id_number (frame, name) | |||
| 894 | 911 | ||
| 895 | CHECK_FRAME (frame, 0); | 912 | CHECK_FRAME (frame, 0); |
| 896 | tem = Fcdr (Fassq (name, XFRAME (frame)->face_alist)); | 913 | tem = Fcdr (Fassq (name, XFRAME (frame)->face_alist)); |
| 914 | if (NILP (tem)) | ||
| 915 | return 0; | ||
| 897 | CHECK_VECTOR (tem, 0); | 916 | CHECK_VECTOR (tem, 0); |
| 898 | tem = XVECTOR (tem)->contents[2]; | 917 | tem = XVECTOR (tem)->contents[2]; |
| 899 | CHECK_NUMBER (tem, 0); | 918 | CHECK_NUMBER (tem, 0); |