Mercurial > hg > xemacs-beta
diff src/cmds.c @ 8:4b173ad71786 r19-15b5
Import from CVS: tag r19-15b5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:47:35 +0200 |
parents | 27bc7f280385 |
children | 0293115a14e9 |
line wrap: on
line diff
--- a/src/cmds.c Mon Aug 13 08:47:16 2007 +0200 +++ b/src/cmds.c Mon Aug 13 08:47:35 2007 +0200 @@ -137,22 +137,6 @@ return make_int (negp ? - shortage : shortage); } -DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, - 0, 2, "_p" /* -Move point to beginning of current line. -With argument ARG not nil or 1, move forward ARG - 1 lines first. -If scan reaches end of buffer, stop there without error. -If BUFFER is nil, the current buffer is assumed. -*/ ) - (arg, buffer) - Lisp_Object arg, buffer; -{ - struct buffer *b = decode_buffer (buffer, 1); - - BUF_SET_PT(b, XINT (Fpoint_at_bol(arg, buffer))); - return Qnil; -} - DEFUN ("point-at-bol", Fpoint_at_bol, Spoint_at_bol, 0, 2, 0 /* Return the character position of the first character on the current line. With argument N not nil or 1, move forward N - 1 lines first. @@ -160,6 +144,7 @@ This function does not move point. */ ) (arg, buffer) + Lisp_Object arg, buffer; { struct buffer *b = decode_buffer (buffer, 1); register int orig, end; @@ -178,6 +163,44 @@ return make_int (end); } +DEFUN ("beginning-of-line", Fbeginning_of_line, Sbeginning_of_line, + 0, 2, "_p" /* +Move point to beginning of current line. +With argument ARG not nil or 1, move forward ARG - 1 lines first. +If scan reaches end of buffer, stop there without error. +If BUFFER is nil, the current buffer is assumed. +*/ ) + (arg, buffer) + Lisp_Object arg, buffer; +{ + struct buffer *b = decode_buffer (buffer, 1); + + BUF_SET_PT(b, XINT (Fpoint_at_bol(arg, buffer))); + return Qnil; +} + +DEFUN ("point-at-eol", Fpoint_at_eol, Spoint_at_eol, 0, 2, 0 /* +Return the character position of the last character on the current line. +With argument N not nil or 1, move forward N - 1 lines first. +If scan reaches end of buffer, return that position. +This function does not move point. +*/ ) + (arg, buffer) + Lisp_Object arg, buffer; +{ + struct buffer *buf = decode_buffer (buffer, 1); + + XSETBUFFER (buffer, buf); + + if (NILP (arg)) + arg = make_int (1); + else + CHECK_INT (arg); + + return make_int (find_before_next_newline (buf, BUF_PT (buf), 0, + XINT (arg) - (XINT (arg) <= 0))); +} + DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 2, "_p" /* Move point to end of current line. @@ -194,27 +217,6 @@ return Qnil; } -DEFUN ("point-at-eol", Fpoint_at_eol, Spoint_at_eol, 0, 2, 0 /* -Return the character position of the last character on the current line. -With argument N not nil or 1, move forward N - 1 lines first. -If scan reaches end of buffer, return that position. -This function does not move point. -*/ ) - (arg, buffer) -{ - struct buffer *buf = decode_buffer (buffer, 1); - - XSETBUFFER (buffer, buf); - - if (NILP (arg)) - arg = make_int (1); - else - CHECK_INT (arg); - - return find_before_next_newline (buf, BUF_PT (buf), 0, - XINT (arg) - (XINT (arg) <= 0)); -} - DEFUN ("delete-char", Fdelete_char, Sdelete_char, 1, 2, "*p\nP" /* Delete the following ARG characters (previous, with negative arg). Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).