diff options
author | Richard M. Stallman <[email protected]> | 1998-06-29 18:35:52 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1998-06-29 18:35:52 +0000 |
commit | 3ab0732d83dd23e62d632b1d1c7a0e68a432fed5 (patch) | |
tree | 9f0d71cdc23ba958cd6054a4a2c30c8c28e52d58 /src | |
parent | 93e7ada98147db1b93e3009278687ef03771bdbe (diff) |
(Fbyte_to_position): New function.
(syms_of_editfns): defsubr it.
Diffstat (limited to 'src')
-rw-r--r-- | src/editfns.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/editfns.c b/src/editfns.c index c6d5a7a52a..18d643a9c8 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -497,6 +497,15 @@ DEFUN ("position-bytes", Fposition_bytes, Sposition_bytes, 1, 1, 0, CHECK_NUMBER_COERCE_MARKER (position, 1); return make_number (CHAR_TO_BYTE (XINT (position))); } + +DEFUN ("byte-to-position", Fbyte_to_position, Sbyte_to_position, 1, 1, 0, + "Return the character position for byte position BYTEPOS.") + (bytepos) + Lisp_Object bytepos; +{ + CHECK_NUMBER (bytepos, 1); + return make_number (BYTE_TO_CHAR (XINT (bytepos))); +} DEFUN ("following-char", Ffollowing_char, Sfollowing_char, 0, 0, 0, "Return the character following point, as a number.\n\ @@ -3117,6 +3126,7 @@ functions if all the text being accessed has this property."); defsubr (&Sgap_position); defsubr (&Sgap_size); defsubr (&Sposition_bytes); + defsubr (&Sbyte_to_position); defsubr (&Sbobp); defsubr (&Seobp); |