aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmds.c
diff options
context:
space:
mode:
authorStefan Monnier2010-09-30 01:28:20 +0200
committerStefan Monnier2010-09-30 01:28:20 +0200
commita01a7932080e8a6e7bc8472c58cefabcc2c37df3 (patch)
tree94b28b19c8f1536e76ffe7d5826811b74a79e3a5 /src/cmds.c
parentcc390e46c7ba95b76ea133d98fd386214cd01709 (diff)
parent6b0f7311f16646e0de2045b2410e20921901c616 (diff)
downloademacs-a01a7932080e8a6e7bc8472c58cefabcc2c37df3.tar.gz
emacs-a01a7932080e8a6e7bc8472c58cefabcc2c37df3.zip
Merge from trunk
Diffstat (limited to 'src/cmds.c')
-rw-r--r--src/cmds.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/cmds.c b/src/cmds.c
index f12e759b7a6..e12d7c370d9 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -37,7 +37,7 @@ Lisp_Object Qkill_forward_chars, Qkill_backward_chars;
37/* A possible value for a buffer's overwrite-mode variable. */ 37/* A possible value for a buffer's overwrite-mode variable. */
38Lisp_Object Qoverwrite_mode_binary; 38Lisp_Object Qoverwrite_mode_binary;
39 39
40static int internal_self_insert (int, int); 40static int internal_self_insert (int, EMACS_INT);
41 41
42DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, 42DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
43 doc: /* Return buffer position N characters after (before if N negative) point. */) 43 doc: /* Return buffer position N characters after (before if N negative) point. */)
@@ -68,7 +68,7 @@ right or to the left on the screen. This is in contrast with
68 hooks, etcetera), that's not a good approach. So we validate the 68 hooks, etcetera), that's not a good approach. So we validate the
69 proposed position, then set point. */ 69 proposed position, then set point. */
70 { 70 {
71 int new_point = PT + XINT (n); 71 EMACS_INT new_point = PT + XINT (n);
72 72
73 if (new_point < BEGV) 73 if (new_point < BEGV)
74 { 74 {
@@ -116,9 +116,9 @@ With positive N, a non-empty line at the end counts as one line
116successfully moved (for the return value). */) 116successfully moved (for the return value). */)
117 (Lisp_Object n) 117 (Lisp_Object n)
118{ 118{
119 int opoint = PT, opoint_byte = PT_BYTE; 119 EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
120 int pos, pos_byte; 120 EMACS_INT pos, pos_byte;
121 int count, shortage; 121 EMACS_INT count, shortage;
122 122
123 if (NILP (n)) 123 if (NILP (n))
124 count = 1; 124 count = 1;
@@ -188,7 +188,7 @@ not move. To ignore field boundaries bind `inhibit-field-text-motion'
188to t. */) 188to t. */)
189 (Lisp_Object n) 189 (Lisp_Object n)
190{ 190{
191 int newpos; 191 EMACS_INT newpos;
192 192
193 if (NILP (n)) 193 if (NILP (n))
194 XSETFASTINT (n, 1); 194 XSETFASTINT (n, 1);
@@ -233,7 +233,7 @@ N was explicitly specified.
233The command `delete-forward' is preferable for interactive use. */) 233The command `delete-forward' is preferable for interactive use. */)
234 (Lisp_Object n, Lisp_Object killflag) 234 (Lisp_Object n, Lisp_Object killflag)
235{ 235{
236 int pos; 236 EMACS_INT pos;
237 237
238 CHECK_NUMBER (n); 238 CHECK_NUMBER (n);
239 239
@@ -303,7 +303,7 @@ After insertion, the value of `auto-fill-function' is called if the
303 bitch_at_user (); 303 bitch_at_user ();
304 { 304 {
305 int character = translate_char (Vtranslation_table_for_input, 305 int character = translate_char (Vtranslation_table_for_input,
306 XINT (last_command_event)); 306 (int) XINT (last_command_event));
307 int val = internal_self_insert (character, XFASTINT (n)); 307 int val = internal_self_insert (character, XFASTINT (n));
308 if (val == 2) 308 if (val == 2)
309 nonundocount = 0; 309 nonundocount = 0;
@@ -323,7 +323,7 @@ static Lisp_Object Qexpand_abbrev;
323static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook; 323static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook;
324 324
325static int 325static int
326internal_self_insert (int c, int n) 326internal_self_insert (int c, EMACS_INT n)
327{ 327{
328 int hairy = 0; 328 int hairy = 0;
329 Lisp_Object tem; 329 Lisp_Object tem;
@@ -333,8 +333,8 @@ internal_self_insert (int c, int n)
333 int len; 333 int len;
334 /* Working buffer and pointer for multi-byte form of C. */ 334 /* Working buffer and pointer for multi-byte form of C. */
335 unsigned char str[MAX_MULTIBYTE_LENGTH]; 335 unsigned char str[MAX_MULTIBYTE_LENGTH];
336 int chars_to_delete = 0; 336 EMACS_INT chars_to_delete = 0;
337 int spaces_to_insert = 0; 337 EMACS_INT spaces_to_insert = 0;
338 338
339 overwrite = current_buffer->overwrite_mode; 339 overwrite = current_buffer->overwrite_mode;
340 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) 340 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions))
@@ -380,12 +380,12 @@ internal_self_insert (int c, int n)
380 chars_to_delete = n; 380 chars_to_delete = n;
381 else if (c != '\n' && c2 != '\n') 381 else if (c != '\n' && c2 != '\n')
382 { 382 {
383 int pos = PT; 383 EMACS_INT pos = PT;
384 int pos_byte = PT_BYTE; 384 EMACS_INT pos_byte = PT_BYTE;
385 /* Column the cursor should be placed at after this insertion. 385 /* Column the cursor should be placed at after this insertion.
386 The correct value should be calculated only when necessary. */ 386 The correct value should be calculated only when necessary. */
387 int target_clm = ((int) current_column () /* iftc */ 387 int target_clm = ((int) current_column () /* iftc */
388 + n * XINT (Fchar_width (make_number (c)))); 388 + n * (int) XINT (Fchar_width (make_number (c))));
389 389
390 /* The actual cursor position after the trial of moving 390 /* The actual cursor position after the trial of moving
391 to column TARGET_CLM. It is greater than TARGET_CLM 391 to column TARGET_CLM. It is greater than TARGET_CLM
@@ -393,7 +393,8 @@ internal_self_insert (int c, int n)
393 character. In that case, the new point is set after 393 character. In that case, the new point is set after
394 that character. */ 394 that character. */
395 int actual_clm 395 int actual_clm
396 = XFASTINT (Fmove_to_column (make_number (target_clm), Qnil)); 396 = (int) XFASTINT (Fmove_to_column (make_number (target_clm),
397 Qnil));
397 398
398 chars_to_delete = PT - pos; 399 chars_to_delete = PT - pos;
399 400
@@ -524,7 +525,7 @@ syms_of_cmds (void)
524 525
525 DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook, 526 DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook,
526 doc: /* Hook run at the end of `self-insert-command'. 527 doc: /* Hook run at the end of `self-insert-command'.
527This run is run after inserting the charater. */); 528This is run after inserting the character. */);
528 Vpost_self_insert_hook = Qnil; 529 Vpost_self_insert_hook = Qnil;
529 530
530 defsubr (&Sforward_point); 531 defsubr (&Sforward_point);