From: morioka Date: Thu, 17 Sep 1998 06:58:39 +0000 (+0000) Subject: (point-at-bol): New function. X-Git-Tag: poe-199811302358~49 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c09681bd739f48d4cf80e688ff31f2689ff485eb;p=elisp%2Fapel.git (point-at-bol): New function. (point-at-eol): Use `line-end-position'. --- diff --git a/emu.el b/emu.el index 2dbb37b..fa7abab 100644 --- a/emu.el +++ b/emu.el @@ -145,8 +145,8 @@ If STRING is multibyte, the result is STRING itself. ;;; @ XEmacs emulation ;;; -(defun-maybe point-at-eol (&optional arg buffer) - "Return the character position of the last character on the current line. +(defun-maybe point-at-bol (&optional n buffer) + "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. If scan reaches end of buffer, return that position. This function does not move point. [XEmacs emulating function]" @@ -154,11 +154,20 @@ This function does not move point. [XEmacs emulating function]" (if buffer (set-buffer buffer) ) - (if arg - (forward-line (1- arg)) + (line-beginning-position n) + )) + +(defun-maybe point-at-eol (&optional n buffer) + "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. [XEmacs emulating function]" + (save-excursion + (if buffer + (set-buffer buffer) ) - (end-of-line) - (point))) + (line-end-position n) + )) ;;; @ for XEmacs 20