del_range (wordstart, wordstart + 1);
}
if (!wordstart)
- wordstart = scan_words (point, -1);
+ wordstart = scan_words (PT, -1);
if (!wordstart)
return value;
if (!wordend)
return value;
- if (wordend > point)
- wordend = point;
- whitecnt = point - wordend;
+ if (wordend > PT)
+ wordend = PT;
+ whitecnt = PT - wordend;
if (wordend <= wordstart)
return value;
expansion = XSYMBOL (sym)->value;
insert_from_string (expansion, 0, XSTRING (expansion)->size, 1);
- SET_PT (point + whitecnt);
+ SET_PT (PT + whitecnt);
if (uccount && !lccount)
{
/* This used to be if (!... && ... >= ...) Fcapitalize; else Fupcase
but Megatest 68000 compiler can't handle that */
if (!abbrev_all_caps)
- if (scan_words (point, -1) > scan_words (wordstart, 1))
+ if (scan_words (PT, -1) > scan_words (wordstart, 1))
{
Fupcase_initials_region (make_number (wordstart),
- make_number (point));
+ make_number (PT));
goto caped;
}
/* If expansion is one word, or if user says so, upcase it all. */
- Fupcase_region (make_number (wordstart), make_number (point));
+ Fupcase_region (make_number (wordstart), make_number (PT));
caped: ;
}
else if (uccount)
int pos = wordstart;
/* Find the initial. */
- while (pos < point
+ while (pos < PT
&& SYNTAX (*BUF_CHAR_ADDRESS (current_buffer, pos)) != Sword)
pos++;
is not undone.")
()
{
- int opoint = point;
+ int opoint = PT;
int adjust = 0;
if (last_abbrev_point < BEGV
|| last_abbrev_point > ZV)
if (!STRINGP (val))
error ("value of abbrev-symbol must be a string");
adjust = XSTRING (val)->size;
- del_range (point, point + adjust);
+ del_range (PT, PT + adjust);
/* Don't inherit properties here; just copy from old contents. */
insert_from_string (Vlast_abbrev_text, 0,
XSTRING (Vlast_abbrev_text)->size, 0);
break;
case Bpoint:
- XSETFASTINT (v1, point);
+ XSETFASTINT (v1, PT);
PUSH (v1);
break;
/* visargs[i+1] = Qnil; */
foo = marker_position (current_buffer->mark);
/* visargs[i] = Qnil; */
- args[i] = point < foo ? point_marker : current_buffer->mark;
+ args[i] = PT < foo ? point_marker : current_buffer->mark;
varies[i] = 3;
- args[++i] = point > foo ? point_marker : current_buffer->mark;
+ args[++i] = PT > foo ? point_marker : current_buffer->mark;
varies[i] = 4;
break;
CHECK_NUMBER (arg, 0);
iarg = XINT (arg);
- farend = scan_words (point, iarg);
+ farend = scan_words (PT, iarg);
if (!farend)
farend = iarg > 0 ? ZV : BEGV;
- *newpoint = point > farend ? point : farend;
+ *newpoint = PT > farend ? PT : farend;
XSETFASTINT (val, farend);
return val;
{
Lisp_Object beg, end;
int newpoint;
- XSETFASTINT (beg, point);
+ XSETFASTINT (beg, PT);
end = operate_on_word (arg, &newpoint);
casify_region (CASE_UP, beg, end);
SET_PT (newpoint);
{
Lisp_Object beg, end;
int newpoint;
- XSETFASTINT (beg, point);
+ XSETFASTINT (beg, PT);
end = operate_on_word (arg, &newpoint);
casify_region (CASE_DOWN, beg, end);
SET_PT (newpoint);
{
Lisp_Object beg, end;
int newpoint;
- XSETFASTINT (beg, point);
+ XSETFASTINT (beg, PT);
end = operate_on_word (arg, &newpoint);
casify_region (CASE_CAPITALIZE, beg, end);
SET_PT (newpoint);
hooks, etcetera), that's not a good approach. So we validate the
proposed position, then set point. */
{
- int new_point = point + XINT (n);
+ int new_point = PT + XINT (n);
if (new_point < BEGV)
{
(n)
Lisp_Object n;
{
- int pos2 = point;
+ int pos2 = PT;
int pos;
int count, shortage, negp;
{
if (XINT (n) < 0)
{
- if (point + XINT (n) < BEGV)
+ if (PT + XINT (n) < BEGV)
Fsignal (Qbeginning_of_buffer, Qnil);
else
- del_range (point + XINT (n), point);
+ del_range (PT + XINT (n), PT);
}
else
{
- if (point + XINT (n) > ZV)
+ if (PT + XINT (n) > ZV)
Fsignal (Qend_of_buffer, Qnil);
else
- del_range (point, point + XINT (n));
+ del_range (PT, PT + XINT (n));
}
}
else
/* See if we are about to delete a tab or newline backwards. */
for (i = 1; i <= XINT (n); i++)
{
- if (point - i < BEGV)
+ if (PT - i < BEGV)
break;
- if (FETCH_CHAR (point - i) == '\t' || FETCH_CHAR (point - i) == '\n')
+ if (FETCH_CHAR (PT - i) == '\t' || FETCH_CHAR (PT - i) == '\n')
{
deleted_special = 1;
break;
if (XINT (n) > 0
&& ! NILP (current_buffer->overwrite_mode)
&& ! deleted_special
- && ! (point == ZV || FETCH_CHAR (point) == '\n'))
+ && ! (PT == ZV || FETCH_CHAR (PT) == '\n'))
{
Finsert_char (make_number (' '), XINT (n));
- SET_PT (point - XINT (n));
+ SET_PT (PT - XINT (n));
}
return value;
hairy = 1;
if (!NILP (overwrite)
- && point < ZV
+ && PT < ZV
&& (EQ (overwrite, Qoverwrite_mode_binary)
- || (c != '\n' && FETCH_CHAR (point) != '\n'))
+ || (c != '\n' && FETCH_CHAR (PT) != '\n'))
&& (EQ (overwrite, Qoverwrite_mode_binary)
- || FETCH_CHAR (point) != '\t'
+ || FETCH_CHAR (PT) != '\t'
|| XINT (current_buffer->tab_width) <= 0
|| XFASTINT (current_buffer->tab_width) > 20
|| !((current_column () + 1) % XFASTINT (current_buffer->tab_width))))
{
- del_range (point, point + 1);
+ del_range (PT, PT + 1);
hairy = 2;
}
if (!NILP (current_buffer->abbrev_mode)
&& SYNTAX (c) != Sword
&& NILP (current_buffer->read_only)
- && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword)
+ && PT > BEGV && SYNTAX (FETCH_CHAR (PT - 1)) == Sword)
{
int modiff = MODIFF;
Fexpand_abbrev ();
/* After inserting a newline, move to previous line and fill */
/* that. Must have the newline in place already so filling and */
/* justification, if any, know where the end is going to be. */
- SET_PT (point - 1);
+ SET_PT (PT - 1);
tem = call0 (current_buffer->auto_fill_function);
if (c1 == '\n')
- SET_PT (point + 1);
+ SET_PT (PT + 1);
if (!NILP (tem))
hairy = 2;
}
At the moment we only lose at end of line or end of buffer
and only with faces that have some background */
/* Instead of wasting time, give up if character has any text properties */
- || ! NILP (Ftext_properties_at (make_number (point - 1), Qnil))
+ || ! NILP (Ftext_properties_at (make_number (PT - 1), Qnil))
#endif
/* Give up if w is minibuffer and a message is being displayed there */
int dummy;
if (FRAME_WINDOW_P (frame) || FRAME_MSDOS_P (frame))
- face = compute_char_face (frame, w, point - 1, -1, -1, &dummy, point, 0);
+ face = compute_char_face (frame, w, PT - 1, -1, -1, &dummy, PT, 0);
#endif
current_frame->glyphs[vpos][hpos] = MAKE_GLYPH (frame, g, face);
- current_frame->charstarts[vpos][hpos] = point - 1;
+ current_frame->charstarts[vpos][hpos] = PT - 1;
/* Record the entry for after the newly inserted character. */
- current_frame->charstarts[vpos][hpos + 1] = point;
+ current_frame->charstarts[vpos][hpos + 1] = PT;
adjust_window_charstarts (w, vpos, 1);
}
unchanged_modified = MODIFF;
beg_unchanged = GPT - BEG;
- XSETFASTINT (w->last_point, point);
+ XSETFASTINT (w->last_point, PT);
XSETFASTINT (w->last_point_x, hpos);
XSETFASTINT (w->last_modified, MODIFF);
/* Don't use direct output next to an invisible character
since we might need to do something special. */
- XSETFASTINT (position, point);
+ XSETFASTINT (position, PT);
if (XFASTINT (position) < ZV
&& ! NILP (Fget_char_property (position,
Qinvisible,
selected_window)))
return 0;
- XSETFASTINT (position, point - 1);
+ XSETFASTINT (position, PT - 1);
if (XFASTINT (position) >= BEGV
&& ! NILP (Fget_char_property (position,
Qinvisible,
FRAME_CURSOR_X (frame) += n;
XSETFASTINT (w->last_point_x, FRAME_CURSOR_X (frame));
- XSETFASTINT (w->last_point, point);
+ XSETFASTINT (w->last_point, PT);
cursor_to (FRAME_CURSOR_Y (frame), FRAME_CURSOR_X (frame));
fflush (stdout);
()
{
Lisp_Object temp;
- XSETFASTINT (temp, point);
+ XSETFASTINT (temp, PT);
return temp;
}
"Return value of point, as a marker object.")
()
{
- return buildmark (point);
+ return buildmark (PT);
}
int
Fsignal (Qmark_inactive, Qnil);
m = Fmarker_position (current_buffer->mark);
if (NILP (m)) error ("There is no region now");
- if ((point < XFASTINT (m)) == beginningp)
- return (make_number (point));
+ if ((PT < XFASTINT (m)) == beginningp)
+ return (make_number (PT));
else
return (m);
}
()
{
Lisp_Object temp;
- if (point >= ZV)
+ if (PT >= ZV)
XSETFASTINT (temp, 0);
else
- XSETFASTINT (temp, FETCH_CHAR (point));
+ XSETFASTINT (temp, FETCH_CHAR (PT));
return temp;
}
()
{
Lisp_Object temp;
- if (point <= BEGV)
+ if (PT <= BEGV)
XSETFASTINT (temp, 0);
else
- XSETFASTINT (temp, FETCH_CHAR (point - 1));
+ XSETFASTINT (temp, FETCH_CHAR (PT - 1));
return temp;
}
If the buffer is narrowed, this means the beginning of the narrowed part.")
()
{
- if (point == BEGV)
+ if (PT == BEGV)
return Qt;
return Qnil;
}
If the buffer is narrowed, this means the end of the narrowed part.")
()
{
- if (point == ZV)
+ if (PT == ZV)
return Qt;
return Qnil;
}
"Return T if point is at the beginning of a line.")
()
{
- if (point == BEGV || FETCH_CHAR (point - 1) == '\n')
+ if (PT == BEGV || FETCH_CHAR (PT - 1) == '\n')
return Qt;
return Qnil;
}
`End of a line' includes point being at the end of the buffer.")
()
{
- if (point == ZV || FETCH_CHAR (point) == '\n')
+ if (PT == ZV || FETCH_CHAR (PT) == '\n')
return Qt;
return Qnil;
}
BEGV = XFASTINT (start);
SET_BUF_ZV (current_buffer, XFASTINT (end));
- if (point < XFASTINT (start))
+ if (PT < XFASTINT (start))
SET_PT (XFASTINT (start));
- if (point > XFASTINT (end))
+ if (PT > XFASTINT (end))
SET_PT (XFASTINT (end));
current_buffer->clip_changed = 1;
/* Changing the buffer bounds invalidates any recorded current column. */
register struct Lisp_Char_Table *dp = buffer_display_table ();
int stopchar;
- if (point == last_known_column_point
+ if (PT == last_known_column_point
&& MODIFF == last_known_column_modified)
return last_known_column;
if (BUF_INTERVALS (current_buffer)
|| !NILP (current_buffer->overlays_before)
|| !NILP (current_buffer->overlays_after))
- return current_column_1 (point);
+ return current_column_1 (PT);
/* Scan backwards from point to the previous newline,
counting width. Tab characters are the only complicated case. */
/* Make a pointer for decrementing through the chars before point. */
- ptr = &FETCH_CHAR (point - 1) + 1;
+ ptr = &FETCH_CHAR (PT - 1) + 1;
/* Make a pointer to where consecutive chars leave off,
going backwards from point. */
- if (point == BEGV)
+ if (PT == BEGV)
stop = ptr;
- else if (point <= GPT || BEGV > GPT)
+ else if (PT <= GPT || BEGV > GPT)
stop = BEGV_ADDR;
else
stop = GAP_END_ADDR;
}
last_known_column = col;
- last_known_column_point = point;
+ last_known_column_point = PT;
last_known_column_modified = MODIFF;
return col;
endloop:
last_known_column = col;
- last_known_column_point = point;
+ last_known_column_point = PT;
last_known_column_modified = MODIFF;
return col;
Finsert_char (make_number (' '), column, Qt);
last_known_column = mincol;
- last_known_column_point = point;
+ last_known_column_point = PT;
last_known_column_modified = MODIFF;
XSETINT (column, mincol);
{
Lisp_Object val;
- XSETFASTINT (val, position_indentation (find_next_newline (point, -1)));
+ XSETFASTINT (val, position_indentation (find_next_newline (PT, -1)));
return val;
}
CHECK_NATNUM (column, 0);
goal = XINT (column);
- pos = point;
+ pos = PT;
end = ZV;
next_boundary = pos;
{
int old_point;
- del_range (point - 1, point);
+ del_range (PT - 1, PT);
Findent_to (make_number (goal), Qnil);
- old_point = point;
+ old_point = PT;
Findent_to (make_number (col), Qnil);
SET_PT (old_point);
/* Set the last_known... vars consistently. */
Findent_to (make_number (col = goal), Qnil);
last_known_column = col;
- last_known_column_point = point;
+ last_known_column_point = PT;
last_known_column_modified = MODIFF;
XSETFASTINT (val, col);
else
window = selected_window;
- pos = *vmotion (point, (int) XINT (lines), XWINDOW (window));
+ pos = *vmotion (PT, (int) XINT (lines), XWINDOW (window));
SET_PT (pos.bufpos);
return make_number (pos.vpos);
else if (BUFFERP (readcharfun))
{
if (XBUFFER (readcharfun) == current_buffer)
- SET_PT (point - 1);
+ SET_PT (PT - 1);
else
SET_BUF_PT (XBUFFER (readcharfun), BUF_PT (XBUFFER (readcharfun)) - 1);
}
error ("Marker does not point anywhere"); \
if (XMARKER (original)->buffer != current_buffer) \
set_buffer_internal (XMARKER (original)->buffer); \
- old_point = point; \
+ old_point = PT; \
SET_PT (marker_position (printcharfun)); \
- start_point = point; \
+ start_point = PT; \
printcharfun = Qnil;} \
if (NILP (printcharfun)) \
{ \
insert (print_buffer, print_buffer_pos); \
if (print_buffer) free (print_buffer); \
if (MARKERP (original)) \
- Fset_marker (original, make_number (point), Qnil); \
+ Fset_marker (original, make_number (PT), Qnil); \
if (old_point >= 0) \
SET_PT (old_point + (old_point >= start_point \
- ? point - start_point : 0)); \
+ ? PT - start_point : 0)); \
if (old != current_buffer) \
set_buffer_internal (old)
odeactivate = Vdeactivate_mark;
Fset_buffer (p->buffer);
- opoint = point;
+ opoint = PT;
old_read_only = current_buffer->read_only;
XSETFASTINT (old_begv, BEGV);
XSETFASTINT (old_zv, ZV);
/* If the output marker is outside of the visible region, save
the restriction and widen. */
- if (! (BEGV <= point && point <= ZV))
+ if (! (BEGV <= PT && PT <= ZV))
Fwiden ();
/* Make sure opoint floats ahead of any new text, just as point
would. */
- if (point <= opoint)
+ if (PT <= opoint)
opoint += nchars;
/* Insert after old_begv, but before old_zv. */
- if (point < XFASTINT (old_begv))
+ if (PT < XFASTINT (old_begv))
XSETFASTINT (old_begv, XFASTINT (old_begv) + nchars);
- if (point <= XFASTINT (old_zv))
+ if (PT <= XFASTINT (old_zv))
XSETFASTINT (old_zv, XFASTINT (old_zv) + nchars);
/* Insert before markers in case we are inserting where
the buffer's mark is, and the user's next command is Meta-y. */
insert_before_markers (chars, nchars);
- Fset_marker (p->mark, make_number (point), p->buffer);
+ Fset_marker (p->mark, make_number (PT), p->buffer);
update_mode_lines++;
if (NILP (XBUFFER (buffer)->name))
continue;
Fset_buffer (buffer);
- opoint = point;
+ opoint = PT;
/* Insert new output into buffer
at the current end-of-output marker,
thus preserving logical ordering of input and output. */
SET_PT (marker_position (p->mark));
else
SET_PT (ZV);
- if (point <= opoint)
+ if (PT <= opoint)
opoint += XSTRING (msg)->size + XSTRING (p->name)->size + 10;
tem = current_buffer->read_only;
insert_string (" ");
Finsert (1, &msg);
current_buffer->read_only = tem;
- Fset_marker (p->mark, make_number (point), p->buffer);
+ Fset_marker (p->mark, make_number (PT), p->buffer);
SET_PT (opoint);
set_buffer_internal (old);
}
i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
- point - BEGV, &search_regs,
+ PT - BEGV, &search_regs,
ZV - BEGV);
if (i == -2)
matcher_overflow ();
fastmap[i] ^= 1;
{
- int start_point = point;
+ int start_point = PT;
immediate_quit = 1;
if (syntaxp)
if (forwardp)
{
- while (point < XINT (lim)
- && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (point))]])
- SET_PT (point + 1);
+ while (PT < XINT (lim)
+ && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (PT))]])
+ SET_PT (PT + 1);
}
else
{
- while (point > XINT (lim)
- && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (point - 1))]])
- SET_PT (point - 1);
+ while (PT > XINT (lim)
+ && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (PT - 1))]])
+ SET_PT (PT - 1);
}
}
else
{
if (forwardp)
{
- while (point < XINT (lim) && fastmap[FETCH_CHAR (point)])
- SET_PT (point + 1);
+ while (PT < XINT (lim) && fastmap[FETCH_CHAR (PT)])
+ SET_PT (PT + 1);
}
else
{
- while (point > XINT (lim) && fastmap[FETCH_CHAR (point - 1)])
- SET_PT (point - 1);
+ while (PT > XINT (lim) && fastmap[FETCH_CHAR (PT - 1)])
+ SET_PT (PT - 1);
}
}
immediate_quit = 0;
- return make_number (point - start_point);
+ return make_number (PT - start_point);
}
}
\f
{
CHECK_NUMBER_COERCE_MARKER (bound, 1);
lim = XINT (bound);
- if (n > 0 ? lim < point : lim > point)
+ if (n > 0 ? lim < PT : lim > PT)
error ("Invalid search bound (wrong side of point)");
if (lim > ZV)
lim = ZV;
lim = BEGV;
}
- np = search_buffer (string, point, lim, n, RE,
+ np = search_buffer (string, PT, lim, n, RE,
(!NILP (current_buffer->case_fold_search)
? XCHAR_TABLE (current_buffer->case_canon_table)->contents
: 0),
for (pos = 0; pos < XSTRING (newtext)->size; pos++)
{
- int offset = point - search_regs.start[sub];
+ int offset = PT - search_regs.start[sub];
c = XSTRING (newtext)->data[pos];
if (c == '\\')
UNGCPRO;
}
- inslen = point - (search_regs.start[sub]);
+ inslen = PT - (search_regs.start[sub]);
del_range (search_regs.start[sub] + inslen, search_regs.end[sub] + inslen);
if (case_action == all_caps)
- Fupcase_region (make_number (point - inslen), make_number (point));
+ Fupcase_region (make_number (PT - inslen), make_number (PT));
else if (case_action == cap_initial)
- Fupcase_initials_region (make_number (point - inslen), make_number (point));
+ Fupcase_initials_region (make_number (PT - inslen), make_number (PT));
return Qnil;
}
\f
int val;
CHECK_NUMBER (count, 0);
- if (!(val = scan_words (point, XINT (count))))
+ if (!(val = scan_words (PT, XINT (count))))
{
SET_PT (XINT (count) > 0 ? ZV : BEGV);
return Qnil;
()
{
int beg = BEGV;
- int pos = point;
+ int pos = PT;
while (pos > beg && !char_quoted (pos - 1)
&& (SYNTAX (FETCH_CHAR (pos - 1)) == Squote
if (MODIFF <= SAVE_MODIFF)
record_first_change ();
- if (point == beg + length)
+ if (PT == beg + length)
XSETINT (sbeg, -beg);
else
XSETFASTINT (sbeg, beg);
if (XINT (arg) < 0)
XSETINT (arg, XINT (arg) + ht);
- pos = *vmotion (point, - XINT (arg), w);
+ pos = *vmotion (PT, - XINT (arg), w);
Fset_marker (w->start, make_number (pos.bufpos), w->buffer);
w->start_at_line_beg = ((pos.bufpos == BEGV