1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 20:00:46 -08:00
Commit graph

99 commits

Author SHA1 Message Date
Dave Love
6a7dccef4a (get_local_map): Extra arg to allow looking for `keymap' too. 2000-05-29 11:41:13 +00:00
Ken Raeburn
e0b8c689e2 Stop assuming interval pointers and lisp objects can be distinguished by
inspection.  Beginnings of support for expensive internal consistency checks.

* config.in (ENABLE_CHECKING): Undef.

* lisp.h (struct interval): Replace "parent" field with a union of interval
pointer and Lisp_Object; add new bitfield to use as discriminant.  Change other
flag fields to bitfields.
(CHECK): New macro for consistency checking.  If ENABLE_CHECKING is defined and
the supplied test fails, print a message and abort.
(eassert): New macro.  Use CHECK to provide an assert-like facility.

* intervals.h (NULL_INTERVAL_P): Now applies only to real interval pointers;
abort if the value looks like a lisp object.
(NULL_INTERVAL_P, NULL_PARENT, HAS_PARENT, HAS_OBJECT, SET_PARENT, SET_OBJECT,
INTERVAL_PARENT, GET_INTERVAL_OBJECT, COPY_PARENT): Modify for new interval
parent definition.

* alloc.c (mark_interval_tree, MARK_INTERVAL_TREE, UNMARK_BALANCE_INTERVALS):
Update references that need an addressable lisp object in the interval
structure.
(die): New function.
(suppress_checking): New variable.

* intervals.c (interval_start_pos): Just return 0 if there's no parent object.
2000-03-29 22:14:34 +00:00
Ken Raeburn
439d5cb4f7 Changes towards better type safety regarding intervals, primarily
regarding the "parent" handle.  These just separate out the different
usages based on the type of parent (interval vs lisp object); later
changes will do type checking and enforcement.

	* intervals.h (NULL_INTERVAL): Cast to INTERVAL type.
	(INT_LISPLIKE): New macro.
	(NULL_INTERVAL_P): Use it.
	(INTERVAL_HAS_PARENT, INTERVAL_HAS_OBJECT, SET_INTERVAL_PARENT,
	SET_INTERVAL_OBJECT, INTERVAL_PARENT, COPY_INTERVAL_PARENT,
	GET_INTERVAL_OBJECT, INTERVAL_PARENT_OR_NULL): New macros.

	* alloc.c (make_interval, gc_sweep): Use new macros; eliminate all
	explicit references to "parent" field of struct interval and
	associated unclean type conversions.
	* intervals.c (create_root_interval, root_interval, rotate_right,
	rotate_left, balance_possible_root_interval, split_interval_right,
	split_interval_left, interval_start_pos, find_interval,
	next_interval, previous_interval, update_interval,
	adjust_intervals_for_insertion, delete_node, delete_interval,
	adjust_intervals_for_deletion, merge_interval_right,
	merge_interval_left, reproduce_tree, graft_intervals_into_buffer,
	copy_intervals_to_string): Likewise.
	* intervals.h (AM_LEFT_CHILD, AM_RIGHT_CHILD, RESET_INTERVAL):
	Likewise.
	* syntax.c (update_syntax_table): Likewise.

	* intervals.c (reproduce_tree_obj): New function, like
	reproduce_tree but takes a Lisp_Object for the parent.  Declare
	with prototype.
	(graft_intervals_into_buffer): Use it when appropriate.
	(reproduce_tree): Declare with prototype.
	(balance_possible_root_interval): Check that the parent is a lisp
	object before trying to examine its type.
2000-03-22 21:44:05 +00:00
Kenichi Handa
f56b42ac9e (adjust_intervals_for_insertion): To check stickines
of properties, pay attention to text-property-default-nonsticky.
(merge_properties_sticky): Likewise.
(get_property_and_range): New function.
1999-12-15 00:14:44 +00:00
Gerd Moellmann
339ee9797d Remove USE_TEXT_PROPERTIES. 1999-11-11 11:45:06 +00:00
Phillip Rulon
b988a84237 (get_local_map): Use indirect_function,
not Findirect_function.
1999-10-09 00:50:15 +00:00
Gerd Moellmann
e39adcdab9 (rotate_right, rotate_left): Add braces to avoid
ambiguous else warning.
(split_interval_left): Remove unused variables.
(previous_interval, adjust_intervals_for_deletion,
set_point_both, set_point_both, set_intervals_multibyte_1): Ditto.
(icount, idepth, zero_length): Move into #if 0 section below
original position where these are used.
1999-09-16 20:19:57 +00:00
Ken Raeburn
03699b140e Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access. 1999-09-13 02:23:04 +00:00
Richard M. Stallman
887f2a2d78 Comment changes. 1999-07-01 14:16:44 +00:00
Richard M. Stallman
6445414a59 (graft_intervals_into_buffer): Turn off
inhibit_modification_hooks around calling Fset_text_properties.
1999-04-06 08:49:28 +00:00
Karl Heuer
944d4e4b40 (create_root_interval): Initialize position to 0
for a string.
(interval_start_pos): New function.
(find_interval): Handle string positions starting at 0.
(adjust_intervals_for_insertion): Likewise.
(adjust_intervals_for_deletion): Likewise.
(compare_string_intervals): Likewise.
(graft_intervals_into_buffer): Set `position' in reproduce_tree value.
(copy_intervals): Init `position' to 0.
1998-06-03 14:44:21 +00:00
Andreas Schwab
dfcf069d56 Fix -Wimplicit warnings. 1998-04-14 12:25:56 +00:00
Richard M. Stallman
24cef2618f (set_intervals_multibyte): Function moved after set_intervals_multibyte_1. 1998-04-03 23:58:11 +00:00
Richard M. Stallman
75167cd4e4 (update_interval): Properly update `position' field of used intervals. 1998-03-02 02:41:28 +00:00
Kenichi Handa
2189766e34 (temp_set_point_both): Declare arg BYTEPOS as int.
(set_point_both): Likewise.
1998-02-20 01:40:47 +00:00
Richard M. Stallman
cc6e2aaa2a (split_interval_right): Make sure to call
balance_possible_root_interval in case an interval doesn't have a
right child, because otherwise the interval tree might degenerate into
a list.

(split_interval_left): Ditto if an interval hasn't a left child.
1998-02-16 23:46:08 +00:00
Richard M. Stallman
31c8f88101 Update copyright year. 1998-01-21 22:22:17 +00:00
Richard M. Stallman
37f26f3c5a (set_intervals_multibyte): New function.
(set_intervals_multibyte_1): New function.
1998-01-19 19:30:38 +00:00
Richard M. Stallman
ef1900f30c (set_point_both): Renamed from set_point;
New arg BYTE; BUFFER is now first arg; use temp_set_point_both.
(set_point): New function; uses set_point_both.
(temp_set_point_both): New function.
(temp_set_point): Update BUF_PT_BYTE.
(get_local_map): Save and restore both forms of the buffer bounds.
1998-01-01 07:08:33 +00:00
Andreas Schwab
0c60dfd7b4 (traverse_intervals): Protoize parameter. 1997-11-21 15:07:57 +00:00
Richard M. Stallman
4dcb3ee353 (set_point): Convert call2 arguments to Lisp_Integer. 1997-07-12 06:42:44 +00:00
Richard M. Stallman
2e34157cd9 Fix bugs with inappropriate mixing of Lisp_Object with int. 1997-07-04 20:44:52 +00:00
Richard M. Stallman
1863bbf894 (find_interval): No longer inline. 1997-06-02 18:30:21 +00:00
Richard M. Stallman
5509c7ff85 (move_if_not_intangible): Fix previous change. 1997-05-31 08:34:13 +00:00
Richard M. Stallman
a7fa233fe7 (move_if_not_intangible): New function. 1997-05-31 07:38:44 +00:00
Richard M. Stallman
b745025d2d Update copyright year. 1997-04-15 04:56:39 +00:00
Richard M. Stallman
25eeac41e0 (update_interval): New function. 1997-04-15 04:45:26 +00:00
Richard M. Stallman
ca41a64d00 (set_point): Use virtual bounds, not real bounds,
in the abort test for POSITION.
Skip the intangibility test if POSITION is at either end of buffer.
1996-12-20 18:15:52 +00:00
Richard M. Stallman
b827a9e32b (set_point): Use virtual bounds, not real bounds,
in the abort test for POSITION.
Skip the intangibility test if POSITION is at either end of buffer.
1996-12-18 06:30:59 +00:00
Richard M. Stallman
4ab19eb30d (merge_properties_sticky): Don't discard explicit nil
properties.  Don't put on a front-sticky property if we inherit
one from the category that does the job.
1996-12-17 07:25:35 +00:00
Richard M. Stallman
580fae9403 (set_point): Check for intangible properties on overlays. 1996-12-15 04:58:53 +00:00
Richard M. Stallman
4a9f44cd82 (get_local_map): Call indirect-function. 1996-09-04 15:40:46 +00:00
Richard M. Stallman
46d8a55bd1 (copy_intervals_to_string): Take arg as buffer. 1996-09-04 04:33:40 +00:00
Erik Naggum
8f3b9b9586 (balance_intervals_internal): Recurse directly. 1996-07-20 04:44:09 +00:00
Erik Naggum
3b7ad313e0 Update FSF's address in the preamble. 1996-01-15 09:18:04 +00:00
Karl Heuer
8e6208c5d2 Comment fixes. 1996-01-05 10:03:17 +00:00
Richard M. Stallman
40648b6832 (call_mod_hooks, verify_interval_modification):
Functions moved to textprop.c.
1995-09-12 17:37:53 +00:00
Karl Heuer
0f7a5fda79 (get_local_map): Use Fget_char_property, so that
overlay properties will be considered as well as text properties.
1995-05-02 23:06:11 +00:00
Richard M. Stallman
5eabb4e7ee (set_point): When skipping intangible text,
stop where property value changes.
1995-04-09 09:42:28 +00:00
Karl Heuer
f8c25f1b67 Update copyright. 1995-04-07 02:21:52 +00:00
Boris Goldowsky
06d9232749 (Vdefault_text_properties): name changed from Vdefault_properties.
(textget_direct): Fn deleted.
(textget, verify_interval_modification): Use Fplist_get instead.
1995-03-27 16:05:57 +00:00
Boris Goldowsky
70743ff117 (textget): Check default_properties vbl too. 1995-03-06 15:43:56 +00:00
Richard M. Stallman
b6a0ebc300 (set_point): Set point_before_scroll to nil. 1995-01-27 07:19:06 +00:00
Richard M. Stallman
e5d967c90e Use BUF_INTERVALS throughout.
(temp_set_point, set_point): Use BUF_PT.
(get_local_map): Get keymap from specified buffer, not current one.
1995-01-02 21:38:22 +00:00
Richard M. Stallman
d8638d30b5 (compare_string_intervals): New function. 1994-12-04 21:07:03 +00:00
Karl Heuer
9bdff5c5c7 (verify_interval_modification): Fix comment. 1994-10-12 02:11:34 +00:00
Karl Heuer
55cfc73193 (graft_intervals_into_buffer): Use new accessor macros instead of calling XSET
directly.
1994-10-04 12:10:17 +00:00
Karl Heuer
b629dd47e0 (create_root_interval, balance_possible_root_interval, delete_interval): Use
type test macros.
1994-09-27 02:30:34 +00:00
Richard M. Stallman
d5219de56e (set_point): If Vinhibit_point_motion_hooks, ignore intangible properties.
If move backwards into intangible text, move back over it.
1994-09-24 09:13:57 +00:00
Karl Heuer
f54a8c1a1f Add #include "keyboard.h" 1994-09-19 00:12:39 +00:00