changeset 77096:14feb20665af

Markus Triska <markus.triska at gmx.at>: (byte-compile-char-before): New function (modified replacement for byte-optimize-char-before in byte-opt.el).
author Glenn Morris <rgm@gnu.org>
date Tue, 10 Apr 2007 03:54:36 +0000
parents d6c465042941
children 43beb362565f
files lisp/emacs-lisp/bytecomp.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)