Mercurial > emacs
comparison src/cmds.c @ 16039:855c8d8ba0f0
Change all references from point to PT.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 01 Sep 1996 19:15:05 +0000 |
parents | 5ffb83189a1b |
children | f31cab608aa9 |
comparison
equal
deleted
inserted
replaced
16038:8cd162ceb1dc | 16039:855c8d8ba0f0 |
---|---|
55 to see if it was within boundaries. But now that SET_PT can | 55 to see if it was within boundaries. But now that SET_PT can |
56 potentially do a lot of stuff (calling entering and exiting | 56 potentially do a lot of stuff (calling entering and exiting |
57 hooks, etcetera), that's not a good approach. So we validate the | 57 hooks, etcetera), that's not a good approach. So we validate the |
58 proposed position, then set point. */ | 58 proposed position, then set point. */ |
59 { | 59 { |
60 int new_point = point + XINT (n); | 60 int new_point = PT + XINT (n); |
61 | 61 |
62 if (new_point < BEGV) | 62 if (new_point < BEGV) |
63 { | 63 { |
64 SET_PT (BEGV); | 64 SET_PT (BEGV); |
65 Fsignal (Qbeginning_of_buffer, Qnil); | 65 Fsignal (Qbeginning_of_buffer, Qnil); |
100 With positive N, a non-empty line at the end counts as one line\n\ | 100 With positive N, a non-empty line at the end counts as one line\n\ |
101 successfully moved (for the return value).") | 101 successfully moved (for the return value).") |
102 (n) | 102 (n) |
103 Lisp_Object n; | 103 Lisp_Object n; |
104 { | 104 { |
105 int pos2 = point; | 105 int pos2 = PT; |
106 int pos; | 106 int pos; |
107 int count, shortage, negp; | 107 int count, shortage, negp; |
108 | 108 |
109 if (NILP (n)) | 109 if (NILP (n)) |
110 count = 1; | 110 count = 1; |
176 | 176 |
177 if (NILP (killflag)) | 177 if (NILP (killflag)) |
178 { | 178 { |
179 if (XINT (n) < 0) | 179 if (XINT (n) < 0) |
180 { | 180 { |
181 if (point + XINT (n) < BEGV) | 181 if (PT + XINT (n) < BEGV) |
182 Fsignal (Qbeginning_of_buffer, Qnil); | 182 Fsignal (Qbeginning_of_buffer, Qnil); |
183 else | 183 else |
184 del_range (point + XINT (n), point); | 184 del_range (PT + XINT (n), PT); |
185 } | 185 } |
186 else | 186 else |
187 { | 187 { |
188 if (point + XINT (n) > ZV) | 188 if (PT + XINT (n) > ZV) |
189 Fsignal (Qend_of_buffer, Qnil); | 189 Fsignal (Qend_of_buffer, Qnil); |
190 else | 190 else |
191 del_range (point, point + XINT (n)); | 191 del_range (PT, PT + XINT (n)); |
192 } | 192 } |
193 } | 193 } |
194 else | 194 else |
195 { | 195 { |
196 call1 (Qkill_forward_chars, n); | 196 call1 (Qkill_forward_chars, n); |
214 CHECK_NUMBER (n, 0); | 214 CHECK_NUMBER (n, 0); |
215 | 215 |
216 /* See if we are about to delete a tab or newline backwards. */ | 216 /* See if we are about to delete a tab or newline backwards. */ |
217 for (i = 1; i <= XINT (n); i++) | 217 for (i = 1; i <= XINT (n); i++) |
218 { | 218 { |
219 if (point - i < BEGV) | 219 if (PT - i < BEGV) |
220 break; | 220 break; |
221 if (FETCH_CHAR (point - i) == '\t' || FETCH_CHAR (point - i) == '\n') | 221 if (FETCH_CHAR (PT - i) == '\t' || FETCH_CHAR (PT - i) == '\n') |
222 { | 222 { |
223 deleted_special = 1; | 223 deleted_special = 1; |
224 break; | 224 break; |
225 } | 225 } |
226 } | 226 } |
230 /* In overwrite mode, back over columns while clearing them out, | 230 /* In overwrite mode, back over columns while clearing them out, |
231 unless at end of line. */ | 231 unless at end of line. */ |
232 if (XINT (n) > 0 | 232 if (XINT (n) > 0 |
233 && ! NILP (current_buffer->overwrite_mode) | 233 && ! NILP (current_buffer->overwrite_mode) |
234 && ! deleted_special | 234 && ! deleted_special |
235 && ! (point == ZV || FETCH_CHAR (point) == '\n')) | 235 && ! (PT == ZV || FETCH_CHAR (PT) == '\n')) |
236 { | 236 { |
237 Finsert_char (make_number (' '), XINT (n)); | 237 Finsert_char (make_number (' '), XINT (n)); |
238 SET_PT (point - XINT (n)); | 238 SET_PT (PT - XINT (n)); |
239 } | 239 } |
240 | 240 |
241 return value; | 241 return value; |
242 } | 242 } |
243 | 243 |
300 if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function) | 300 if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function) |
301 || !NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) | 301 || !NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) |
302 hairy = 1; | 302 hairy = 1; |
303 | 303 |
304 if (!NILP (overwrite) | 304 if (!NILP (overwrite) |
305 && point < ZV | 305 && PT < ZV |
306 && (EQ (overwrite, Qoverwrite_mode_binary) | 306 && (EQ (overwrite, Qoverwrite_mode_binary) |
307 || (c != '\n' && FETCH_CHAR (point) != '\n')) | 307 || (c != '\n' && FETCH_CHAR (PT) != '\n')) |
308 && (EQ (overwrite, Qoverwrite_mode_binary) | 308 && (EQ (overwrite, Qoverwrite_mode_binary) |
309 || FETCH_CHAR (point) != '\t' | 309 || FETCH_CHAR (PT) != '\t' |
310 || XINT (current_buffer->tab_width) <= 0 | 310 || XINT (current_buffer->tab_width) <= 0 |
311 || XFASTINT (current_buffer->tab_width) > 20 | 311 || XFASTINT (current_buffer->tab_width) > 20 |
312 || !((current_column () + 1) % XFASTINT (current_buffer->tab_width)))) | 312 || !((current_column () + 1) % XFASTINT (current_buffer->tab_width)))) |
313 { | 313 { |
314 del_range (point, point + 1); | 314 del_range (PT, PT + 1); |
315 hairy = 2; | 315 hairy = 2; |
316 } | 316 } |
317 if (!NILP (current_buffer->abbrev_mode) | 317 if (!NILP (current_buffer->abbrev_mode) |
318 && SYNTAX (c) != Sword | 318 && SYNTAX (c) != Sword |
319 && NILP (current_buffer->read_only) | 319 && NILP (current_buffer->read_only) |
320 && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword) | 320 && PT > BEGV && SYNTAX (FETCH_CHAR (PT - 1)) == Sword) |
321 { | 321 { |
322 int modiff = MODIFF; | 322 int modiff = MODIFF; |
323 Fexpand_abbrev (); | 323 Fexpand_abbrev (); |
324 /* We can't trust the value of Fexpand_abbrev, | 324 /* We can't trust the value of Fexpand_abbrev, |
325 but if Fexpand_abbrev changed the buffer, | 325 but if Fexpand_abbrev changed the buffer, |
336 insert_and_inherit (&c1, 1); | 336 insert_and_inherit (&c1, 1); |
337 if (c1 == '\n') | 337 if (c1 == '\n') |
338 /* After inserting a newline, move to previous line and fill */ | 338 /* After inserting a newline, move to previous line and fill */ |
339 /* that. Must have the newline in place already so filling and */ | 339 /* that. Must have the newline in place already so filling and */ |
340 /* justification, if any, know where the end is going to be. */ | 340 /* justification, if any, know where the end is going to be. */ |
341 SET_PT (point - 1); | 341 SET_PT (PT - 1); |
342 tem = call0 (current_buffer->auto_fill_function); | 342 tem = call0 (current_buffer->auto_fill_function); |
343 if (c1 == '\n') | 343 if (c1 == '\n') |
344 SET_PT (point + 1); | 344 SET_PT (PT + 1); |
345 if (!NILP (tem)) | 345 if (!NILP (tem)) |
346 hairy = 2; | 346 hairy = 2; |
347 } | 347 } |
348 else | 348 else |
349 insert_and_inherit (&c1, 1); | 349 insert_and_inherit (&c1, 1); |