mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-08 23:40:24 -08:00
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.
This commit is contained in:
parent
650645d50f
commit
467f3b337c
2 changed files with 12 additions and 3 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
2013-06-08 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
|
* emacs-lisp/bytecomp.el (byte-compile-char-before)
|
||||||
|
(byte-compile-backward-char, byte-compile-backward-word):
|
||||||
|
Improve previous change, to handle non-explicit nil.
|
||||||
|
|
||||||
2013-06-07 Stefan Monnier <monnier@iro.umontreal.ca>
|
2013-06-07 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||||
|
|
||||||
* emacs-lisp/smie.el: Improve show-paren-mode behavior.
|
* emacs-lisp/smie.el: Improve show-paren-mode behavior.
|
||||||
|
|
|
||||||
|
|
@ -3446,6 +3446,7 @@ discarding."
|
||||||
(byte-defop-compiler (/ byte-quo) byte-compile-quo)
|
(byte-defop-compiler (/ byte-quo) byte-compile-quo)
|
||||||
(byte-defop-compiler nconc)
|
(byte-defop-compiler nconc)
|
||||||
|
|
||||||
|
;; Is this worth it? Both -before and -after are written in C.
|
||||||
(defun byte-compile-char-before (form)
|
(defun byte-compile-char-before (form)
|
||||||
(cond ((or (= 1 (length form))
|
(cond ((or (= 1 (length form))
|
||||||
(and (= 2 (length form)) (not (nth 1 form))))
|
(and (= 2 (length form)) (not (nth 1 form))))
|
||||||
|
|
@ -3453,10 +3454,12 @@ discarding."
|
||||||
((= 2 (length form))
|
((= 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- (or ,(nth 1 form)
|
||||||
|
(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.
|
||||||
|
;; Is this worth it? Both -backward and -forward are written in C.
|
||||||
(defun byte-compile-backward-char (form)
|
(defun byte-compile-backward-char (form)
|
||||||
(cond ((or (= 1 (length form))
|
(cond ((or (= 1 (length form))
|
||||||
(and (= 2 (length form)) (not (nth 1 form))))
|
(and (= 2 (length form)) (not (nth 1 form))))
|
||||||
|
|
@ -3464,7 +3467,7 @@ discarding."
|
||||||
((= 2 (length form))
|
((= 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))))))
|
`(- (or ,(nth 1 form) 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)
|
||||||
|
|
@ -3474,7 +3477,7 @@ discarding."
|
||||||
((= 2 (length form))
|
((= 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))))))
|
`(- (or ,(nth 1 form) 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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue