bug-gnu-emacs
[Top][All Lists]
Advanced

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

byte-opt.el: byte-optimize-backward-word


From: sri
Subject: byte-opt.el: byte-optimize-backward-word
Date: Sat, 09 Oct 2004 20:16:54 -0700 (MST)
User-agent: IMP/PHP IMAP webmail program 2.2.3

Using GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
        of 2004-07-07 on localhost.localdomain.

In byte-opt.el:

(put 'backward-word 'byte-optimizer 'byte-optimize-backward-word)
(defun byte-optimize-backward-word (form)
  (cond ((and (= 2 (safe-length form))
              (numberp (nth 1 form)))
         (list 'forward-word (eval (- (nth 1 form)))))
        ((= 1 (safe-length form))
         '(forward-char -1))
;-------------^
        (t form)))

Shouldn't that be (forward-word -1)?  Also, backward-word requires an
argument; so, shouldn't Emacs complain here when it encounters 
backward-word without an argument.  (IIRC, several other optimizer
functions do something similar -- provide arguments when none is
there, for functions that require it.)

-Sriram




reply via email to

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