Mercurial > hg > xemacs-beta
comparison src/extents.c @ 563:183866b06e0b
[xemacs-hg @ 2001-05-24 07:50:48 by ben]
Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c:
-- defsymbol -> DEFSYMBOL.
-- add an error type to all errors.
-- eliminate the error functions in eval.c that let you just
use Qerror as the type.
-- redo the error API to be more consistent, sensibly named,
and easier to use.
-- redo the error hierarchy somewhat. create new errors:
structure-formation-error, gui-error, invalid-constant,
stack-overflow, out-of-memory, process-error, network-error,
sound-error, printing-unreadable-object, base64-conversion-
error; coding-system-error renamed to text-conversion error;
some others.
-- fix Mule problems in error strings in emodules.c, tooltalk.c.
-- fix error handling in mswin open-network-stream.
-- Mule-ize all sound files and clean up the headers.
-- nativesound.h -> sound.h and used for all sound files.
-- move some shared stuff into glyphs-shared.c: first attempt
at eliminating some of the massive GTK code duplication.
xemacs.mak: add glyphs-shared.c.
xemacs-faq.texi: document how to debug X errors
subr.el: fix doc string to reflect reality
author | ben |
---|---|
date | Thu, 24 May 2001 07:51:33 +0000 |
parents | 20ae8821c23d |
children | b39c14581166 |
comparison
equal
deleted
inserted
replaced
562:c775bd016b32 | 563:183866b06e0b |
---|---|
3024 } | 3024 } |
3025 | 3025 |
3026 if (print_readably) | 3026 if (print_readably) |
3027 { | 3027 { |
3028 if (!EXTENT_LIVE_P (XEXTENT (obj))) | 3028 if (!EXTENT_LIVE_P (XEXTENT (obj))) |
3029 error ("printing unreadable object #<destroyed extent>"); | 3029 printing_unreadable_object ("#<destroyed extent>"); |
3030 else | 3030 else |
3031 error ("printing unreadable object #<extent 0x%lx>", | 3031 printing_unreadable_object ("#<extent 0x%lx>", |
3032 (long) XEXTENT (obj)); | 3032 (long) XEXTENT (obj)); |
3033 } | 3033 } |
3034 | 3034 |
3035 if (!EXTENT_LIVE_P (XEXTENT (obj))) | 3035 if (!EXTENT_LIVE_P (XEXTENT (obj))) |
3036 write_c_string ("#<destroyed extent", printcharfun); | 3036 write_c_string ("#<destroyed extent", printcharfun); |
3047 } | 3047 } |
3048 } | 3048 } |
3049 else | 3049 else |
3050 { | 3050 { |
3051 if (print_readably) | 3051 if (print_readably) |
3052 error ("printing unreadable object #<extent>"); | 3052 printing_unreadable_object ("#<extent>"); |
3053 write_c_string ("#<extent", printcharfun); | 3053 write_c_string ("#<extent", printcharfun); |
3054 } | 3054 } |
3055 write_c_string (">", printcharfun); | 3055 write_c_string (">", printcharfun); |
3056 } | 3056 } |
3057 | 3057 |
3534 CHECK_LIVE_EXTENT (parent); | 3534 CHECK_LIVE_EXTENT (parent); |
3535 if (EQ (parent, cur_parent)) | 3535 if (EQ (parent, cur_parent)) |
3536 return Qnil; | 3536 return Qnil; |
3537 for (rest = parent; !NILP (rest); rest = extent_parent (XEXTENT (rest))) | 3537 for (rest = parent; !NILP (rest); rest = extent_parent (XEXTENT (rest))) |
3538 if (EQ (rest, extent)) | 3538 if (EQ (rest, extent)) |
3539 signal_type_error (Qinvalid_change, | 3539 signal_error (Qinvalid_change, |
3540 "Circular parent chain would result", | 3540 "Circular parent chain would result", |
3541 extent); | 3541 extent); |
3542 if (NILP (parent)) | 3542 if (NILP (parent)) |
3543 { | 3543 { |
3544 remove_extent_from_children_list (XEXTENT (cur_parent), extent); | 3544 remove_extent_from_children_list (XEXTENT (cur_parent), extent); |
3875 if (EQ (sym, Qall_extents_closed) || EQ (sym, Qall_extents_open) || | 3875 if (EQ (sym, Qall_extents_closed) || EQ (sym, Qall_extents_open) || |
3876 EQ (sym, Qall_extents_closed_open) || | 3876 EQ (sym, Qall_extents_closed_open) || |
3877 EQ (sym, Qall_extents_open_closed)) | 3877 EQ (sym, Qall_extents_open_closed)) |
3878 { | 3878 { |
3879 if (all_extents_specified) | 3879 if (all_extents_specified) |
3880 error ("Only one `all-extents-*' flag may be specified"); | 3880 invalid_argument ("Only one `all-extents-*' flag may be specified", Qunbound); |
3881 all_extents_specified = 1; | 3881 all_extents_specified = 1; |
3882 } | 3882 } |
3883 if (EQ (sym, Qstart_in_region) || EQ (sym, Qend_in_region) || | 3883 if (EQ (sym, Qstart_in_region) || EQ (sym, Qend_in_region) || |
3884 EQ (sym, Qstart_and_end_in_region) || | 3884 EQ (sym, Qstart_and_end_in_region) || |
3885 EQ (sym, Qstart_or_end_in_region)) | 3885 EQ (sym, Qstart_or_end_in_region)) |
3886 { | 3886 { |
3887 if (in_region_specified) | 3887 if (in_region_specified) |
3888 error ("Only one `*-in-region' flag may be specified"); | 3888 invalid_argument ("Only one `*-in-region' flag may be specified", Qunbound); |
3889 in_region_specified = 1; | 3889 in_region_specified = 1; |
3890 } | 3890 } |
3891 | 3891 |
3892 /* I do so love that conditional operator ... */ | 3892 /* I do so love that conditional operator ... */ |
3893 retval |= | 3893 retval |= |
3900 EQ (sym, Qstart_in_region) ? ME_START_IN_REGION : | 3900 EQ (sym, Qstart_in_region) ? ME_START_IN_REGION : |
3901 EQ (sym, Qend_in_region) ? ME_END_IN_REGION : | 3901 EQ (sym, Qend_in_region) ? ME_END_IN_REGION : |
3902 EQ (sym, Qstart_and_end_in_region) ? ME_START_AND_END_IN_REGION : | 3902 EQ (sym, Qstart_and_end_in_region) ? ME_START_AND_END_IN_REGION : |
3903 EQ (sym, Qstart_or_end_in_region) ? ME_START_OR_END_IN_REGION : | 3903 EQ (sym, Qstart_or_end_in_region) ? ME_START_OR_END_IN_REGION : |
3904 EQ (sym, Qnegate_in_region) ? ME_NEGATE_IN_REGION : | 3904 EQ (sym, Qnegate_in_region) ? ME_NEGATE_IN_REGION : |
3905 (invalid_argument ("Invalid `map-extents' flag", sym), 0); | 3905 (invalid_constant ("Invalid `map-extents' flag", sym), 0); |
3906 | 3906 |
3907 flags = XCDR (flags); | 3907 flags = XCDR (flags); |
3908 } | 3908 } |
3909 return retval; | 3909 return retval; |
3910 } | 3910 } |
4264 CHECK_SYMBOL (at_flag); | 4264 CHECK_SYMBOL (at_flag); |
4265 if (EQ (at_flag, Qafter)) return EXTENT_AT_AFTER; | 4265 if (EQ (at_flag, Qafter)) return EXTENT_AT_AFTER; |
4266 if (EQ (at_flag, Qbefore)) return EXTENT_AT_BEFORE; | 4266 if (EQ (at_flag, Qbefore)) return EXTENT_AT_BEFORE; |
4267 if (EQ (at_flag, Qat)) return EXTENT_AT_AT; | 4267 if (EQ (at_flag, Qat)) return EXTENT_AT_AT; |
4268 | 4268 |
4269 invalid_argument ("Invalid AT-FLAG in `extent-at'", at_flag); | 4269 invalid_constant ("Invalid AT-FLAG in `extent-at'", at_flag); |
4270 return EXTENT_AT_AFTER; /* unreached */ | 4270 return EXTENT_AT_AFTER; /* unreached */ |
4271 } | 4271 } |
4272 | 4272 |
4273 static int | 4273 static int |
4274 extent_at_mapper (EXTENT e, void *arg) | 4274 extent_at_mapper (EXTENT e, void *arg) |
5070 if (EQ (layout_obj, Qoutside_margin)) return GL_OUTSIDE_MARGIN; | 5070 if (EQ (layout_obj, Qoutside_margin)) return GL_OUTSIDE_MARGIN; |
5071 if (EQ (layout_obj, Qinside_margin)) return GL_INSIDE_MARGIN; | 5071 if (EQ (layout_obj, Qinside_margin)) return GL_INSIDE_MARGIN; |
5072 if (EQ (layout_obj, Qwhitespace)) return GL_WHITESPACE; | 5072 if (EQ (layout_obj, Qwhitespace)) return GL_WHITESPACE; |
5073 if (EQ (layout_obj, Qtext)) return GL_TEXT; | 5073 if (EQ (layout_obj, Qtext)) return GL_TEXT; |
5074 | 5074 |
5075 invalid_argument ("Unknown glyph layout type", layout_obj); | 5075 invalid_constant ("Unknown glyph layout type", layout_obj); |
5076 return GL_TEXT; /* unreached */ | 5076 return GL_TEXT; /* unreached */ |
5077 } | 5077 } |
5078 | 5078 |
5079 static Lisp_Object | 5079 static Lisp_Object |
5080 set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, | 5080 set_extent_glyph_1 (Lisp_Object extent_obj, Lisp_Object glyph, int endp, |
5361 extent_detachable_p (e) = !NILP (value); | 5361 extent_detachable_p (e) = !NILP (value); |
5362 | 5362 |
5363 else if (EQ (property, Qdetached)) | 5363 else if (EQ (property, Qdetached)) |
5364 { | 5364 { |
5365 if (NILP (value)) | 5365 if (NILP (value)) |
5366 error ("can only set `detached' to t"); | 5366 invalid_operation ("can only set `detached' to t", Qunbound); |
5367 Fdetach_extent (extent); | 5367 Fdetach_extent (extent); |
5368 } | 5368 } |
5369 else if (EQ (property, Qdestroyed)) | 5369 else if (EQ (property, Qdestroyed)) |
5370 { | 5370 { |
5371 if (NILP (value)) | 5371 if (NILP (value)) |
5372 error ("can only set `destroyed' to t"); | 5372 invalid_operation ("can only set `destroyed' to t", Qunbound); |
5373 Fdelete_extent (extent); | 5373 Fdelete_extent (extent); |
5374 } | 5374 } |
5375 else if (EQ (property, Qpriority)) | 5375 else if (EQ (property, Qpriority)) |
5376 Fset_extent_priority (extent, value); | 5376 Fset_extent_priority (extent, value); |
5377 else if (EQ (property, Qface)) | 5377 else if (EQ (property, Qface)) |
6576 /* This function can GC */ | 6576 /* This function can GC */ |
6577 Lisp_Object prop, val; | 6577 Lisp_Object prop, val; |
6578 | 6578 |
6579 prop = Fextent_property (extent, Qtext_prop, Qnil); | 6579 prop = Fextent_property (extent, Qtext_prop, Qnil); |
6580 if (NILP (prop)) | 6580 if (NILP (prop)) |
6581 signal_type_error (Qinternal_error, | 6581 signal_error (Qinternal_error, |
6582 "Internal error: no text-prop", extent); | 6582 "Internal error: no text-prop", extent); |
6583 val = Fextent_property (extent, prop, Qnil); | 6583 val = Fextent_property (extent, prop, Qnil); |
6584 #if 0 | 6584 #if 0 |
6585 /* removed by bill perry, 2/9/97 | 6585 /* removed by bill perry, 2/9/97 |
6586 ** This little bit of code would not allow you to have a text property | 6586 ** This little bit of code would not allow you to have a text property |
6587 ** with a value of Qnil. This is bad bad bad. | 6587 ** with a value of Qnil. This is bad bad bad. |
6588 */ | 6588 */ |
6589 if (NILP (val)) | 6589 if (NILP (val)) |
6590 signal_type_error_2 (Qinternal_error, | 6590 signal_error_2 (Qinternal_error, |
6591 "Internal error: no text-prop", | 6591 "Internal error: no text-prop", |
6592 extent, prop); | 6592 extent, prop); |
6593 #endif | 6593 #endif |
6594 Fput_text_property (from, to, prop, val, Qnil); | 6594 Fput_text_property (from, to, prop, val, Qnil); |
6595 return Qnil; /* important! */ | 6595 return Qnil; /* important! */ |
6755 { | 6755 { |
6756 INIT_LRECORD_IMPLEMENTATION (extent); | 6756 INIT_LRECORD_IMPLEMENTATION (extent); |
6757 INIT_LRECORD_IMPLEMENTATION (extent_info); | 6757 INIT_LRECORD_IMPLEMENTATION (extent_info); |
6758 INIT_LRECORD_IMPLEMENTATION (extent_auxiliary); | 6758 INIT_LRECORD_IMPLEMENTATION (extent_auxiliary); |
6759 | 6759 |
6760 defsymbol (&Qextentp, "extentp"); | 6760 DEFSYMBOL (Qextentp); |
6761 defsymbol (&Qextent_live_p, "extent-live-p"); | 6761 DEFSYMBOL (Qextent_live_p); |
6762 | 6762 |
6763 defsymbol (&Qall_extents_closed, "all-extents-closed"); | 6763 DEFSYMBOL (Qall_extents_closed); |
6764 defsymbol (&Qall_extents_open, "all-extents-open"); | 6764 DEFSYMBOL (Qall_extents_open); |
6765 defsymbol (&Qall_extents_closed_open, "all-extents-closed-open"); | 6765 DEFSYMBOL (Qall_extents_closed_open); |
6766 defsymbol (&Qall_extents_open_closed, "all-extents-open-closed"); | 6766 DEFSYMBOL (Qall_extents_open_closed); |
6767 defsymbol (&Qstart_in_region, "start-in-region"); | 6767 DEFSYMBOL (Qstart_in_region); |
6768 defsymbol (&Qend_in_region, "end-in-region"); | 6768 DEFSYMBOL (Qend_in_region); |
6769 defsymbol (&Qstart_and_end_in_region, "start-and-end-in-region"); | 6769 DEFSYMBOL (Qstart_and_end_in_region); |
6770 defsymbol (&Qstart_or_end_in_region, "start-or-end-in-region"); | 6770 DEFSYMBOL (Qstart_or_end_in_region); |
6771 defsymbol (&Qnegate_in_region, "negate-in-region"); | 6771 DEFSYMBOL (Qnegate_in_region); |
6772 | 6772 |
6773 defsymbol (&Qdetached, "detached"); | 6773 DEFSYMBOL (Qdetached); |
6774 defsymbol (&Qdestroyed, "destroyed"); | 6774 DEFSYMBOL (Qdestroyed); |
6775 defsymbol (&Qbegin_glyph, "begin-glyph"); | 6775 DEFSYMBOL (Qbegin_glyph); |
6776 defsymbol (&Qend_glyph, "end-glyph"); | 6776 DEFSYMBOL (Qend_glyph); |
6777 defsymbol (&Qstart_open, "start-open"); | 6777 DEFSYMBOL (Qstart_open); |
6778 defsymbol (&Qend_open, "end-open"); | 6778 DEFSYMBOL (Qend_open); |
6779 defsymbol (&Qstart_closed, "start-closed"); | 6779 DEFSYMBOL (Qstart_closed); |
6780 defsymbol (&Qend_closed, "end-closed"); | 6780 DEFSYMBOL (Qend_closed); |
6781 defsymbol (&Qread_only, "read-only"); | 6781 DEFSYMBOL (Qread_only); |
6782 /* defsymbol (&Qhighlight, "highlight"); in faces.c */ | 6782 /* DEFSYMBOL (Qhighlight); in faces.c */ |
6783 defsymbol (&Qunique, "unique"); | 6783 DEFSYMBOL (Qunique); |
6784 defsymbol (&Qduplicable, "duplicable"); | 6784 DEFSYMBOL (Qduplicable); |
6785 defsymbol (&Qdetachable, "detachable"); | 6785 DEFSYMBOL (Qdetachable); |
6786 defsymbol (&Qpriority, "priority"); | 6786 DEFSYMBOL (Qpriority); |
6787 defsymbol (&Qmouse_face, "mouse-face"); | 6787 DEFSYMBOL (Qmouse_face); |
6788 defsymbol (&Qinitial_redisplay_function,"initial-redisplay-function"); | 6788 DEFSYMBOL (Qinitial_redisplay_function); |
6789 | 6789 |
6790 | 6790 |
6791 defsymbol (&Qglyph_layout, "glyph-layout"); /* backwards compatibility */ | 6791 DEFSYMBOL (Qglyph_layout); /* backwards compatibility */ |
6792 defsymbol (&Qbegin_glyph_layout, "begin-glyph-layout"); | 6792 DEFSYMBOL (Qbegin_glyph_layout); |
6793 defsymbol (&Qend_glyph_layout, "end-glyph-layout"); | 6793 DEFSYMBOL (Qend_glyph_layout); |
6794 defsymbol (&Qoutside_margin, "outside-margin"); | 6794 DEFSYMBOL (Qoutside_margin); |
6795 defsymbol (&Qinside_margin, "inside-margin"); | 6795 DEFSYMBOL (Qinside_margin); |
6796 defsymbol (&Qwhitespace, "whitespace"); | 6796 DEFSYMBOL (Qwhitespace); |
6797 /* Qtext defined in general.c */ | 6797 /* Qtext defined in general.c */ |
6798 | 6798 |
6799 defsymbol (&Qpaste_function, "paste-function"); | 6799 DEFSYMBOL (Qpaste_function); |
6800 defsymbol (&Qcopy_function, "copy-function"); | 6800 DEFSYMBOL (Qcopy_function); |
6801 | 6801 |
6802 defsymbol (&Qtext_prop, "text-prop"); | 6802 DEFSYMBOL (Qtext_prop); |
6803 defsymbol (&Qtext_prop_extent_paste_function, | 6803 DEFSYMBOL (Qtext_prop_extent_paste_function); |
6804 "text-prop-extent-paste-function"); | |
6805 | 6804 |
6806 DEFSUBR (Fextentp); | 6805 DEFSUBR (Fextentp); |
6807 DEFSUBR (Fextent_live_p); | 6806 DEFSUBR (Fextent_live_p); |
6808 DEFSUBR (Fextent_detached_p); | 6807 DEFSUBR (Fextent_detached_p); |
6809 DEFSUBR (Fextent_start_position); | 6808 DEFSUBR (Fextent_start_position); |