From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Alternative to current-column that counts from visual line beginning Date: Tue, 29 Dec 2020 08:21:06 +0200 Message-ID: <9CF22BD8-B889-4859-9119-A054B1084840@gnu.org> References: <87F0777E-F283-4315-B9E5-D104B145EF89@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9553"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android Cc: "emacs-devel@gnu.org" To: emacs-devel@gnu.org, Yuan Fu , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 29 07:22:09 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ku8OX-0002NX-Du for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Dec 2020 07:22:09 +0100 Original-Received: from localhost ([::1]:52418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ku8OW-0007DC-FK for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Dec 2020 01:22:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ku8Nc-0006mS-5P for emacs-devel@gnu.org; Tue, 29 Dec 2020 01:21:13 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54174) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ku8Nb-0000ws-TT; Tue, 29 Dec 2020 01:21:11 -0500 Original-Received: from [2a02:14f:80:9584::1] (port=53180) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ku8Nb-00084I-3J; Tue, 29 Dec 2020 01:21:11 -0500 In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:262054 Archived-At: On December 29, 2020 7:01:16 AM GMT+02:00, Yuan Fu wr= ote: >=20 >=20 > > On Dec 28, 2020, at 9:40 PM, Stefan Monnier > wrote: > >=20 > >> to get the column number counting from the visual line beginning=2E > Is > >> there a function that does what I want? If not, maybe we should add > >> one, or add an argument to current-column=2E > >=20 > > `posn-at-point`? > >=20 >=20 > That works, albeit a bit convoluted comparing to current-column and > only works when point is visible=2E Another less legit point is that > posn-at-point is a bit far-fetched semantically: for me it is more > about GUI pixel positions than text-based column and line positions=2E > All things considered, I still prefer a dedicated function or an > additional argument to current-column=2E >=20 > Yuan The concept of "visual line" of some buffer position only makes sense in t= he context of displaying the buffer in some window=2E That's because windo= w dimensions and other window-specific aspects, such as faces and overlays,= have direct and prominent effect on how physical lines are divided into vi= sual lines=2E Therefore, I don't think I understand how can a function exist that report= s the "visual column" of a buffer position without telling it the window in= which to display that buffer=2E Could you perhaps outline the algorithm f= or such a function? Perhaps there is some misunderstanding=2E