# HG changeset patch # User Glenn Morris # Date 1176177276 0 # Node ID 14feb20665af4511c65a70d7bede886aef082c50 # Parent d6c465042941c758bfddfd220d4fd0144a8058d9 Markus Triska : (byte-compile-char-before): New function (modified replacement for byte-optimize-char-before in byte-opt.el). diff -r d6c465042941 -r 14feb20665af lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Tue Apr 10 03:53:49 2007 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Tue Apr 10 03:54:36 2007 +0000 @@ -3148,6 +3148,7 @@ ;; more complicated compiler macros +(byte-defop-compiler char-before) (byte-defop-compiler list) (byte-defop-compiler concat) (byte-defop-compiler fset) @@ -3159,6 +3160,13 @@ (byte-defop-compiler19 (/ byte-quo) byte-compile-quo) (byte-defop-compiler19 nconc) +(defun byte-compile-char-before (form) + (cond ((= 2 (length form)) + (byte-compile-form `(char-after (1- ,(nth 1 form))))) + ((= 1 (length form)) + (byte-compile-form '(char-after (1- (point))))) + (t (byte-compile-subr-wrong-args form "0-1")))) + (defun byte-compile-list (form) (let ((count (length (cdr form)))) (cond ((= count 0)