diff options
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index de749e1d0c8..f1761c125ac 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -3149,6 +3149,8 @@ That command is designed for interactive use only" fn)) | |||
| 3149 | ;; more complicated compiler macros | 3149 | ;; more complicated compiler macros |
| 3150 | 3150 | ||
| 3151 | (byte-defop-compiler char-before) | 3151 | (byte-defop-compiler char-before) |
| 3152 | (byte-defop-compiler backward-char) | ||
| 3153 | (byte-defop-compiler backward-word) | ||
| 3152 | (byte-defop-compiler list) | 3154 | (byte-defop-compiler list) |
| 3153 | (byte-defop-compiler concat) | 3155 | (byte-defop-compiler concat) |
| 3154 | (byte-defop-compiler fset) | 3156 | (byte-defop-compiler fset) |
| @@ -3162,10 +3164,31 @@ That command is designed for interactive use only" fn)) | |||
| 3162 | 3164 | ||
| 3163 | (defun byte-compile-char-before (form) | 3165 | (defun byte-compile-char-before (form) |
| 3164 | (cond ((= 2 (length form)) | 3166 | (cond ((= 2 (length form)) |
| 3165 | (byte-compile-form `(char-after (1- ,(nth 1 form))))) | 3167 | (byte-compile-form (list 'char-after (if (numberp (nth 1 form)) |
| 3166 | ((= 1 (length form)) | 3168 | (1- (nth 1 form)) |
| 3167 | (byte-compile-form '(char-after (1- (point))))) | 3169 | `(1- ,(nth 1 form)))))) |
| 3168 | (t (byte-compile-subr-wrong-args form "0-1")))) | 3170 | ((= 1 (length form)) |
| 3171 | (byte-compile-form '(char-after (1- (point))))) | ||
| 3172 | (t (byte-compile-subr-wrong-args form "0-1")))) | ||
| 3173 | |||
| 3174 | ;; backward-... ==> forward-... with negated argument. | ||
| 3175 | (defun byte-compile-backward-char (form) | ||
| 3176 | (cond ((= 2 (length form)) | ||
| 3177 | (byte-compile-form (list 'forward-char (if (numberp (nth 1 form)) | ||
| 3178 | (- (nth 1 form)) | ||
| 3179 | `(- ,(nth 1 form)))))) | ||
| 3180 | ((= 1 (length form)) | ||
| 3181 | (byte-compile-form '(forward-char -1))) | ||
| 3182 | (t (byte-compile-subr-wrong-args form "0-1")))) | ||
| 3183 | |||
| 3184 | (defun byte-compile-backward-word (form) | ||
| 3185 | (cond ((= 2 (length form)) | ||
| 3186 | (byte-compile-form (list 'forward-word (if (numberp (nth 1 form)) | ||
| 3187 | (- (nth 1 form)) | ||
| 3188 | `(- ,(nth 1 form)))))) | ||
| 3189 | ((= 1 (length form)) | ||
| 3190 | (byte-compile-form '(forward-word -1))) | ||
| 3191 | (t (byte-compile-subr-wrong-args form "0-1")))) | ||
| 3169 | 3192 | ||
| 3170 | (defun byte-compile-list (form) | 3193 | (defun byte-compile-list (form) |
| 3171 | (let ((count (length (cdr form)))) | 3194 | (let ((count (length (cdr form)))) |