unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Friedrich Dominicus <frido@q-software-solutions.com>
Subject: Re: Newbie Conditional Problem
Date: 17 Jan 2003 16:36:43 +0100	[thread overview]
Message-ID: <87ptqvokj8.fsf@fbigm.here> (raw)
In-Reply-To: Q9VV9.42817$aG4.2470318@twister.austin.rr.com

"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	other threads:[~2003-01-17 15:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-17 15:19 Newbie Conditional Problem CarlC
2003-01-17 15:36 ` Friedrich Dominicus [this message]
2003-01-17 16:09   ` CarlC
2003-01-18  6:27     ` Friedrich Dominicus
2003-01-18 13:35       ` Johan Bockgård
2003-01-18 16:59         ` Friedrich Dominicus
2003-01-18 13:48       ` Christopher J. White
2003-01-18 17:03         ` Friedrich Dominicus
2003-01-17 16:19 ` Brendan Halpin
     [not found] ` <x54r87zrdo.fsf@lola.goethe.zz>
2003-01-17 16:46   ` CarlC
2003-01-17 16:52     ` David Kastrup
2003-01-17 17:24       ` CarlC
2003-01-17 17:42 ` Stefan Monnier <foo@acm.com>
2003-01-18 17:36 ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ptqvokj8.fsf@fbigm.here \
    --to=frido@q-software-solutions.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).