emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112871: bytecomp fix for bug#14565


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112871: bytecomp fix for bug#14565
Date: Thu, 06 Jun 2013 17:04:43 -0400
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112871
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2013-06-06 17:04:43 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/bytecomp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-06 05:35:01 +0000
+++ b/lisp/ChangeLog    2013-06-06 21:04:43 +0000
@@ -1,3 +1,9 @@
+2013-06-06  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        * isearch.el (isearch-allow-prefix): New user option.

=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- a/lisp/emacs-lisp/bytecomp.el       2013-06-05 02:35:40 +0000
+++ b/lisp/emacs-lisp/bytecomp.el       2013-06-06 21:04:43 +0000
@@ -3447,31 +3447,34 @@
 (byte-defop-compiler nconc)
 
 (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))
                                                  (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"))))
 
 ;; backward-... ==> forward-... with negated argument.
 (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))
                                                    (- (nth 1 form))
                                                  `(- ,(nth 1 form))))))
-       ((= 1 (length form))
-        (byte-compile-form '(forward-char -1)))
        (t (byte-compile-subr-wrong-args form "0-1"))))
 
 (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))
                                                    (- (nth 1 form))
                                                  `(- ,(nth 1 form))))))
-       ((= 1 (length form))
-        (byte-compile-form '(forward-word -1)))
        (t (byte-compile-subr-wrong-args form "0-1"))))
 
 (defun byte-compile-list (form)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]