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

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

Re: Newbie Conditional Problem


From: David Kastrup
Subject: Re: Newbie Conditional Problem
Date: 17 Jan 2003 17:13:23 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

"CarlC" <carlc@snowbd.com> writes:

> Hi.
> 
> I have written my first elisp function. (pause for roar of crowd). I am
> getting an error while trying to process my first conditional and debug is
> not helping me. This is for emacs 21.2.1.
> 
>           (let ((line (current-line)))
>             (forward-word 1)
>             (if (> (current-line) line) ((goto-line line) (end-of-line))))
> ...
> (defun current-line ()
>   "Return the vertical position of point..."
>   (+ (count-lines (window-start) (point))
>      (if (= (current-column) 0) 1 0)
>      -1))
> 
> When the if statement is true, I get an error:  Invalid function: (goto-line
> line)

Well, what do you expect? (goto-line line) is no function, and you
use it in the place of one, namely immediately after an opening
parenthesis of a non-special form.  I recommend that you instead use
progn after the opening parenthesis.  Look it up with

C-h f progn RET

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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