changeset 20605:95e051979faf

(sref): Defined.
author Richard M. Stallman <rms@gnu.org>
date Fri, 09 Jan 1998 22:13:08 +0000
parents cb1af13d913c
children 9331e7e88cf5
files lisp/subr.el
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Fri Jan 09 22:12:10 1998 +0000
+++ b/lisp/subr.el	Fri Jan 09 22:13:08 1998 +0000
@@ -511,6 +511,12 @@
 (defalias 'compiled-function-p 'byte-code-function-p)
 (defalias 'define-function 'defalias)
 
+(defun sref (string byte-index)
+  (let ((byte 0) (char 0))
+    (while (< byte byte-index)
+      (setq byte (+ byte (char-bytes (aref string byte)))))
+    (aref string char)))
+
 ;; Some programs still use this as a function.
 (defun baud-rate ()
   "Obsolete function returning the value of the `baud-rate' variable.