]> code.delx.au - gnu-emacs/commitdiff
(sref): Defined.
authorRichard M. Stallman <rms@gnu.org>
Fri, 9 Jan 1998 22:13:08 +0000 (22:13 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 9 Jan 1998 22:13:08 +0000 (22:13 +0000)
lisp/subr.el

index 6dd33424cd2ac6a6f4ad276b86b00a6b60e372ae..683c8e291b28f6e9fe5c487d187e85b3052a41e2 100644 (file)
@@ -511,6 +511,12 @@ as returned by the `event-start' and `event-end' functions."
 (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.