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

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

Re: Newbie Conditional Problem


From: Friedrich Dominicus
Subject: Re: Newbie Conditional Problem
Date: 17 Jan 2003 16:36:43 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Native Windows TTY Support)

"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))
I guess current-line is wrong the documentation for windows start

gives `window-start' is a built-in function
(window-start BUFFER &optional WHICH-FRAMES WHICH-DEVICES) and the -1
is probably wrong too.

Documentation:
ans search all devices.

I can't see how if fits. Try this
(defun current-line ()
  "Return the vertical position of point within the current buffer."
   (+ (count-lines (point-min) (point))
      (if (= (current-column) 0) 1 0)))

Regards
Friedrich


reply via email to

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