From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: window-line and window-column Date: 7 Oct 2005 17:49:24 -0700 Organization: http://groups.google.com Message-ID: <1128732564.330018.230170@g43g2000cwa.googlegroups.com> References: <1128725063.828807.151870@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1128733328 9141 80.91.229.2 (8 Oct 2005 01:02:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Oct 2005 01:02:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 08 03:02:06 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EO35J-0006UR-2d for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Oct 2005 03:01:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EO2vu-0000IX-NI for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Oct 2005 20:51:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!news.glorb.com!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: 71.34.3.210 Original-X-Trace: posting.google.com 1128732569 13690 127.0.0.1 (8 Oct 2005 00:49:29 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 8 Oct 2005 00:49:29 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g43g2000cwa.googlegroups.com; posting-host=71.34.3.210; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:134486 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30065 Archived-At: > > 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.