diff options
| author | Glenn Morris | 2013-06-07 18:35:47 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-06-07 18:35:47 -0700 |
| commit | 467f3b337c3f67ddf8380c52efbf49715fb5ea4c (patch) | |
| tree | a8e13dafb5bf47dcc7b0dfa6bd51431aa890a5c4 | |
| parent | 650645d50f03a64195b72e4c8d08a7e1c508de99 (diff) | |
| download | emacs-467f3b337c3f67ddf8380c52efbf49715fb5ea4c.tar.gz emacs-467f3b337c3f67ddf8380c52efbf49715fb5ea4c.zip | |
Improve previous bytecomp fix
* lisp/emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word):
Improve previous change, to handle non-explicit nil.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 082aeeeca2e..4e02c72d984 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-06-08 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-char-before) | ||
| 4 | (byte-compile-backward-char, byte-compile-backward-word): | ||
| 5 | Improve previous change, to handle non-explicit nil. | ||
| 6 | |||
| 1 | 2013-06-07 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-06-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * emacs-lisp/smie.el: Improve show-paren-mode behavior. | 9 | * emacs-lisp/smie.el: Improve show-paren-mode behavior. |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5efdd6a675c..e603f76f41d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -3446,6 +3446,7 @@ discarding." | |||
| 3446 | (byte-defop-compiler (/ byte-quo) byte-compile-quo) | 3446 | (byte-defop-compiler (/ byte-quo) byte-compile-quo) |
| 3447 | (byte-defop-compiler nconc) | 3447 | (byte-defop-compiler nconc) |
| 3448 | 3448 | ||
| 3449 | ;; Is this worth it? Both -before and -after are written in C. | ||
| 3449 | (defun byte-compile-char-before (form) | 3450 | (defun byte-compile-char-before (form) |
| 3450 | (cond ((or (= 1 (length form)) | 3451 | (cond ((or (= 1 (length form)) |
| 3451 | (and (= 2 (length form)) (not (nth 1 form)))) | 3452 | (and (= 2 (length form)) (not (nth 1 form)))) |
| @@ -3453,10 +3454,12 @@ discarding." | |||
| 3453 | ((= 2 (length form)) | 3454 | ((= 2 (length form)) |
| 3454 | (byte-compile-form (list 'char-after (if (numberp (nth 1 form)) | 3455 | (byte-compile-form (list 'char-after (if (numberp (nth 1 form)) |
| 3455 | (1- (nth 1 form)) | 3456 | (1- (nth 1 form)) |
| 3456 | `(1- ,(nth 1 form)))))) | 3457 | `(1- (or ,(nth 1 form) |
| 3458 | (point))))))) | ||
| 3457 | (t (byte-compile-subr-wrong-args form "0-1")))) | 3459 | (t (byte-compile-subr-wrong-args form "0-1")))) |
| 3458 | 3460 | ||
| 3459 | ;; backward-... ==> forward-... with negated argument. | 3461 | ;; backward-... ==> forward-... with negated argument. |
| 3462 | ;; Is this worth it? Both -backward and -forward are written in C. | ||
| 3460 | (defun byte-compile-backward-char (form) | 3463 | (defun byte-compile-backward-char (form) |
| 3461 | (cond ((or (= 1 (length form)) | 3464 | (cond ((or (= 1 (length form)) |
| 3462 | (and (= 2 (length form)) (not (nth 1 form)))) | 3465 | (and (= 2 (length form)) (not (nth 1 form)))) |
| @@ -3464,7 +3467,7 @@ discarding." | |||
| 3464 | ((= 2 (length form)) | 3467 | ((= 2 (length form)) |
| 3465 | (byte-compile-form (list 'forward-char (if (numberp (nth 1 form)) | 3468 | (byte-compile-form (list 'forward-char (if (numberp (nth 1 form)) |
| 3466 | (- (nth 1 form)) | 3469 | (- (nth 1 form)) |
| 3467 | `(- ,(nth 1 form)))))) | 3470 | `(- (or ,(nth 1 form) 1)))))) |
| 3468 | (t (byte-compile-subr-wrong-args form "0-1")))) | 3471 | (t (byte-compile-subr-wrong-args form "0-1")))) |
| 3469 | 3472 | ||
| 3470 | (defun byte-compile-backward-word (form) | 3473 | (defun byte-compile-backward-word (form) |
| @@ -3474,7 +3477,7 @@ discarding." | |||
| 3474 | ((= 2 (length form)) | 3477 | ((= 2 (length form)) |
| 3475 | (byte-compile-form (list 'forward-word (if (numberp (nth 1 form)) | 3478 | (byte-compile-form (list 'forward-word (if (numberp (nth 1 form)) |
| 3476 | (- (nth 1 form)) | 3479 | (- (nth 1 form)) |
| 3477 | `(- ,(nth 1 form)))))) | 3480 | `(- (or ,(nth 1 form) 1)))))) |
| 3478 | (t (byte-compile-subr-wrong-args form "0-1")))) | 3481 | (t (byte-compile-subr-wrong-args form "0-1")))) |
| 3479 | 3482 | ||
| 3480 | (defun byte-compile-list (form) | 3483 | (defun byte-compile-list (form) |