aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmds.c
diff options
context:
space:
mode:
authorJoakim Verona2013-09-10 23:52:26 +0200
committerJoakim Verona2013-09-10 23:52:26 +0200
commit63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c (patch)
treee5078c5545c777e21944a9ee4199a6f2c6d25ca9 /src/cmds.c
parent92aeabcc8a007f521a664e3aee092eb80ad0f49a (diff)
downloademacs-63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c.tar.gz
emacs-63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c.zip
merge upstream
Diffstat (limited to 'src/cmds.c')
-rw-r--r--src/cmds.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/cmds.c b/src/cmds.c
index ce91877f85e..aeedb152f62 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -121,9 +121,7 @@ With positive N, a non-empty line at the end counts as one line
121successfully moved (for the return value). */) 121successfully moved (for the return value). */)
122 (Lisp_Object n) 122 (Lisp_Object n)
123{ 123{
124 ptrdiff_t opoint = PT, opoint_byte = PT_BYTE; 124 ptrdiff_t opoint = PT, pos, pos_byte, shortage, count;
125 ptrdiff_t pos, pos_byte;
126 EMACS_INT count, shortage;
127 125
128 if (NILP (n)) 126 if (NILP (n))
129 count = 1; 127 count = 1;
@@ -134,16 +132,12 @@ successfully moved (for the return value). */)
134 } 132 }
135 133
136 if (count <= 0) 134 if (count <= 0)
137 shortage = scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, count - 1, 1); 135 pos = find_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, count - 1,
136 &shortage, &pos_byte, 1);
138 else 137 else
139 shortage = scan_newline (PT, PT_BYTE, ZV, ZV_BYTE, count, 1); 138 pos = find_newline (PT, PT_BYTE, ZV, ZV_BYTE, count,
140 139 &shortage, &pos_byte, 1);
141 /* Since scan_newline does TEMP_SET_PT_BOTH, 140
142 and we want to set PT "for real",
143 go back to the old point and then come back here. */
144 pos = PT;
145 pos_byte = PT_BYTE;
146 TEMP_SET_PT_BOTH (opoint, opoint_byte);
147 SET_PT_BOTH (pos, pos_byte); 141 SET_PT_BOTH (pos, pos_byte);
148 142
149 if (shortage > 0 143 if (shortage > 0
@@ -310,7 +304,7 @@ At the end, it runs `post-self-insert-hook'. */)
310 /* Barf if the key that invoked this was not a character. */ 304 /* Barf if the key that invoked this was not a character. */
311 if (!CHARACTERP (last_command_event)) 305 if (!CHARACTERP (last_command_event))
312 bitch_at_user (); 306 bitch_at_user ();
313 { 307 else {
314 int character = translate_char (Vtranslation_table_for_input, 308 int character = translate_char (Vtranslation_table_for_input,
315 XINT (last_command_event)); 309 XINT (last_command_event));
316 int val = internal_self_insert (character, XFASTINT (n)); 310 int val = internal_self_insert (character, XFASTINT (n));