From c09681bd739f48d4cf80e688ff31f2689ff485eb Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 17 Sep 1998 06:58:39 +0000 Subject: [PATCH] (point-at-bol): New function. (point-at-eol): Use `line-end-position'. --- emu.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 -- 1.7.10.4