From 39a4c932b6632def823eacc2da54972c7bc10e01 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 May 1998 20:02:01 +0000 Subject: [PATCH] (Fchar_after): Make nil fully equivalent to (point) as arg. (Fchar_before): Likewise. --- src/editfns.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index 5d45f7c4ede..c6d5a7a52ad 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -578,10 +578,7 @@ DEFUN ("eolp", Feolp, Seolp, 0, 0, 0, DEFUN ("char-after", Fchar_after, Schar_after, 0, 1, 0, "Return character in current buffer at position POS.\n\ POS is an integer or a buffer pointer.\n\ -If POS is out of range, the value is nil.\n\ -If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ - multi-byte form is ignored, and only one byte at POS\n\ - is returned as a character.") +If POS is out of range, the value is nil.") (pos) Lisp_Object pos; { @@ -589,8 +586,12 @@ If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ register Lisp_Object val; if (NILP (pos)) - pos_byte = PT_BYTE; - else if (MARKERP (pos)) + { + pos_byte = PT_BYTE; + pos = PT; + } + + if (MARKERP (pos)) { pos_byte = marker_byte_position (pos); if (pos_byte < BEGV_BYTE || pos_byte >= ZV_BYTE) @@ -611,10 +612,7 @@ If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ DEFUN ("char-before", Fchar_before, Schar_before, 0, 1, 0, "Return character in current buffer preceding position POS.\n\ POS is an integer or a buffer pointer.\n\ -If POS is out of range, the value is nil.\n\ -If `enable-multibyte-characters' is nil or POS is not at character boundary,\n\ -multi-byte form is ignored, and only one byte preceding POS\n\ -is returned as a character.") +If POS is out of range, the value is nil.") (pos) Lisp_Object pos; { @@ -622,8 +620,12 @@ is returned as a character.") register int pos_byte; if (NILP (pos)) - pos_byte = PT_BYTE; - else if (MARKERP (pos)) + { + pos_byte = PT_BYTE; + pos = PT; + } + + if (MARKERP (pos)) { pos_byte = marker_byte_position (pos); -- 2.39.2