Commit 961166f5 authored by Glenn Morris's avatar Glenn Morris
Browse files

bytecomp fix for bug#14565

* lisp/emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word):
Handle explicit nil arguments.
parent 9ef6111b
2013-06-06 Glenn Morris <rgm@gnu.org>
* emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word):
Handle explicit nil arguments. (Bug#14565)
2013-06-05 Alan Mackenzie <acm@muc.de> 2013-06-05 Alan Mackenzie <acm@muc.de>
   
* isearch.el (isearch-allow-prefix): New user option. * isearch.el (isearch-allow-prefix): New user option.
...@@ -3447,31 +3447,34 @@ discarding." ...@@ -3447,31 +3447,34 @@ discarding."
(byte-defop-compiler nconc) (byte-defop-compiler nconc)
(defun byte-compile-char-before (form) (defun byte-compile-char-before (form)
(cond ((= 2 (length form)) (cond ((or (= 1 (length form))
(and (= 2 (length form)) (not (nth 1 form))))
(byte-compile-form '(char-after (1- (point)))))
((= 2 (length form))
(byte-compile-form (list 'char-after (if (numberp (nth 1 form)) (byte-compile-form (list 'char-after (if (numberp (nth 1 form))
(1- (nth 1 form)) (1- (nth 1 form))
`(1- ,(nth 1 form)))))) `(1- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(char-after (1- (point)))))
(t (byte-compile-subr-wrong-args form "0-1")))) (t (byte-compile-subr-wrong-args form "0-1"))))
;; backward-... ==> forward-... with negated argument. ;; backward-... ==> forward-... with negated argument.
(defun byte-compile-backward-char (form) (defun byte-compile-backward-char (form)
(cond ((= 2 (length form)) (cond ((or (= 1 (length form))
(and (= 2 (length form)) (not (nth 1 form))))
(byte-compile-form '(forward-char -1)))
((= 2 (length form))
(byte-compile-form (list 'forward-char (if (numberp (nth 1 form)) (byte-compile-form (list 'forward-char (if (numberp (nth 1 form))
(- (nth 1 form)) (- (nth 1 form))
`(- ,(nth 1 form)))))) `(- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(forward-char -1)))
(t (byte-compile-subr-wrong-args form "0-1")))) (t (byte-compile-subr-wrong-args form "0-1"))))
(defun byte-compile-backward-word (form) (defun byte-compile-backward-word (form)
(cond ((= 2 (length form)) (cond ((or (= 1 (length form))
(and (= 2 (length form)) (not (nth 1 form))))
(byte-compile-form '(forward-word -1)))
((= 2 (length form))
(byte-compile-form (list 'forward-word (if (numberp (nth 1 form)) (byte-compile-form (list 'forward-word (if (numberp (nth 1 form))
(- (nth 1 form)) (- (nth 1 form))
`(- ,(nth 1 form)))))) `(- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(forward-word -1)))
(t (byte-compile-subr-wrong-args form "0-1")))) (t (byte-compile-subr-wrong-args form "0-1"))))
(defun byte-compile-list (form) (defun byte-compile-list (form)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment