/[emacs]/emacs/src/fringe.c
ViewVC logotype

Diff of /emacs/src/fringe.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by kfstorm, Mon Mar 1 23:56:44 2004 UTC revision 1.11 by kfstorm, Mon Sep 27 13:28:23 2004 UTC
# Line 32  Boston, MA 02111-1307, USA.  */ Line 32  Boston, MA 02111-1307, USA.  */
32  #ifdef HAVE_WINDOW_SYSTEM  #ifdef HAVE_WINDOW_SYSTEM
33    
34  extern Lisp_Object Qtop, Qbottom, Qcenter;  extern Lisp_Object Qtop, Qbottom, Qcenter;
35    extern Lisp_Object Qup, Qdown, Qleft, Qright;
36    
37  /* Non-nil means that newline may flow into the right fringe.  */  /* Non-nil means that newline may flow into the right fringe.  */
38    
# Line 706  update_window_fringes (w, force_p) Line 707  update_window_fringes (w, force_p)
707    int rn, nrows = w->current_matrix->nrows;    int rn, nrows = w->current_matrix->nrows;
708    int y;    int y;
709    int redraw_p = 0;    int redraw_p = 0;
710    Lisp_Object ind;    Lisp_Object boundary_top = Qnil, boundary_bot = Qnil;
711    int boundary_pos = 0, arrow_pos = 0;    Lisp_Object arrow_top = Qnil, arrow_bot = Qnil;
712    int empty_pos = 0;    Lisp_Object empty_pos;
713      Lisp_Object ind = Qnil;
714    
715    if (w->pseudo_window_p)    if (w->pseudo_window_p)
716      return 0;      return 0;
# Line 716  update_window_fringes (w, force_p) Line 718  update_window_fringes (w, force_p)
718    if (!MINI_WINDOW_P (w)    if (!MINI_WINDOW_P (w)
719        && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind)))        && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind)))
720      {      {
721        int do_eob = 1, do_bob = 1;        if (EQ (ind, Qleft) || EQ (ind, Qright))
722        Lisp_Object arrows;          boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
723          else if (CONSP (ind) && CONSP (XCAR (ind)))
724        if (CONSP (ind))          {
725          arrows = XCDR (ind), ind = XCAR (ind);            Lisp_Object pos;
726              if (pos = Fassq (Qt, ind), !NILP (pos))
727                boundary_top = boundary_bot = arrow_top = arrow_bot = XCDR (pos);
728              if (pos = Fassq (Qtop, ind), !NILP (pos))
729                boundary_top = XCDR (pos);
730              if (pos = Fassq (Qbottom, ind), !NILP (pos))
731                boundary_bot = XCDR (pos);
732              if (pos = Fassq (Qup, ind), !NILP (pos))
733                arrow_top = XCDR (pos);
734              if (pos = Fassq (Qdown, ind), !NILP (pos))
735                arrow_bot = XCDR (pos);
736            }
737        else        else
738          arrows = ind;          ind = Qnil;
739        }
740    
741        if (EQ (ind, Qleft))    if (!NILP (ind))
742          boundary_pos = -1;      {
743        else if (EQ (ind, Qright))        int do_eob = 1, do_bob = 1;
         boundary_pos = 1;  
   
       if (EQ (arrows, Qleft))  
         arrow_pos = -1;  
       else if (EQ (arrows, Qright))  
         arrow_pos = 1;  
744    
745        for (y = 0, rn = 0;        for (y = 0, rn = 0;
746             y < yb && rn < nrows;             y < yb && rn < nrows;
# Line 753  update_window_fringes (w, force_p) Line 761  update_window_fringes (w, force_p)
761            row->indicate_bob_p = row->indicate_top_line_p = 0;            row->indicate_bob_p = row->indicate_top_line_p = 0;
762            row->indicate_eob_p = row->indicate_bottom_line_p = 0;            row->indicate_eob_p = row->indicate_bottom_line_p = 0;
763    
764            if (!NILP (ind)            if (!NILP (boundary_top)
765                && MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)))                && MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)))
766              row->indicate_bob_p = do_bob, do_bob = 0;              row->indicate_bob_p = do_bob, do_bob = 0;
767            else if (!NILP (arrows)            else if (!NILP (arrow_top)
768                     && (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) == rn)                     && (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) == rn)
769              row->indicate_top_line_p = 1;              row->indicate_top_line_p = 1;
770    
771            if (!NILP (ind)            if (!NILP (boundary_bot)
772                && MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)))                && MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)))
773              row->indicate_eob_p = do_eob, do_eob = 0;              row->indicate_eob_p = do_eob, do_eob = 0;
774            else if (!NILP (arrows)            else if (!NILP (arrow_bot)
775                     && y + row->height >= yb)                     && y + row->height >= yb)
776              row->indicate_bottom_line_p = 1;              row->indicate_bottom_line_p = 1;
777    
# Line 775  update_window_fringes (w, force_p) Line 783  update_window_fringes (w, force_p)
783          }          }
784      }      }
785    
786    if (EQ (XBUFFER (w->buffer)->indicate_empty_lines, Qright))    empty_pos = XBUFFER (w->buffer)->indicate_empty_lines;
787      empty_pos = 1;    if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
788    else if (EQ (XBUFFER (w->buffer)->indicate_empty_lines, Qleft))      empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
     empty_pos = -1;  
789    
790    for (y = 0, rn = 0;    for (y = 0, rn = 0;
791         y < yb && rn < nrows;         y < yb && rn < nrows;
# Line 802  update_window_fringes (w, force_p) Line 809  update_window_fringes (w, force_p)
809            left = row->left_user_fringe_bitmap;            left = row->left_user_fringe_bitmap;
810            left_face_id = row->left_user_fringe_face_id;            left_face_id = row->left_user_fringe_face_id;
811          }          }
812        else if (row->indicate_bob_p && boundary_pos <= 0)        else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
813          left = ((row->indicate_eob_p && boundary_pos < 0)          left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
814                  ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP);                  ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP);
815        else if (row->indicate_eob_p && boundary_pos < 0)        else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
816          left = BOTTOM_LEFT_ANGLE_BITMAP;          left = BOTTOM_LEFT_ANGLE_BITMAP;
817        else if (row->truncated_on_left_p)        else if (row->truncated_on_left_p)
818          left = LEFT_TRUNCATION_BITMAP;          left = LEFT_TRUNCATION_BITMAP;
819        else if (MATRIX_ROW_CONTINUATION_LINE_P (row))        else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
820          left = CONTINUATION_LINE_BITMAP;          left = CONTINUATION_LINE_BITMAP;
821        else if (row->indicate_empty_line_p && empty_pos <= 0)        else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
822          left = ZV_LINE_BITMAP;          left = ZV_LINE_BITMAP;
823        else if (row->indicate_top_line_p && arrow_pos <= 0)        else if (row->indicate_top_line_p && EQ (arrow_top, Qleft))
824          left = UP_ARROW_BITMAP;          left = UP_ARROW_BITMAP;
825        else if (row->indicate_bottom_line_p && arrow_pos < 0)        else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qleft))
826          left = DOWN_ARROW_BITMAP;          left = DOWN_ARROW_BITMAP;
827        else        else
828          left = NO_FRINGE_BITMAP;          left = NO_FRINGE_BITMAP;
# Line 828  update_window_fringes (w, force_p) Line 835  update_window_fringes (w, force_p)
835            right = row->right_user_fringe_bitmap;            right = row->right_user_fringe_bitmap;
836            right_face_id = row->right_user_fringe_face_id;            right_face_id = row->right_user_fringe_face_id;
837          }          }
838        else if (row->indicate_bob_p && boundary_pos > 0)        else if (row->indicate_bob_p && EQ (boundary_top, Qright))
839          right = ((row->indicate_eob_p && boundary_pos >= 0)          right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
840                   ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP);                   ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP);
841        else if (row->indicate_eob_p && boundary_pos >= 0)        else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
842          right = BOTTOM_RIGHT_ANGLE_BITMAP;          right = BOTTOM_RIGHT_ANGLE_BITMAP;
843        else if (row->truncated_on_right_p)        else if (row->truncated_on_right_p)
844          right = RIGHT_TRUNCATION_BITMAP;          right = RIGHT_TRUNCATION_BITMAP;
845        else if (row->continued_p)        else if (row->continued_p)
846          right = CONTINUED_LINE_BITMAP;          right = CONTINUED_LINE_BITMAP;
847        else if (row->indicate_top_line_p && arrow_pos > 0)        else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
848          right = UP_ARROW_BITMAP;          right = UP_ARROW_BITMAP;
849        else if (row->indicate_bottom_line_p && arrow_pos >= 0)        else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qright))
850          right = DOWN_ARROW_BITMAP;          right = DOWN_ARROW_BITMAP;
851        else if (row->indicate_empty_line_p        else if (row->indicate_empty_line_p && EQ (empty_pos, Qright))
                && (empty_pos > 0  
                    || (WINDOW_LEFT_FRINGE_WIDTH (w) == 0 && empty_pos == 0)))  
852          right = ZV_LINE_BITMAP;          right = ZV_LINE_BITMAP;
853        else        else
854          right = NO_FRINGE_BITMAP;          right = NO_FRINGE_BITMAP;
# Line 1247  DEFUN ("fringe-bitmaps-at-pos", Ffringe_ Line 1252  DEFUN ("fringe-bitmaps-at-pos", Ffringe_
1252  If WINDOW is nil, use selected window.  If POS is nil, use value of point  If WINDOW is nil, use selected window.  If POS is nil, use value of point
1253  in that window.  Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT  in that window.  Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT
1254  are the fringe bitmap numbers for the bitmaps in the left and right fringe,  are the fringe bitmap numbers for the bitmaps in the left and right fringe,
1255  resp.  Return nil if POS is not visible in WINDOW.  */)  resp.  If left or right fringe is empty, the corresponding element is nil.
1256    Return nil if POS is not visible in WINDOW.  */)
1257    (pos, window)    (pos, window)
1258       Lisp_Object pos, window;       Lisp_Object pos, window;
1259  {  {
# Line 1274  resp.  Return nil if POS is not visible Line 1280  resp.  Return nil if POS is not visible
1280    row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);    row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
1281    row = row_containing_pos (w, textpos, row, NULL, 0);    row = row_containing_pos (w, textpos, row, NULL, 0);
1282    if (row)    if (row)
1283      return Fcons (make_number (row->left_fringe_bitmap),      return Fcons ((row->left_fringe_bitmap == NO_FRINGE_BITMAP
1284                    make_number (row->right_fringe_bitmap));                     ? Qnil : make_number (row->left_fringe_bitmap)),
1285                      (row->right_fringe_bitmap == NO_FRINGE_BITMAP
1286                       ? Qnil : make_number (row->right_fringe_bitmap)));
1287    else    else
1288      return Qnil;      return Qnil;
1289  }  }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26