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

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

Re: window-line and window-column


From: rgb
Subject: Re: window-line and window-column
Date: 7 Oct 2005 17:49:24 -0700
User-agent: G2/0.2

> > How can I tell where, within the current window, I am.
>
> See (info "(elisp)Screen Lines")
>
I was contemplating what information I need to calculate it
myself and was about to ask if this list was complete:

To calculate (window-column) I need:

truncate-lines (window-width) (current-column) and (window-hscroll)

To get (window-line) I'm thinking I'll need:

truncate-lines (window-width) (current-column) (line-number-at-pos)
and (window-start)

I did re-read the section you suggested and it reminded me that
(line-number-at-pos) and (current-column) may not tell me anything
about (point) in the (selected-window) and so I also need to
compare (current-buffer) with (window-buffer).  It also reminded me
that (line-number-at-pos) can be a hog in big files and I may want
to count newline characters between points myself rather than
subtract values it returns.

If your intent was to point to an expedient path to the values
I need I guess I've missed your point.

Perhaps you wanted me to see compute-motion but I don't see how
it helps.  It appears to be concerned with "screen coordinates"
which, to me means physical display coordinates, not window
coordinates or frame coordinates which I would expect it to
mention if it were talking about anything useful to my situation.
I'm guessing it's intended for handling mouse events but it's
not clear to me what practical application it's intended for.



reply via email to

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