diff options
Diffstat (limited to 'src/fringe.c')
-rw-r--r-- | src/fringe.c | 91 |
1 files changed, 31 insertions, 60 deletions
diff --git a/src/fringe.c b/src/fringe.c index 2425e236b98..399779009dc 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -490,8 +490,7 @@ int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS; Return 0 if not a bitmap. */ int -lookup_fringe_bitmap (bitmap) - Lisp_Object bitmap; +lookup_fringe_bitmap (Lisp_Object bitmap) { int bn; @@ -517,8 +516,7 @@ lookup_fringe_bitmap (bitmap) Return BN if not found in Vfringe_bitmaps. */ static Lisp_Object -get_fringe_bitmap_name (bn) - int bn; +get_fringe_bitmap_name (int bn) { Lisp_Object bitmaps; Lisp_Object num; @@ -550,11 +548,7 @@ get_fringe_bitmap_name (bn) */ static void -draw_fringe_bitmap_1 (w, row, left_p, overlay, which) - struct window *w; - struct glyph_row *row; - int left_p, overlay; - int which; +draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int overlay, int which) { struct frame *f = XFRAME (WINDOW_FRAME (w)); struct draw_fringe_bitmap_params p; @@ -585,11 +579,10 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which) if (face_id == DEFAULT_FACE_ID) { - Lisp_Object face; - - if ((face = fringe_faces[which], NILP (face)) - || (face_id = lookup_derived_face (f, face, FRINGE_FACE_ID, 0), - face_id < 0)) + Lisp_Object face = fringe_faces[which]; + face_id = NILP (face) ? lookup_named_face (f, Qfringe, 0) + : lookup_derived_face (f, face, FRINGE_FACE_ID, 0); + if (face_id < 0) face_id = FRINGE_FACE_ID; } @@ -684,9 +677,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which) } static int -get_logical_cursor_bitmap (w, cursor) - struct window *w; - Lisp_Object cursor; +get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor) { Lisp_Object cmap, bm = Qnil; @@ -709,10 +700,7 @@ get_logical_cursor_bitmap (w, cursor) } static int -get_logical_fringe_bitmap (w, bitmap, right_p, partial_p) - struct window *w; - Lisp_Object bitmap; - int right_p, partial_p; +get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, int partial_p) { Lisp_Object cmap, bm1 = Qnil, bm2 = Qnil, bm; int ln1 = 0, ln2 = 0; @@ -812,14 +800,11 @@ get_logical_fringe_bitmap (w, bitmap, right_p, partial_p) void -draw_fringe_bitmap (w, row, left_p) - struct window *w; - struct glyph_row *row; - int left_p; +draw_fringe_bitmap (struct window *w, struct glyph_row *row, int left_p) { int overlay = 0; - if (!left_p && row->cursor_in_fringe_p) + if (left_p == row->reversed_p && row->cursor_in_fringe_p) { Lisp_Object cursor = Qnil; @@ -851,7 +836,7 @@ draw_fringe_bitmap (w, row, left_p) int bm = get_logical_cursor_bitmap (w, cursor); if (bm != NO_FRINGE_BITMAP) { - draw_fringe_bitmap_1 (w, row, 0, 2, bm); + draw_fringe_bitmap_1 (w, row, left_p, 2, bm); overlay = EQ (cursor, Qbox) ? 3 : 1; } } @@ -868,9 +853,7 @@ draw_fringe_bitmap (w, row, left_p) function with input blocked. */ void -draw_row_fringe_bitmaps (w, row) - struct window *w; - struct glyph_row *row; +draw_row_fringe_bitmaps (struct window *w, struct glyph_row *row) { xassert (interrupt_input_blocked); @@ -898,9 +881,7 @@ draw_row_fringe_bitmaps (w, row) */ int -draw_window_fringes (w, no_fringe) - struct window *w; - int no_fringe; +draw_window_fringes (struct window *w, int no_fringe) { struct glyph_row *row; int yb = window_text_bottom_y (w); @@ -938,9 +919,7 @@ draw_window_fringes (w, no_fringe) If KEEP_CURRENT_P is 0, update current_matrix too. */ int -update_window_fringes (w, keep_current_p) - struct window *w; - int keep_current_p; +update_window_fringes (struct window *w, int keep_current_p) { struct glyph_row *row, *cur = 0; int yb = window_text_bottom_y (w); @@ -1200,7 +1179,8 @@ update_window_fringes (w, keep_current_p) left = row->left_user_fringe_bitmap; left_face_id = row->left_user_fringe_face_id; } - else if (row->truncated_on_left_p) + else if ((!row->reversed_p && row->truncated_on_left_p) + || (row->reversed_p && row->truncated_on_right_p)) left = LEFT_FRINGE(0, Qtruncation, 0); else if (row->indicate_bob_p && EQ (boundary_top, Qleft)) { @@ -1243,7 +1223,8 @@ update_window_fringes (w, keep_current_p) right = row->right_user_fringe_bitmap; right_face_id = row->right_user_fringe_face_id; } - else if (row->truncated_on_right_p) + else if ((!row->reversed_p && row->truncated_on_right_p) + || (row->reversed_p && row->truncated_on_left_p)) right = RIGHT_FRINGE (0, Qtruncation, 0); else if (row->indicate_bob_p && EQ (boundary_top, Qright)) { @@ -1337,9 +1318,7 @@ update_window_fringes (w, keep_current_p) */ void -compute_fringe_widths (f, redraw) - struct frame *f; - int redraw; +compute_fringe_widths (struct frame *f, int redraw) { int o_left = FRAME_LEFT_FRINGE_WIDTH (f); int o_right = FRAME_RIGHT_FRINGE_WIDTH (f); @@ -1421,8 +1400,7 @@ compute_fringe_widths (f, redraw) /* Free resources used by a user-defined bitmap. */ void -destroy_fringe_bitmap (n) - int n; +destroy_fringe_bitmap (int n) { struct fringe_bitmap **fbp; @@ -1449,8 +1427,7 @@ DEFUN ("destroy-fringe-bitmap", Fdestroy_fringe_bitmap, Sdestroy_fringe_bitmap, 1, 1, 0, doc: /* Destroy fringe bitmap BITMAP. If BITMAP overrides a standard fringe bitmap, the original bitmap is restored. */) - (bitmap) - Lisp_Object bitmap; + (Lisp_Object bitmap) { int n; @@ -1491,10 +1468,7 @@ static const unsigned char swap_nibble[16] = { #endif /* HAVE_X_WINDOWS */ void -init_fringe_bitmap (which, fb, once_p) - int which; - struct fringe_bitmap *fb; - int once_p; +init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p) { if (once_p || fb->dynamic) { @@ -1564,8 +1538,7 @@ is used; the default is to center the bitmap. Fifth arg may also be a list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap should be repeated. If BITMAP already exists, the existing definition is replaced. */) - (bitmap, bits, height, width, align) - Lisp_Object bitmap, bits, height, width, align; + (Lisp_Object bitmap, Lisp_Object bits, Lisp_Object height, Lisp_Object width, Lisp_Object align) { int n, h, i, j; unsigned short *b; @@ -1669,7 +1642,7 @@ If BITMAP already exists, the existing definition is replaced. */) xfb = (struct fringe_bitmap *) xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW); fb.bits = b = (unsigned short *) (xfb + 1); - bzero (b, fb.height); + memset (b, 0, fb.height); j = 0; while (j < fb.height) @@ -1696,8 +1669,7 @@ DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_fac 1, 2, 0, doc: /* Set face for fringe bitmap BITMAP to FACE. If FACE is nil, reset face to default fringe face. */) - (bitmap, face) - Lisp_Object bitmap, face; + (Lisp_Object bitmap, Lisp_Object face) { int n; int face_id; @@ -1729,8 +1701,7 @@ is the symbol for the bitmap in the left fringe (or nil if no bitmap), RIGHT is similar for the right fringe, and OV is non-nil if there is an overlay arrow in the left fringe. Return nil if POS is not visible in WINDOW. */) - (pos, window) - Lisp_Object pos, window; + (Lisp_Object pos, Lisp_Object window) { struct window *w; struct glyph_row *row; @@ -1769,7 +1740,7 @@ Return nil if POS is not visible in WINDOW. */) ***********************************************************************/ void -syms_of_fringe () +syms_of_fringe (void) { Qtruncation = intern_c_string ("truncation"); staticpro (&Qtruncation); @@ -1806,7 +1777,7 @@ If nil, also continue lines which are exactly as wide as the window. */); /* Garbage collection hook */ void -mark_fringe_data () +mark_fringe_data (void) { int i; @@ -1818,7 +1789,7 @@ mark_fringe_data () /* Initialize this module when Emacs starts. */ void -init_fringe_once () +init_fringe_once (void) { int bt; @@ -1827,7 +1798,7 @@ init_fringe_once () } void -init_fringe () +init_fringe (void) { int i; |