aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-09-29 08:38:15 +0000
committerKaroly Lorentey2004-09-29 08:38:15 +0000
commit181bb49001b52ee593c852377951f8f7b3cf4f38 (patch)
treef4413632929b45d3936621a7c65d7fc6eee16fd6 /src
parentd73d547a20c1a36612dc637d860113551d4ddc6a (diff)
parentc1d7d28589c020b2b72d795638e100eda852d6aa (diff)
downloademacs-181bb49001b52ee593c852377951f8f7b3cf4f38.tar.gz
emacs-181bb49001b52ee593c852377951f8f7b3cf4f38.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-567 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-568 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-569 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-570 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-571 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-572 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-573 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-574 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-575 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-576 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-577 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-578 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-579 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-580 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-31 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-32 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-33 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-34 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-35 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-36 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-37 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-251
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog44
-rw-r--r--src/Makefile.in15
-rw-r--r--src/buffer.c22
-rw-r--r--src/config.in3
-rw-r--r--src/dispextern.h2
-rw-r--r--src/fringe.c286
-rw-r--r--src/xdisp.c6
7 files changed, 275 insertions, 103 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e71a0e3217d..b71bffc5bce 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,47 @@
12004-09-29 Kim F. Storm <storm@cua.dk>
2
3 * dispextern.h (valid_fringe_bitmap_p): Fix prototype.
4
5 * fringe.c (Vfringe_bitmaps): New variable.
6 (syms_of_fringe): DEFVAR_LISP it.
7 (valid_fringe_bitmap_p): Rename from valid_fringe_bitmap_id_p.
8 Change arg to Lisp_Object and fail if not an integer.
9 (get_fringe_bitmap_name, resolve_fringe_bitmap)
10 (destroy_fringe_bitmap): New functions.
11 (Fdestroy_fringe_bitmap): Change arg to bitmap symbol. Use
12 destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and
13 clear its fringe property.
14 (init_fringe_bitmap): Use destroy_fringe_bitmap instead of
15 Fdestroy_fringe_bitmap.
16 (Fdefine_fringe_bitmap): Add BITMAP arg specifying new or existing
17 bitmap symbol; remove WHICH arg. Add symbol to Vfringe_bitmaps
18 and set fringe property. Signal error if no free slots.
19 (Fset_fringe_bitmap_face): Change arg to bitmap symbol.
20 (Ffringe_bitmaps_at_pos): Return bitmap symbols instead of numbers.
21
22 * xdisp.c (handle_single_display_prop): Fringe bitmaps are now
23 symbols with a fringe property.
24
252004-09-27 Kim F. Storm <storm@cua.dk>
26
27 * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>:
28 Doc fix. Format may now be a symbol or alist, not a cons.
29
30 * fringe.c (update_window_fringes): Handle new formats of
31 indicate-buffer-boundaries (symbol or alist). No longer
32 allow a simple cons.
33 (Ffringe_bitmaps_at_pos): Use nil value for no bitmap.
34
352004-09-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
36
37 * config.in: Rebuild
38
392004-09-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
40
41 * config.in: Rebuild.
42
43 * Makefile.in: Run setarch i386 ./temacs if exec-shield is present.
44
12004-09-18 Stefan Monnier <monnier@iro.umontreal.ca> 452004-09-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 46
3 * xterm.c (x_term_init): Work around a bug in some X servers. 47 * xterm.c (x_term_init): Work around a bug in some X servers.
diff --git a/src/Makefile.in b/src/Makefile.in
index 1f719018c77..dc8964a42ca 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -909,6 +909,13 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
909#define OBJECTS_MACHINE 909#define OBJECTS_MACHINE
910#endif 910#endif
911 911
912#ifdef HAVE_EXECSHIELD
913#undef i386
914RUN_TEMACS = @SETARCH@ i386 ./temacs
915#else
916RUN_TEMACS = ./temacs
917#endif
918
912all: emacs${EXEEXT} OTHER_FILES 919all: emacs${EXEEXT} OTHER_FILES
913 920
914emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp} 921emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
@@ -917,9 +924,9 @@ emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
917 ln temacs${EXEEXT} emacs${EXEEXT} 924 ln temacs${EXEEXT} emacs${EXEEXT}
918#else 925#else
919#ifdef HAVE_SHM 926#ifdef HAVE_SHM
920 LC_ALL=C ./temacs -nl -batch -l loadup dump 927 LC_ALL=C $(RUN_TEMACS) -nl -batch -l loadup dump
921#else /* ! defined (HAVE_SHM) */ 928#else /* ! defined (HAVE_SHM) */
922 LC_ALL=C ./temacs -batch -l loadup dump 929 LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
923#endif /* ! defined (HAVE_SHM) */ 930#endif /* ! defined (HAVE_SHM) */
924#endif /* ! defined (CANNOT_DUMP) */ 931#endif /* ! defined (CANNOT_DUMP) */
925 -./emacs -q -batch -f list-load-path-shadows 932 -./emacs -q -batch -f list-load-path-shadows
@@ -1339,9 +1346,9 @@ bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
1339 ln temacs${EXEEXT} bootstrap-emacs${EXEEXT} 1346 ln temacs${EXEEXT} bootstrap-emacs${EXEEXT}
1340#else 1347#else
1341#ifdef HAVE_SHM 1348#ifdef HAVE_SHM
1342 ./temacs -nl -batch -l loadup bootstrap 1349 $(RUN_TEMACS) -nl -batch -l loadup bootstrap
1343#else /* ! defined (HAVE_SHM) */ 1350#else /* ! defined (HAVE_SHM) */
1344 ./temacs --batch --load loadup bootstrap 1351 $(RUN_TEMACS) --batch --load loadup bootstrap
1345#endif /* ! defined (HAVE_SHM) */ 1352#endif /* ! defined (HAVE_SHM) */
1346 mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} 1353 mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
1347#endif /* ! defined (CANNOT_DUMP) */ 1354#endif /* ! defined (CANNOT_DUMP) */
diff --git a/src/buffer.c b/src/buffer.c
index b1c453816ce..b0368a842ca 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5682,16 +5682,20 @@ If non-nil, the first and last line of the buffer are marked in the fringe
5682of a window on window-systems with angle bitmaps, or if the window can be 5682of a window on window-systems with angle bitmaps, or if the window can be
5683scrolled, the top and bottom line of the window are marked with up and down 5683scrolled, the top and bottom line of the window are marked with up and down
5684arrow bitmaps. 5684arrow bitmaps.
5685If value is `left' or `right', both angle and arrow bitmaps are displayed in 5685
5686the left or right fringe, resp. Any other non-nil value causes the 5686If value is a symbol `left' or `right', both angle and arrow bitmaps
5687bitmap on the top line to be displayed in the left fringe, and the 5687are displayed in the left or right fringe, resp.
5688bitmap on the bottom line in the right fringe. 5688
5689If value is a cons (ANGLES . ARROWS), the car specifies the position 5689If value is an alist, each element (INDICATOR . POSITION) specifies
5690of the angle bitmaps, and the cdr specifies the position of the arrow 5690the position of one of the indicators. INDICATOR is one of `top',
5691bitmaps. For example, (t . right) places the top angle bitmap in left 5691`bottom', `up', `down', or t, which specifies the default position,
5692fringe, the bottom angle bitmap in right fringe, and both arrow 5692and POSITION is one of `left', `right', or nil, meaning do not show
5693this indicator.
5694
5695For example, ((top . left) (t . right)) places the top angle bitmap in
5696left fringe, the bottom angle bitmap in right fringe, and both arrow
5693bitmaps in right fringe. To show just the angle bitmaps in the left 5697bitmaps in right fringe. To show just the angle bitmaps in the left
5694fringe, but no arrow bitmaps, use (left . nil). */); 5698fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */);
5695 5699
5696 DEFVAR_PER_BUFFER ("scroll-up-aggressively", 5700 DEFVAR_PER_BUFFER ("scroll-up-aggressively",
5697 &current_buffer->scroll_up_aggressively, Qnil, 5701 &current_buffer->scroll_up_aggressively, Qnil,
diff --git a/src/config.in b/src/config.in
index 4fe82cd8f2d..e5d112ee81c 100644
--- a/src/config.in
+++ b/src/config.in
@@ -136,6 +136,9 @@ Boston, MA 02111-1307, USA. */
136/* Define to 1 if you have the `euidaccess' function. */ 136/* Define to 1 if you have the `euidaccess' function. */
137#undef HAVE_EUIDACCESS 137#undef HAVE_EUIDACCESS
138 138
139/* Define to 1 if this OS has exec shield and we can handle it. */
140#undef HAVE_EXECSHIELD
141
139/* Define to 1 if you have the <fcntl.h> header file. */ 142/* Define to 1 if you have the <fcntl.h> header file. */
140#undef HAVE_FCNTL_H 143#undef HAVE_FCNTL_H
141 144
diff --git a/src/dispextern.h b/src/dispextern.h
index 5f293219328..440c127508e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2630,7 +2630,7 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *,
2630 2630
2631/* Defined in fringe.c */ 2631/* Defined in fringe.c */
2632 2632
2633int valid_fringe_bitmap_id_p (int); 2633int valid_fringe_bitmap_p (Lisp_Object);
2634void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int)); 2634void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int));
2635void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); 2635void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
2636void draw_window_fringes P_ ((struct window *)); 2636void draw_window_fringes P_ ((struct window *));
diff --git a/src/fringe.c b/src/fringe.c
index aecb51349fc..24a7bcb083a 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -32,12 +32,22 @@ Boston, MA 02111-1307, USA. */
32 32
33#ifdef HAVE_WINDOW_SYSTEM 33#ifdef HAVE_WINDOW_SYSTEM
34 34
35extern Lisp_Object Qfringe;
35extern Lisp_Object Qtop, Qbottom, Qcenter; 36extern Lisp_Object Qtop, Qbottom, Qcenter;
37extern Lisp_Object Qup, Qdown, Qleft, Qright;
36 38
37/* Non-nil means that newline may flow into the right fringe. */ 39/* Non-nil means that newline may flow into the right fringe. */
38 40
39Lisp_Object Voverflow_newline_into_fringe; 41Lisp_Object Voverflow_newline_into_fringe;
40 42
43/* List of known fringe bitmap symbols.
44
45 The fringe bitmap number is stored in the `fringe' property on
46 those symbols. Names for the built-in bitmaps are installed by
47 loading fringe.el.
48 */
49
50Lisp_Object Vfringe_bitmaps;
41 51
42enum fringe_bitmap_type 52enum fringe_bitmap_type
43{ 53{
@@ -444,15 +454,90 @@ static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
444/* Return 1 if FRINGE_ID is a valid fringe bitmap id. */ 454/* Return 1 if FRINGE_ID is a valid fringe bitmap id. */
445 455
446int 456int
447valid_fringe_bitmap_id_p (fringe_id) 457valid_fringe_bitmap_p (bitmap)
448 int fringe_id; 458 Lisp_Object bitmap;
459{
460 int bn;
461
462 if (!INTEGERP (bitmap))
463 return 0;
464
465 bn = XINT (bitmap);
466 return (bn >= NO_FRINGE_BITMAP
467 && bn < max_used_fringe_bitmap
468 && (bn < MAX_STANDARD_FRINGE_BITMAPS
469 || fringe_bitmaps[bn] != NULL));
470}
471
472/* Get fringe bitmap name for bitmap number BN.
473
474 Found by traversing Vfringe_bitmaps comparing BN to the
475 fringe property for each symbol.
476
477 Return BN if not found in Vfringe_bitmaps. */
478
479static Lisp_Object
480get_fringe_bitmap_name (bn)
481 int bn;
482{
483 Lisp_Object bitmaps;
484 Lisp_Object num;
485
486 /* Zero means no bitmap -- return nil. */
487 if (bn <= 0)
488 return Qnil;
489
490 bitmaps = Vfringe_bitmaps;
491 num = make_number (bn);
492
493 while (CONSP (bitmaps))
494 {
495 Lisp_Object bitmap = XCAR (bitmaps);
496 if (EQ (num, Fget (bitmap, Qfringe)))
497 return bitmap;
498 bitmaps = XCDR (bitmaps);
499 }
500
501 return num;
502}
503
504
505/* Resolve a BITMAP parameter.
506
507 An INTEGER, corresponding to a bitmap number.
508 A STRING which is interned to a symbol.
509 A SYMBOL which has a fringe property which is a bitmap number.
510*/
511
512static int
513resolve_fringe_bitmap (bitmap, namep)
514 Lisp_Object bitmap;
515 Lisp_Object *namep;
449{ 516{
450 return (fringe_id >= NO_FRINGE_BITMAP 517 if (namep)
451 && fringe_id < max_used_fringe_bitmap 518 *namep = Qnil;
452 && (fringe_id < MAX_STANDARD_FRINGE_BITMAPS 519
453 || fringe_bitmaps[fringe_id] != NULL)); 520 if (STRINGP (bitmap))
521 bitmap = intern (SDATA (bitmap));
522
523 if (SYMBOLP (bitmap))
524 {
525 if (namep)
526 *namep = bitmap;
527 bitmap = Fget (bitmap, Qfringe);
528 }
529
530 if (valid_fringe_bitmap_p (bitmap))
531 {
532 if (namep && NILP (*namep))
533 *namep = get_fringe_bitmap_name (XINT (bitmap));
534 return XINT (bitmap);
535 }
536
537 return -1;
454} 538}
455 539
540
456/* Draw the bitmap WHICH in one of the left or right fringes of 541/* Draw the bitmap WHICH in one of the left or right fringes of
457 window W. ROW is the glyph row for which to display the bitmap; it 542 window W. ROW is the glyph row for which to display the bitmap; it
458 determines the vertical position at which the bitmap has to be 543 determines the vertical position at which the bitmap has to be
@@ -707,9 +792,10 @@ update_window_fringes (w, force_p)
707 int rn, nrows = w->current_matrix->nrows; 792 int rn, nrows = w->current_matrix->nrows;
708 int y; 793 int y;
709 int redraw_p = 0; 794 int redraw_p = 0;
710 Lisp_Object ind; 795 Lisp_Object boundary_top = Qnil, boundary_bot = Qnil;
711 int boundary_pos = 0, arrow_pos = 0; 796 Lisp_Object arrow_top = Qnil, arrow_bot = Qnil;
712 int empty_pos = 0; 797 Lisp_Object empty_pos;
798 Lisp_Object ind = Qnil;
713 799
714 if (w->pseudo_window_p) 800 if (w->pseudo_window_p)
715 return 0; 801 return 0;
@@ -717,23 +803,29 @@ update_window_fringes (w, force_p)
717 if (!MINI_WINDOW_P (w) 803 if (!MINI_WINDOW_P (w)
718 && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind))) 804 && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind)))
719 { 805 {
720 int do_eob = 1, do_bob = 1; 806 if (EQ (ind, Qleft) || EQ (ind, Qright))
721 Lisp_Object arrows; 807 boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
722 808 else if (CONSP (ind) && CONSP (XCAR (ind)))
723 if (CONSP (ind)) 809 {
724 arrows = XCDR (ind), ind = XCAR (ind); 810 Lisp_Object pos;
811 if (pos = Fassq (Qt, ind), !NILP (pos))
812 boundary_top = boundary_bot = arrow_top = arrow_bot = XCDR (pos);
813 if (pos = Fassq (Qtop, ind), !NILP (pos))
814 boundary_top = XCDR (pos);
815 if (pos = Fassq (Qbottom, ind), !NILP (pos))
816 boundary_bot = XCDR (pos);
817 if (pos = Fassq (Qup, ind), !NILP (pos))
818 arrow_top = XCDR (pos);
819 if (pos = Fassq (Qdown, ind), !NILP (pos))
820 arrow_bot = XCDR (pos);
821 }
725 else 822 else
726 arrows = ind; 823 ind = Qnil;
727 824 }
728 if (EQ (ind, Qleft))
729 boundary_pos = -1;
730 else if (EQ (ind, Qright))
731 boundary_pos = 1;
732 825
733 if (EQ (arrows, Qleft)) 826 if (!NILP (ind))
734 arrow_pos = -1; 827 {
735 else if (EQ (arrows, Qright)) 828 int do_eob = 1, do_bob = 1;
736 arrow_pos = 1;
737 829
738 for (y = 0, rn = 0; 830 for (y = 0, rn = 0;
739 y < yb && rn < nrows; 831 y < yb && rn < nrows;
@@ -754,17 +846,17 @@ update_window_fringes (w, force_p)
754 row->indicate_bob_p = row->indicate_top_line_p = 0; 846 row->indicate_bob_p = row->indicate_top_line_p = 0;
755 row->indicate_eob_p = row->indicate_bottom_line_p = 0; 847 row->indicate_eob_p = row->indicate_bottom_line_p = 0;
756 848
757 if (!NILP (ind) 849 if (!NILP (boundary_top)
758 && MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))) 850 && MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)))
759 row->indicate_bob_p = do_bob, do_bob = 0; 851 row->indicate_bob_p = do_bob, do_bob = 0;
760 else if (!NILP (arrows) 852 else if (!NILP (arrow_top)
761 && (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) == rn) 853 && (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) == rn)
762 row->indicate_top_line_p = 1; 854 row->indicate_top_line_p = 1;
763 855
764 if (!NILP (ind) 856 if (!NILP (boundary_bot)
765 && MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))) 857 && MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)))
766 row->indicate_eob_p = do_eob, do_eob = 0; 858 row->indicate_eob_p = do_eob, do_eob = 0;
767 else if (!NILP (arrows) 859 else if (!NILP (arrow_bot)
768 && y + row->height >= yb) 860 && y + row->height >= yb)
769 row->indicate_bottom_line_p = 1; 861 row->indicate_bottom_line_p = 1;
770 862
@@ -776,10 +868,9 @@ update_window_fringes (w, force_p)
776 } 868 }
777 } 869 }
778 870
779 if (EQ (XBUFFER (w->buffer)->indicate_empty_lines, Qright)) 871 empty_pos = XBUFFER (w->buffer)->indicate_empty_lines;
780 empty_pos = 1; 872 if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
781 else if (EQ (XBUFFER (w->buffer)->indicate_empty_lines, Qleft)) 873 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
782 empty_pos = -1;
783 874
784 for (y = 0, rn = 0; 875 for (y = 0, rn = 0;
785 y < yb && rn < nrows; 876 y < yb && rn < nrows;
@@ -803,20 +894,20 @@ update_window_fringes (w, force_p)
803 left = row->left_user_fringe_bitmap; 894 left = row->left_user_fringe_bitmap;
804 left_face_id = row->left_user_fringe_face_id; 895 left_face_id = row->left_user_fringe_face_id;
805 } 896 }
806 else if (row->indicate_bob_p && boundary_pos <= 0) 897 else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
807 left = ((row->indicate_eob_p && boundary_pos < 0) 898 left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
808 ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP); 899 ? LEFT_BRACKET_BITMAP : TOP_LEFT_ANGLE_BITMAP);
809 else if (row->indicate_eob_p && boundary_pos < 0) 900 else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
810 left = BOTTOM_LEFT_ANGLE_BITMAP; 901 left = BOTTOM_LEFT_ANGLE_BITMAP;
811 else if (row->truncated_on_left_p) 902 else if (row->truncated_on_left_p)
812 left = LEFT_TRUNCATION_BITMAP; 903 left = LEFT_TRUNCATION_BITMAP;
813 else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) 904 else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
814 left = CONTINUATION_LINE_BITMAP; 905 left = CONTINUATION_LINE_BITMAP;
815 else if (row->indicate_empty_line_p && empty_pos <= 0) 906 else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
816 left = ZV_LINE_BITMAP; 907 left = ZV_LINE_BITMAP;
817 else if (row->indicate_top_line_p && arrow_pos <= 0) 908 else if (row->indicate_top_line_p && EQ (arrow_top, Qleft))
818 left = UP_ARROW_BITMAP; 909 left = UP_ARROW_BITMAP;
819 else if (row->indicate_bottom_line_p && arrow_pos < 0) 910 else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qleft))
820 left = DOWN_ARROW_BITMAP; 911 left = DOWN_ARROW_BITMAP;
821 else 912 else
822 left = NO_FRINGE_BITMAP; 913 left = NO_FRINGE_BITMAP;
@@ -829,22 +920,20 @@ update_window_fringes (w, force_p)
829 right = row->right_user_fringe_bitmap; 920 right = row->right_user_fringe_bitmap;
830 right_face_id = row->right_user_fringe_face_id; 921 right_face_id = row->right_user_fringe_face_id;
831 } 922 }
832 else if (row->indicate_bob_p && boundary_pos > 0) 923 else if (row->indicate_bob_p && EQ (boundary_top, Qright))
833 right = ((row->indicate_eob_p && boundary_pos >= 0) 924 right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
834 ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP); 925 ? RIGHT_BRACKET_BITMAP : TOP_RIGHT_ANGLE_BITMAP);
835 else if (row->indicate_eob_p && boundary_pos >= 0) 926 else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
836 right = BOTTOM_RIGHT_ANGLE_BITMAP; 927 right = BOTTOM_RIGHT_ANGLE_BITMAP;
837 else if (row->truncated_on_right_p) 928 else if (row->truncated_on_right_p)
838 right = RIGHT_TRUNCATION_BITMAP; 929 right = RIGHT_TRUNCATION_BITMAP;
839 else if (row->continued_p) 930 else if (row->continued_p)
840 right = CONTINUED_LINE_BITMAP; 931 right = CONTINUED_LINE_BITMAP;
841 else if (row->indicate_top_line_p && arrow_pos > 0) 932 else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
842 right = UP_ARROW_BITMAP; 933 right = UP_ARROW_BITMAP;
843 else if (row->indicate_bottom_line_p && arrow_pos >= 0) 934 else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qright))
844 right = DOWN_ARROW_BITMAP; 935 right = DOWN_ARROW_BITMAP;
845 else if (row->indicate_empty_line_p 936 else if (row->indicate_empty_line_p && EQ (empty_pos, Qright))
846 && (empty_pos > 0
847 || (WINDOW_LEFT_FRINGE_WIDTH (w) == 0 && empty_pos == 0)))
848 right = ZV_LINE_BITMAP; 937 right = ZV_LINE_BITMAP;
849 else 938 else
850 right = NO_FRINGE_BITMAP; 939 right = NO_FRINGE_BITMAP;
@@ -979,20 +1068,13 @@ compute_fringe_widths (f, redraw)
979 redraw_frame (f); 1068 redraw_frame (f);
980} 1069}
981 1070
982DEFUN ("destroy-fringe-bitmap", Fdestroy_fringe_bitmap, Sdestroy_fringe_bitmap, 1071
983 1, 1, 0, 1072void
984 doc: /* Destroy fringe bitmap WHICH. 1073destroy_fringe_bitmap (n)
985If WHICH overrides a standard fringe bitmap, the original bitmap is restored. */) 1074 int n;
986 (which)
987 Lisp_Object which;
988{ 1075{
989 int n;
990 struct fringe_bitmap **fbp; 1076 struct fringe_bitmap **fbp;
991 1077
992 CHECK_NUMBER (which);
993 if (n = XINT (which), n >= max_used_fringe_bitmap)
994 return Qnil;
995
996 fringe_faces[n] = FRINGE_FACE_ID; 1078 fringe_faces[n] = FRINGE_FACE_ID;
997 1079
998 fbp = &fringe_bitmaps[n]; 1080 fbp = &fringe_bitmaps[n];
@@ -1008,7 +1090,31 @@ If WHICH overrides a standard fringe bitmap, the original bitmap is restored. *
1008 while (max_used_fringe_bitmap > MAX_STANDARD_FRINGE_BITMAPS 1090 while (max_used_fringe_bitmap > MAX_STANDARD_FRINGE_BITMAPS
1009 && fringe_bitmaps[max_used_fringe_bitmap - 1] == NULL) 1091 && fringe_bitmaps[max_used_fringe_bitmap - 1] == NULL)
1010 max_used_fringe_bitmap--; 1092 max_used_fringe_bitmap--;
1093}
1094
1011 1095
1096DEFUN ("destroy-fringe-bitmap", Fdestroy_fringe_bitmap, Sdestroy_fringe_bitmap,
1097 1, 1, 0,
1098 doc: /* Destroy fringe bitmap BITMAP.
1099If BITMAP overrides a standard fringe bitmap, the original bitmap is restored. */)
1100 (bitmap)
1101 Lisp_Object bitmap;
1102{
1103 int n;
1104 Lisp_Object sym;
1105
1106 n = resolve_fringe_bitmap (bitmap, &sym);
1107 if (n < 0)
1108 return Qnil;
1109
1110 destroy_fringe_bitmap (n);
1111
1112 if (SYMBOLP (sym))
1113 {
1114 Vfringe_bitmaps = Fdelq (sym, Vfringe_bitmaps);
1115 /* It would be better to remove the fringe property. */
1116 Fput (sym, Qfringe, Qnil);
1117 }
1012 return Qnil; 1118 return Qnil;
1013} 1119}
1014 1120
@@ -1079,7 +1185,7 @@ init_fringe_bitmap (which, fb, once_p)
1079 1185
1080 if (!once_p) 1186 if (!once_p)
1081 { 1187 {
1082 Fdestroy_fringe_bitmap (make_number (which)); 1188 destroy_fringe_bitmap (which);
1083 1189
1084 /* XXX Is SELECTED_FRAME OK here? */ 1190 /* XXX Is SELECTED_FRAME OK here? */
1085 if (FRAME_RIF (SELECTED_FRAME ())->define_fringe_bitmap) 1191 if (FRAME_RIF (SELECTED_FRAME ())->define_fringe_bitmap)
@@ -1093,26 +1199,32 @@ init_fringe_bitmap (which, fb, once_p)
1093 1199
1094 1200
1095DEFUN ("define-fringe-bitmap", Fdefine_fringe_bitmap, Sdefine_fringe_bitmap, 1201DEFUN ("define-fringe-bitmap", Fdefine_fringe_bitmap, Sdefine_fringe_bitmap,
1096 1, 5, 0, 1202 2, 5, 0,
1097 doc: /* Define a fringe bitmap from BITS of height HEIGHT and width WIDTH. 1203 doc: /* Define fringe bitmap BITMAP from BITS of size HEIGHT x WIDTH.
1204BITMAP is a symbol or string naming the new fringe bitmap.
1098BITS is either a string or a vector of integers. 1205BITS is either a string or a vector of integers.
1099HEIGHT is height of bitmap. If HEIGHT is nil, use length of BITS. 1206HEIGHT is height of bitmap. If HEIGHT is nil, use length of BITS.
1100WIDTH must be an integer between 1 and 16, or nil which defaults to 8. 1207WIDTH must be an integer between 1 and 16, or nil which defaults to 8.
1101Optional fourth arg ALIGN may be one of `top', `center', or `bottom', 1208Optional fifth arg ALIGN may be one of `top', `center', or `bottom',
1102indicating the positioning of the bitmap relative to the rows where it 1209indicating the positioning of the bitmap relative to the rows where it
1103is used; the default is to center the bitmap. Fourth arg may also be a 1210is used; the default is to center the bitmap. Fourth arg may also be a
1104list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap 1211list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap
1105should be repeated. 1212should be repeated.
1106Optional fifth argument WHICH is bitmap number to redefine. 1213If BITMAP already exists, the existing definition is replaced. */)
1107Return new bitmap number, or nil of no more free bitmap slots. */) 1214 (bitmap, bits, height, width, align)
1108 (bits, height, width, align, which) 1215 Lisp_Object bitmap, bits, height, width, align;
1109 Lisp_Object bits, height, width, align, which;
1110{ 1216{
1111 Lisp_Object len; 1217 Lisp_Object len;
1112 int n, h, i, j; 1218 int n, h, i, j;
1113 unsigned short *b; 1219 unsigned short *b;
1114 struct fringe_bitmap fb, *xfb; 1220 struct fringe_bitmap fb, *xfb;
1115 int fill1 = 0, fill2 = 0; 1221 int fill1 = 0, fill2 = 0;
1222 Lisp_Object sym;
1223
1224 n = resolve_fringe_bitmap (bitmap, &sym);
1225
1226 if (NILP (sym) || INTEGERP (sym))
1227 sym = wrong_type_argument (Qsymbolp, bitmap);
1116 1228
1117 if (!STRINGP (bits) && !VECTORP (bits)) 1229 if (!STRINGP (bits) && !VECTORP (bits))
1118 bits = wrong_type_argument (Qstringp, bits); 1230 bits = wrong_type_argument (Qstringp, bits);
@@ -1165,7 +1277,7 @@ Return new bitmap number, or nil of no more free bitmap slots. */)
1165 else if (!NILP (align) && !EQ (align, Qcenter)) 1277 else if (!NILP (align) && !EQ (align, Qcenter))
1166 error ("Bad align argument"); 1278 error ("Bad align argument");
1167 1279
1168 if (NILP (which)) 1280 if (n < 0)
1169 { 1281 {
1170 if (max_used_fringe_bitmap < MAX_FRINGE_BITMAPS) 1282 if (max_used_fringe_bitmap < MAX_FRINGE_BITMAPS)
1171 n = max_used_fringe_bitmap++; 1283 n = max_used_fringe_bitmap++;
@@ -1177,16 +1289,11 @@ Return new bitmap number, or nil of no more free bitmap slots. */)
1177 if (fringe_bitmaps[n] == NULL) 1289 if (fringe_bitmaps[n] == NULL)
1178 break; 1290 break;
1179 if (n == MAX_FRINGE_BITMAPS) 1291 if (n == MAX_FRINGE_BITMAPS)
1180 return Qnil; 1292 error ("Cannot define more fringe bitmaps");
1181 } 1293 }
1182 which = make_number (n); 1294
1183 } 1295 Vfringe_bitmaps = Fcons (sym, Vfringe_bitmaps);
1184 else 1296 Fput (sym, Qfringe, make_number (n));
1185 {
1186 CHECK_NUMBER (which);
1187 n = XINT (which);
1188 if (n <= NO_FRINGE_BITMAP || n >= MAX_FRINGE_BITMAPS)
1189 error ("Invalid fringe bitmap number");
1190 } 1297 }
1191 1298
1192 fb.dynamic = 1; 1299 fb.dynamic = 1;
@@ -1214,21 +1321,22 @@ Return new bitmap number, or nil of no more free bitmap slots. */)
1214 1321
1215 init_fringe_bitmap (n, xfb, 0); 1322 init_fringe_bitmap (n, xfb, 0);
1216 1323
1217 return which; 1324 return sym;
1218} 1325}
1219 1326
1220DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_face, 1327DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_face,
1221 1, 2, 0, 1328 1, 2, 0,
1222 doc: /* Set face for fringe bitmap FRINGE-ID to FACE. 1329 doc: /* Set face for fringe bitmap BITMAP to FACE.
1223If FACE is nil, reset face to default fringe face. */) 1330If FACE is nil, reset face to default fringe face. */)
1224 (fringe_id, face) 1331 (bitmap, face)
1225 Lisp_Object fringe_id, face; 1332 Lisp_Object bitmap, face;
1226{ 1333{
1334 int bn;
1227 int face_id; 1335 int face_id;
1228 1336
1229 CHECK_NUMBER (fringe_id); 1337 bn = resolve_fringe_bitmap (bitmap, 0);
1230 if (!valid_fringe_bitmap_id_p (XINT (fringe_id))) 1338 if (bn < 0)
1231 error ("Invalid fringe id"); 1339 error ("Undefined fringe bitmap");
1232 1340
1233 if (!NILP (face)) 1341 if (!NILP (face))
1234 { 1342 {
@@ -1239,7 +1347,7 @@ If FACE is nil, reset face to default fringe face. */)
1239 else 1347 else
1240 face_id = FRINGE_FACE_ID; 1348 face_id = FRINGE_FACE_ID;
1241 1349
1242 fringe_faces [XINT (fringe_id)] = face_id; 1350 fringe_faces [bn] = face_id;
1243 1351
1244 return Qnil; 1352 return Qnil;
1245} 1353}
@@ -1250,7 +1358,8 @@ DEFUN ("fringe-bitmaps-at-pos", Ffringe_bitmaps_at_pos, Sfringe_bitmaps_at_pos,
1250If WINDOW is nil, use selected window. If POS is nil, use value of point 1358If WINDOW is nil, use selected window. If POS is nil, use value of point
1251in that window. Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT 1359in that window. Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT
1252are the fringe bitmap numbers for the bitmaps in the left and right fringe, 1360are the fringe bitmap numbers for the bitmaps in the left and right fringe,
1253resp. Return nil if POS is not visible in WINDOW. */) 1361resp. If left or right fringe is empty, the corresponding element is nil.
1362Return nil if POS is not visible in WINDOW. */)
1254 (pos, window) 1363 (pos, window)
1255 Lisp_Object pos, window; 1364 Lisp_Object pos, window;
1256{ 1365{
@@ -1276,8 +1385,8 @@ resp. Return nil if POS is not visible in WINDOW. */)
1276 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 1385 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
1277 row = row_containing_pos (w, textpos, row, NULL, 0); 1386 row = row_containing_pos (w, textpos, row, NULL, 0);
1278 if (row) 1387 if (row)
1279 return Fcons (make_number (row->left_fringe_bitmap), 1388 return Fcons (get_fringe_bitmap_name (row->left_fringe_bitmap),
1280 make_number (row->right_fringe_bitmap)); 1389 get_fringe_bitmap_name (row->right_fringe_bitmap));
1281 else 1390 else
1282 return Qnil; 1391 return Qnil;
1283} 1392}
@@ -1290,7 +1399,6 @@ resp. Return nil if POS is not visible in WINDOW. */)
1290void 1399void
1291syms_of_fringe () 1400syms_of_fringe ()
1292{ 1401{
1293
1294 defsubr (&Sdestroy_fringe_bitmap); 1402 defsubr (&Sdestroy_fringe_bitmap);
1295 defsubr (&Sdefine_fringe_bitmap); 1403 defsubr (&Sdefine_fringe_bitmap);
1296 defsubr (&Sfringe_bitmaps_at_pos); 1404 defsubr (&Sfringe_bitmaps_at_pos);
@@ -1305,6 +1413,10 @@ is at the final newline, the cursor is shown in the right fringe.
1305If nil, also continue lines which are exactly as wide as the window. */); 1413If nil, also continue lines which are exactly as wide as the window. */);
1306 Voverflow_newline_into_fringe = Qt; 1414 Voverflow_newline_into_fringe = Qt;
1307 1415
1416 DEFVAR_LISP ("fringe-bitmaps", &Vfringe_bitmaps,
1417 doc: /* List of fringe bitmap symbols.
1418You must (require 'fringe) to use fringe bitmap symbols in your programs." */);
1419 Vfringe_bitmaps = Qnil;
1308} 1420}
1309 1421
1310/* Initialize this module when Emacs starts. */ 1422/* Initialize this module when Emacs starts. */
diff --git a/src/xdisp.c b/src/xdisp.c
index 90399c06031..2820bbb3883 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -307,6 +307,7 @@ extern Lisp_Object Qheight;
307extern Lisp_Object QCwidth, QCheight, QCascent; 307extern Lisp_Object QCwidth, QCheight, QCascent;
308extern Lisp_Object Qscroll_bar; 308extern Lisp_Object Qscroll_bar;
309extern Lisp_Object Qcursor; 309extern Lisp_Object Qcursor;
310extern Lisp_Object Qfringe;
310 311
311/* Non-nil means highlight trailing whitespace. */ 312/* Non-nil means highlight trailing whitespace. */
312 313
@@ -3574,8 +3575,9 @@ handle_single_display_prop (it, prop, object, position,
3574 3575
3575#ifdef HAVE_WINDOW_SYSTEM 3576#ifdef HAVE_WINDOW_SYSTEM
3576 value = XCAR (XCDR (prop)); 3577 value = XCAR (XCDR (prop));
3577 if (!NUMBERP (value) 3578 if (!SYMBOLP (value)
3578 || !valid_fringe_bitmap_id_p (XINT (value))) 3579 || (value = Fget (value, Qfringe),
3580 !valid_fringe_bitmap_p (value)))
3579 return 0; 3581 return 0;
3580 3582
3581 if (CONSP (XCDR (XCDR (prop)))) 3583 if (CONSP (XCDR (XCDR (prop))))