/* Code for doing intervals.
Copyright (C) 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003, 2004,
/* Code for doing intervals.
Copyright (C) 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Since the left child is longer, there must be one. */
new_diff = i->total_length - i->left->total_length
+ RIGHT_TOTAL_LENGTH (i->left) - LEFT_TOTAL_LENGTH (i->left);
/* Since the left child is longer, there must be one. */
new_diff = i->total_length - i->left->total_length
+ RIGHT_TOTAL_LENGTH (i->left) - LEFT_TOTAL_LENGTH (i->left);
/* Since the right child is longer, there must be one. */
new_diff = i->total_length - i->right->total_length
+ LEFT_TOTAL_LENGTH (i->right) - RIGHT_TOTAL_LENGTH (i->right);
/* Since the right child is longer, there must be one. */
new_diff = i->total_length - i->right->total_length
+ LEFT_TOTAL_LENGTH (i->right) - RIGHT_TOTAL_LENGTH (i->right);
{
temp_set_point_both (buffer, charpos,
buf_charpos_to_bytepos (buffer, charpos));
{
temp_set_point_both (buffer, charpos,
buf_charpos_to_bytepos (buffer, charpos));
-temp_set_point_both (buffer, charpos, bytepos)
- int charpos, bytepos;
- struct buffer *buffer;
+temp_set_point_both (struct buffer *buffer,
+ EMACS_INT charpos, EMACS_INT bytepos)
{
/* In a single-byte buffer, the two positions must be equal. */
if (BUF_ZV (buffer) == BUF_ZV_BYTE (buffer)
{
/* In a single-byte buffer, the two positions must be equal. */
if (BUF_ZV (buffer) == BUF_ZV_BYTE (buffer)
- set_point_both (buffer, charpos, buf_charpos_to_bytepos (buffer, charpos));
+ set_point_both (charpos, buf_charpos_to_bytepos (current_buffer, charpos));
-set_point_both (buffer, charpos, bytepos)
- register struct buffer *buffer;
- register int charpos, bytepos;
+set_point_both (EMACS_INT charpos, EMACS_INT bytepos)
{
register INTERVAL to, from, toprev, fromprev;
{
register INTERVAL to, from, toprev, fromprev;
/* This ensures that we move forward past intangible text when the
initial position is the same as the destination, in the rare
instances where this is important, e.g. in line-move-finish
(simple.el). */
int backwards = (charpos < old_position ? 1 : 0);
int have_overlays;
/* This ensures that we move forward past intangible text when the
initial position is the same as the destination, in the rare
instances where this is important, e.g. in line-move-finish
(simple.el). */
int backwards = (charpos < old_position ? 1 : 0);
int have_overlays;
/* Check this now, before checking if the buffer has any intervals.
That way, we can catch conditions which break this sanity check
whether or not there are intervals in the buffer. */
/* Check this now, before checking if the buffer has any intervals.
That way, we can catch conditions which break this sanity check
whether or not there are intervals in the buffer. */
/* If we have no text properties and overlays,
then we can do it quickly. */
/* If we have no text properties and overlays,
then we can do it quickly. */
return;
}
/* Set TO to the interval containing the char after CHARPOS,
and TOPREV to the interval containing the char before CHARPOS.
Either one may be null. They may be equal. */
return;
}
/* Set TO to the interval containing the char after CHARPOS,
and TOPREV to the interval containing the char before CHARPOS.
Either one may be null. They may be equal. */
/* Set FROM to the interval containing the char after PT,
and FROMPREV to the interval containing the char before PT.
Either one may be null. They may be equal. */
/* We could cache this and save time. */
/* Set FROM to the interval containing the char after PT,
and FROMPREV to the interval containing the char before PT.
Either one may be null. They may be equal. */
/* We could cache this and save time. */
- from = find_interval (BUF_INTERVALS (buffer), buffer_point);
- if (buffer_point == BUF_BEGV (buffer))
+ from = find_interval (BUF_INTERVALS (current_buffer), buffer_point);
+ if (buffer_point == BEGV)
&& EQ (Fget_char_property (pos, Qintangible, Qnil),
intangible_propval))
pos = Fnext_char_property_change (pos, Qnil);
&& EQ (Fget_char_property (pos, Qintangible, Qnil),
intangible_propval))
pos = Fnext_char_property_change (pos, Qnil);
/* Set TO to the interval containing the char after CHARPOS,
and TOPREV to the interval containing the char before CHARPOS.
Either one may be null. They may be equal. */
/* Set TO to the interval containing the char after CHARPOS,
and TOPREV to the interval containing the char before CHARPOS.
Either one may be null. They may be equal. */
two intervals are not equivalent. These hooks take
(old_point, new_point) as arguments. */
if (NILP (Vinhibit_point_motion_hooks)
two intervals are not equivalent. These hooks take
(old_point, new_point) as arguments. */
if (NILP (Vinhibit_point_motion_hooks)
get_property_and_range (pos, prop, val, start, end, object)
int pos;
Lisp_Object prop, *val;
get_property_and_range (pos, prop, val, start, end, object)
int pos;
Lisp_Object prop, *val;