1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 19:31:02 -08:00
Commit graph

126 commits

Author SHA1 Message Date
Richard M. Stallman
34894ec3c7 (graft_intervals_into_buffer): Handle over_used when splitting UNDER.
Set BUF_INTERVALS (buffer)->up_obj when appropriate.
2003-09-30 12:33:19 +00:00
Richard M. Stallman
73792d68fd (graft_intervals_into_buffer): Correct the main loop
in the case where OVER is longer than UNDER.
2003-09-22 15:51:19 +00:00
Miles Bader
ab5796a9f9 Add arch taglines 2003-09-01 15:45:59 +00:00
Stefan Monnier
3e3137667f (set_point_both): Use new type for overlays_(before|after). 2003-07-09 14:49:10 +00:00
Stefan Monnier
cd505631a4 (get_local_map): Don't get char-property of previous
point any more: get_pos_property already does it and better.
2003-05-21 16:39:49 +00:00
Stefan Monnier
4867a28394 (create_root_interval, graft_intervals_into_buffer): Use BEG.
(merge_properties, intervals_equal, merge_properties_sticky): Use XCAR, XCDR.
(adjust_for_invis_intang): Pass new arg to text_property_stickiness.
(get_local_map): Use get_pos_property (for stickiness and empty overlays).
2003-05-17 18:47:18 +00:00
Richard M. Stallman
0270b8776e Fix comment typo. 2003-04-21 01:39:06 +00:00
Richard M. Stallman
727fec2d40 Add many calls to CHECK_TOTAL_LENGTH.
(set_intervals_multibyte_1): When becoming
multibyte, adjust right and left child sizes to a whole set of
characters.  If an interval gets zero total-length, delete it.
If an interval consists of just its children, delete one of them.
2003-04-06 20:32:52 +00:00
Juanma Barranquero
7d0393cf12 Fix typo in comment. 2002-10-18 10:09:43 +00:00
Ken Raeburn
b13738b697 * intervals.c (create_root_interval, balance_possible_root_interval,
delete_interval, copy_intervals_to_string): Use STRING_SET_INTERVALS.
2002-07-15 06:56:10 +00:00
Ken Raeburn
d5db40779d Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references
left unchanged for now.
2002-07-15 00:01:34 +00:00
Stefan Monnier
91b5390444 (textget): Don't forget to `return'.
(lookup_char_property): Use XCAR/XCDR.
2002-06-12 13:29:55 +00:00
Colin Walters
948fe32d39 (lookup_char_property): New function for looking up overlay and text
properties, created from textget.
(textget): Use it.
2002-06-08 20:25:17 +00:00
Miles Bader
f0dcf80149 (adjust_for_invis_intang): New function.
(set_point_both): Use `adjust_for_invis_intang' to do most of the work
for dealing with invisible+intangible regions.  Do so before and after
both forward and backward movements, to handle both front-sticky and
rear-sticky cases.
2002-03-14 08:11:46 +00:00
Richard M. Stallman
1d14d232dd (set_point_both): The position after an invisible, intangible
character is not an acceptable stopping point.
2001-12-28 05:12:42 +00:00
Pavel Janík
3a62677f47 (merge_properties_sticky): Likewise. 2001-12-09 01:03:22 +00:00
Stefan Monnier
201ffa579a (graft_intervals_into_buffer):
Don't call set_text_properties_1 on an empty interval.
2001-11-26 02:16:59 +00:00
Richard M. Stallman
34e096ed98 (graft_intervals_into_buffer):
Use set_text_properties_1 to clear out properties.
2001-11-11 20:02:58 +00:00
Pavel Janík
7a4564a4b4 (graft_intervals_into_buffer): Remove #ifdef'd-out code.
(graft_intervals_into_buffer): Remove unused variable `middle'.
2001-11-07 06:26:29 +00:00
Stefan Monnier
42005513e8 (traverse_intervals): Drop `depth' arg. 2001-10-12 22:01:46 +00:00
Stefan Monnier
19d4e9a773 (traverse_intervals): Use less stack space.
(traverse_intervals_noorder): New function.
(search_for_interval, count_intervals): Use it.
2001-10-12 21:53:44 +00:00
Stefan Monnier
8feddab4e0 Include keymap.h. 2001-10-08 11:39:52 +00:00
Gerd Moellmann
32c82ac0a1 Don't define min/max. 2001-10-08 08:08:08 +00:00
Stefan Monnier
522836336e (find_interval): Don't rebalance during signal handling. 2001-04-12 12:13:27 +00:00
Gerd Moellmann
2b4b027f3a (get_local_map): Change TYPE to Lisp_Object. 2001-01-12 11:18:20 +00:00
Eli Zaretskii
f94ecad1f5 (get_local_map): Remove unused variable `tem'. 2001-01-02 13:59:23 +00:00
Stefan Monnier
020676925c * lisp.h (KEYMAPP): New macro.
(get_keymap): Remove.
(get_keymap_1): Rename get_keymap.
* keyboard.h (get_keymap_1, Fkeymapp): Remove prototype.
* xterm.c (note_mode_line_highlight): Use KEYMAPP.
* xmenu.c (single_submenu): Use KEYMAPP.
(Fx_popup_menu): Fetch keymaps rather than checking Fkeymapp.
Use KEYMAPP rather than Fkeymapp.
* w32term.c (note_mode_line_highlight): Use KEYMAPP.
* w32menu.c (True, False): Remove (use TRUE and FALSE instead).
(Fx_popup_menu): Fetch keymaps rather than checking Fkeymapp.
Use KEYMAPP rather than Fkeymapp.
(single_submenu): Use KEYMAPP.
(w32_menu_show, w32_dialog_show): Use TRUE.
* minibuf.c (Fread_from_minibuffer): Update call to get_keymap.
* keymap.c (KEYMAPP): Remove (moved to lisp.h).
(Fkeymapp): Use KEYMAPP.
(get_keymap): Rename from get_keymap_1.  Remove old def.
Return t when autoload=0 and error=0 and the keymap needs autoloading.
(Fcopy_keymap): Check (eq (car x) 'keymap) rather than using Fkeymapp.
(Fminor_mode_key_binding): Don't raise an error if the binding
is not a keymap.
(Fuse_global_map, Fuse_local_map): Allow autoloading.
(Faccessible_keymaps): Fetch keymaps rather than checking Fkeymapp.
* keyboard.c (read_char): get_keymap_1 -> get_keymap.
Allow Vspecial_event_map to be autoloaded.
(menu_bar_items): Fetch the keymap rather than using keymapp.
(menu_bar_one_keymap): No need to follow func-indirect any more.
(parse_menu_item): get_keymap_1 -> get_keymap.
(tool_bar_items): Fetch the keymap rather than using keymapp.
(read_key_sequence): Use KEYMAPP.
* intervals.c (get_local_map): Use get_keymap rather than following
function-indirections explicitly.
* doc.c (Fsubstitute_command_keys): get_keymap_1 -> get_keymap.
2000-10-27 22:20:19 +00:00
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