all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* byte-opt.el: byte-optimize-backward-word
@ 2004-10-10  3:16 sri
  2004-10-10 14:28 ` Andreas Schwab
  2004-10-10 15:16 ` Richard Stallman
  0 siblings, 2 replies; 3+ messages in thread
From: sri @ 2004-10-10  3:16 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-10 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-10  3:16 byte-opt.el: byte-optimize-backward-word sri
2004-10-10 14:28 ` Andreas Schwab
2004-10-10 15:16 ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.