From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: visual-line-mode Date: Fri, 4 Jul 2008 17:21:13 +0100 Message-ID: <53D640C5-B7CA-4D7A-8BFB-4A5421A744D4@gmail.com> References: <87zlp4raab.fsf@catnip.gol.com> <87d4lzehq2.fsf@stupidchicken.com> <87skuqbwr8.fsf@stupidchicken.com> <85E9BC5B-7337-4CD4-A783-6B2FAEBAEBCA@gmail.com> <87tzf6c5il.fsf@stupidchicken.com> <87abgxx0ju.fsf@stupidchicken.com> <4D997CA8-A2ED-4E12-9F91-76E98AE95210@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v926) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1215188504 384 80.91.229.12 (4 Jul 2008 16:21:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Jul 2008 16:21:44 +0000 (UTC) Cc: Chong Yidong , Emacs-Devel devel , "Lennart Borgman \(gmail\)" , Miles Bader To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 04 18:22:29 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KEo38-0001cl-7A for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 18:22:18 +0200 Original-Received: from localhost ([127.0.0.1]:39226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEo2H-0003ED-Ah for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 12:21:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEo2B-0003DH-UY for emacs-devel@gnu.org; Fri, 04 Jul 2008 12:21:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEo2A-0003Cq-3K for emacs-devel@gnu.org; Fri, 04 Jul 2008 12:21:19 -0400 Original-Received: from [199.232.76.173] (port=42684 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEo29-0003Cj-Uj for emacs-devel@gnu.org; Fri, 04 Jul 2008 12:21:17 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.187]:23476) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEo29-00063C-CK for emacs-devel@gnu.org; Fri, 04 Jul 2008 12:21:17 -0400 Original-Received: by nf-out-0910.google.com with SMTP id c7so350728nfi.26 for ; Fri, 04 Jul 2008 09:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=WLnO03a1UooNT8qOlDY5eNAaegAgllhK09Hhqa7GV+Y=; b=l0R6eao0zU6xLfZQqSX2h37FiHfcz3xPIQH4ICcrmgv0q2EIgkr6UecltakRluUyWY q6XtIBQGW7a+8D6260yz8cajXhwlkkOJP8CM48lrsfQLbtdvGcvsuGTfB2+pSSu+K5bl xbQlXFIYzJslmVI6XM94NjrpHPf6ARsJ4q3c8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=r/6qUJ9vtH/741RO56gHkvacr9qccklEqSzbwpTAbv0xPR9W4Mpa+syJUDVTuqaodj lPkDqD+okeKc+uGxFRFMYi9N0j9oYfLVNs6+Yxwo2Fq09Oq0EFHs0q/5mgt0BivwJY1G dXP229lEFjNL5f/JoLYaPVD+IBNJKclv28Vus= Original-Received: by 10.210.22.8 with SMTP id 8mr478702ebv.19.1215188476534; Fri, 04 Jul 2008 09:21:16 -0700 (PDT) Original-Received: from dhcp-90-210.inf.ed.ac.uk ( [129.215.90.210]) by mx.google.com with ESMTPS id z37sm568510ikz.6.2008.07.04.09.21.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Jul 2008 09:21:14 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.926) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:100346 Archived-At: On 4 Jul 2008, at 16:49, Stefan Monnier wrote: >> If we had a way to determine the buffer position for given pixel >> coordinates (something like posn-point, without requiring the event >> structure that contains the information), > > Does posn-at-x-y provide the info you need? That's a pretty good suggestion, thanks. This should make it possible to write a non-iterative algorithm, as below. I'll see if I can make it work for the scrolling case and insert goal columns etc. - D (defun go-up (point) (interactive "p") (let ((x (car (posn-x-y (posn-at-point))))) (vertical-motion -1) (let ((y (cdr (posn-x-y (posn-at-point))))) (posn-set-point (posn-at-x-y x y)))))