diff options
| author | Erik Naggum | 1996-01-09 00:30:54 +0000 |
|---|---|---|
| committer | Erik Naggum | 1996-01-09 00:30:54 +0000 |
| commit | 72d5f589b6c91e6cc13abf792ada94edfc70870b (patch) | |
| tree | c24f84ab92a2c484cae781d16a649d07f7eb55c9 /src/cmds.c | |
| parent | 2858a1c15c776e4314fb9707adbf953c16ad1919 (diff) | |
| download | emacs-72d5f589b6c91e6cc13abf792ada94edfc70870b.tar.gz emacs-72d5f589b6c91e6cc13abf792ada94edfc70870b.zip | |
(Fforward_line, Fbeginning_of_line, Fend_of_line, Fdelete_char,
Fdelete_backward_char): Harmonize arguments with documentation.
Diffstat (limited to 'src/cmds.c')
| -rw-r--r-- | src/cmds.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/cmds.c b/src/cmds.c index 863988b98e0..64b06f20b92 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -40,23 +40,23 @@ Lisp_Object Vself_insert_face_command; | |||
| 40 | extern Lisp_Object Qface; | 40 | extern Lisp_Object Qface; |
| 41 | 41 | ||
| 42 | DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", | 42 | DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", |
| 43 | "Move point right ARG characters (left if ARG negative).\n\ | 43 | "Move point right N characters (left if N is negative).\n\ |
| 44 | On reaching end of buffer, stop and signal error.") | 44 | On reaching end of buffer, stop and signal error.") |
| 45 | (arg) | 45 | (n) |
| 46 | Lisp_Object arg; | 46 | Lisp_Object n; |
| 47 | { | 47 | { |
| 48 | if (NILP (arg)) | 48 | if (NILP (n)) |
| 49 | XSETFASTINT (arg, 1); | 49 | XSETFASTINT (n, 1); |
| 50 | else | 50 | else |
| 51 | CHECK_NUMBER (arg, 0); | 51 | CHECK_NUMBER (n, 0); |
| 52 | 52 | ||
| 53 | /* This used to just set point to point + XINT (arg), and then check | 53 | /* This used to just set point to point + XINT (n), and then check |
| 54 | to see if it was within boundaries. But now that SET_PT can | 54 | to see if it was within boundaries. But now that SET_PT can |
| 55 | potentially do a lot of stuff (calling entering and exiting | 55 | potentially do a lot of stuff (calling entering and exiting |
| 56 | hooks, etcetera), that's not a good approach. So we validate the | 56 | hooks, etcetera), that's not a good approach. So we validate the |
| 57 | proposed position, then set point. */ | 57 | proposed position, then set point. */ |
| 58 | { | 58 | { |
| 59 | int new_point = point + XINT (arg); | 59 | int new_point = point + XINT (n); |
| 60 | 60 | ||
| 61 | if (new_point < BEGV) | 61 | if (new_point < BEGV) |
| 62 | { | 62 | { |
| @@ -76,27 +76,27 @@ On reaching end of buffer, stop and signal error.") | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "p", | 78 | DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "p", |
| 79 | "Move point left ARG characters (right if ARG negative).\n\ | 79 | "Move point left N characters (right if N is negative).\n\ |
| 80 | On attempt to pass beginning or end of buffer, stop and signal error.") | 80 | On attempt to pass beginning or end of buffer, stop and signal error.") |
| 81 | (arg) | 81 | (n) |
| 82 | Lisp_Object arg; | 82 | Lisp_Object n; |
| 83 | { | 83 | { |
| 84 | if (NILP (arg)) | 84 | if (NILP (n)) |
| 85 | XSETFASTINT (arg, 1); | 85 | XSETFASTINT (n, 1); |
| 86 | else | 86 | else |
| 87 | CHECK_NUMBER (arg, 0); | 87 | CHECK_NUMBER (n, 0); |
| 88 | 88 | ||
| 89 | XSETINT (arg, - XINT (arg)); | 89 | XSETINT (n, - XINT (n)); |
| 90 | return Fforward_char (arg); | 90 | return Fforward_char (n); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | DEFUN ("forward-line", Fforward_line, Sforward_line, 0, 1, "p", | 93 | DEFUN ("forward-line", Fforward_line, Sforward_line, 0, 1, "p", |
| 94 | "Move ARG lines forward (backward if ARG is negative).\n\ | 94 | "Move N lines forward (backward if N is negative).\n\ |
| 95 | Precisely, if point is on line I, move to the start of line I + ARG.\n\ | 95 | Precisely, if point is on line I, move to the start of line I + N.\n\ |
| 96 | If there isn't room, go as far as possible (no error).\n\ | 96 | If there isn't room, go as far as possible (no error).\n\ |
| 97 | Returns the count of lines left to move. If moving forward,\n\ | 97 | Returns the count of lines left to move. If moving forward,\n\ |
| 98 | that is ARG - number of lines moved; if backward, ARG + number moved.\n\ | 98 | that is N - number of lines moved; if backward, N + number moved.\n\ |
| 99 | With positive ARG, a non-empty line at the end counts as one line\n\ | 99 | With positive N, a non-empty line at the end counts as one line\n\ |
| 100 | successfully moved (for the return value).") | 100 | successfully moved (for the return value).") |
| 101 | (n) | 101 | (n) |
| 102 | Lisp_Object n; | 102 | Lisp_Object n; |
| @@ -128,7 +128,7 @@ With positive ARG, a non-empty line at the end counts as one line\n\ | |||
| 128 | DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, | 128 | DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, |
| 129 | 0, 1, "p", | 129 | 0, 1, "p", |
| 130 | "Move point to beginning of current line.\n\ | 130 | "Move point to beginning of current line.\n\ |
| 131 | With argument ARG not nil or 1, move forward ARG - 1 lines first.\n\ | 131 | With argument N not nil or 1, move forward N - 1 lines first.\n\ |
| 132 | If scan reaches end of buffer, stop there without error.") | 132 | If scan reaches end of buffer, stop there without error.") |
| 133 | (n) | 133 | (n) |
| 134 | Lisp_Object n; | 134 | Lisp_Object n; |
| @@ -145,7 +145,7 @@ If scan reaches end of buffer, stop there without error.") | |||
| 145 | DEFUN ("end-of-line", Fend_of_line, Send_of_line, | 145 | DEFUN ("end-of-line", Fend_of_line, Send_of_line, |
| 146 | 0, 1, "p", | 146 | 0, 1, "p", |
| 147 | "Move point to end of current line.\n\ | 147 | "Move point to end of current line.\n\ |
| 148 | With argument ARG not nil or 1, move forward ARG - 1 lines first.\n\ | 148 | With argument N not nil or 1, move forward N - 1 lines first.\n\ |
| 149 | If scan reaches end of buffer, stop there without error.") | 149 | If scan reaches end of buffer, stop there without error.") |
| 150 | (n) | 150 | (n) |
| 151 | Lisp_Object n; | 151 | Lisp_Object n; |
| @@ -164,10 +164,10 @@ If scan reaches end of buffer, stop there without error.") | |||
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | DEFUN ("delete-char", Fdelete_char, Sdelete_char, 1, 2, "p\nP", | 166 | DEFUN ("delete-char", Fdelete_char, Sdelete_char, 1, 2, "p\nP", |
| 167 | "Delete the following ARG characters (previous, with negative arg).\n\ | 167 | "Delete the following N characters (previous if N is negative).\n\ |
| 168 | Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).\n\ | 168 | Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).\n\ |
| 169 | Interactively, ARG is the prefix arg, and KILLFLAG is set if\n\ | 169 | Interactively, N is the prefix arg, and KILLFLAG is set if\n\ |
| 170 | ARG was explicitly specified.") | 170 | N was explicitly specified.") |
| 171 | (n, killflag) | 171 | (n, killflag) |
| 172 | Lisp_Object n, killflag; | 172 | Lisp_Object n, killflag; |
| 173 | { | 173 | { |
| @@ -199,10 +199,10 @@ ARG was explicitly specified.") | |||
| 199 | 199 | ||
| 200 | DEFUN ("delete-backward-char", Fdelete_backward_char, Sdelete_backward_char, | 200 | DEFUN ("delete-backward-char", Fdelete_backward_char, Sdelete_backward_char, |
| 201 | 1, 2, "p\nP", | 201 | 1, 2, "p\nP", |
| 202 | "Delete the previous ARG characters (following, with negative ARG).\n\ | 202 | "Delete the previous N characters (following if N is negative).\n\ |
| 203 | Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).\n\ | 203 | Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).\n\ |
| 204 | Interactively, ARG is the prefix arg, and KILLFLAG is set if\n\ | 204 | Interactively, N is the prefix arg, and KILLFLAG is set if\n\ |
| 205 | ARG was explicitly specified.") | 205 | N was explicitly specified.") |
| 206 | (n, killflag) | 206 | (n, killflag) |
| 207 | Lisp_Object n, killflag; | 207 | Lisp_Object n, killflag; |
| 208 | { | 208 | { |
| @@ -213,32 +213,32 @@ ARG was explicitly specified.") | |||
| 213 | DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p", | 213 | DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p", |
| 214 | "Insert the character you type.\n\ | 214 | "Insert the character you type.\n\ |
| 215 | Whichever character you type to run this command is inserted.") | 215 | Whichever character you type to run this command is inserted.") |
| 216 | (arg) | 216 | (n) |
| 217 | Lisp_Object arg; | 217 | Lisp_Object n; |
| 218 | { | 218 | { |
| 219 | CHECK_NUMBER (arg, 0); | 219 | CHECK_NUMBER (n, 0); |
| 220 | 220 | ||
| 221 | /* Barf if the key that invoked this was not a character. */ | 221 | /* Barf if the key that invoked this was not a character. */ |
| 222 | if (!INTEGERP (last_command_char)) | 222 | if (!INTEGERP (last_command_char)) |
| 223 | bitch_at_user (); | 223 | bitch_at_user (); |
| 224 | else if (XINT (arg) >= 2 && NILP (current_buffer->overwrite_mode)) | 224 | else if (XINT (n) >= 2 && NILP (current_buffer->overwrite_mode)) |
| 225 | { | 225 | { |
| 226 | XSETFASTINT (arg, XFASTINT (arg) - 2); | 226 | XSETFASTINT (n, XFASTINT (n) - 2); |
| 227 | /* The first one might want to expand an abbrev. */ | 227 | /* The first one might want to expand an abbrev. */ |
| 228 | internal_self_insert (XINT (last_command_char), 1); | 228 | internal_self_insert (XINT (last_command_char), 1); |
| 229 | /* The bulk of the copies of this char can be inserted simply. | 229 | /* The bulk of the copies of this char can be inserted simply. |
| 230 | We don't have to handle a user-specified face specially | 230 | We don't have to handle a user-specified face specially |
| 231 | because it will get inherited from the first char inserted. */ | 231 | because it will get inherited from the first char inserted. */ |
| 232 | Finsert_char (last_command_char, arg, Qt); | 232 | Finsert_char (last_command_char, n, Qt); |
| 233 | /* The last one might want to auto-fill. */ | 233 | /* The last one might want to auto-fill. */ |
| 234 | internal_self_insert (XINT (last_command_char), 0); | 234 | internal_self_insert (XINT (last_command_char), 0); |
| 235 | } | 235 | } |
| 236 | else | 236 | else |
| 237 | while (XINT (arg) > 0) | 237 | while (XINT (n) > 0) |
| 238 | { | 238 | { |
| 239 | /* Ok since old and new vals both nonneg */ | 239 | /* Ok since old and new vals both nonneg */ |
| 240 | XSETFASTINT (arg, XFASTINT (arg) - 1); | 240 | XSETFASTINT (n, XFASTINT (n) - 1); |
| 241 | internal_self_insert (XINT (last_command_char), XFASTINT (arg) != 0); | 241 | internal_self_insert (XINT (last_command_char), XFASTINT (n) != 0); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | return Qnil; | 244 | return Qnil; |