all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "rgb" <rbielaws@i1.net>
Subject: Re: window-line and window-column
Date: 7 Oct 2005 17:49:24 -0700	[thread overview]
Message-ID: <1128732564.330018.230170@g43g2000cwa.googlegroups.com> (raw)
In-Reply-To: <yoijek6wc3hj.fsf@linus003.dd.chalmers.se>

> > 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	other threads:[~2005-10-08  0:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-07 22:44 window-line and window-column rgb
2005-10-07 23:08 ` Neon Absentius
2005-10-07 23:09 ` Lennart Borgman
2005-10-07 23:27 ` Johan Bockgård
2005-10-08  0:49   ` rgb [this message]
2005-10-11  4:05     ` Stefan Monnier
2005-10-11  4:38       ` rgb
2005-10-11  5:02         ` Stefan Monnier
2005-10-11  5:09           ` rgb
2005-10-13 18:02             ` rgb
2005-10-14 15:06               ` rgb
     [not found] ` <mailman.10338.1128726582.20277.help-gnu-emacs@gnu.org>
2005-10-08  0:20   ` rgb
2005-10-08  2:29     ` Neon Absentius
2005-10-11  1:18 ` Hovav Shacham
2005-10-11  3:34   ` rgb

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

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

  git send-email \
    --in-reply-to=1128732564.330018.230170@g43g2000cwa.googlegroups.com \
    --to=rbielaws@i1.net \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.