davis@muscle.mps.ohio-state.edu ("John E. Davis") (02/03/90)
Recently I posted an article titled: What's wrong with my function?
I received an enormous amount of email on the subject and I want to thank
everyone who responded. The function I had problems with is:
(defun insert-other-window () (interactive)
((other-window 1)
(beginning-of-buffer)
(set-mark-command)
(end-of-buffer)
(copy-region-as-kill)
(other-window 1)
(yank)))
I was told by everyone who responded to me that the problem is I have too many
parenthesis. The reason I put the extra set in is that with out it I get an
error message that I don't understand. The error appears in the mini buffer
and when I touch a key it is gone. Basically it says that I have too many
parameters for lamda or somthing... The upshot is that removing the extra set
of parenthesis does not work.
The best alternative to what I had in mind was sent to me by
eirik@elf.tn.cornell.edu for which I am grateful.
Here is his solution:
(defun insert-other-window ()
(interactive)
(insert-buffer (window-buffer (next-window))))
So I admit that using 'high level' commands such as 'end-of-buffer' is stupid
but the question still remains: What's wrong with my function?
John E. Davis