From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Getting column position accounting for overlays Date: Sat, 08 Aug 2015 19:48:36 +0300 Message-ID: <83zj21pvyz.fsf@gnu.org> References: <83a8u6tplx.fsf@gnu.org> <55C1D323.50505@thregr.org> <831tfhu5ge.fsf@gnu.org> <55C25983.5040702@thregr.org> <83vbctsgo6.fsf@gnu.org> <55C4E756.5020607@thregr.org> <83r3nfq7uq.fsf@gnu.org> <8337ztrg98.fsf@gnu.org> <55C61DE6.7050706@thregr.org> <831tfdrdjw.fsf@gnu.org> <55C62E5E.8050300@thregr.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1439052544 1026 80.91.229.3 (8 Aug 2015 16:49:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2015 16:49:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Yuri D'Elia Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 08 18:48:55 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZO7Ik-0001Xt-Uw for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 18:48:55 +0200 Original-Received: from localhost ([::1]:53345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO7Ik-0004fO-9c for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 12:48:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO7IX-0004ef-LR for emacs-devel@gnu.org; Sat, 08 Aug 2015 12:48:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZO7IU-00035h-G8 for emacs-devel@gnu.org; Sat, 08 Aug 2015 12:48:41 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:48304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO7IU-00035W-7l for emacs-devel@gnu.org; Sat, 08 Aug 2015 12:48:38 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NSR00500VAGUE00@mtaout28.012.net.il> for emacs-devel@gnu.org; Sat, 08 Aug 2015 19:48:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NSR005B4W12HI30@mtaout28.012.net.il>; Sat, 08 Aug 2015 19:48:38 +0300 (IDT) In-reply-to: <55C62E5E.8050300@thregr.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188622 Archived-At: > From: Yuri D'Elia > Date: Sat, 8 Aug 2015 18:29:18 +0200 > > On 08/08/15 17:43, Eli Zaretskii wrote: > >> To be more concrete, what about a (visual-column) function, that just > >> gives what's currently needed? > > > > I've already shown you a way to compute that, several message ago. > > Let me repeat: > > > > (/ (car (window-text-pixel-size nil (line-beginning-position) (point))) > > (default-font-width)) > > I didn't like this solution precisely because it doesn't rely on > character-cells units Why do you say that? Did you try it and saw problems? If so, please show the test cases where the above doesn't do what you want. > and was explicitly looking for character lengths/distances between > arbitrary points. So you are saying that you want to count a double-width character as a single character "cell" even though it will take up 2 columns on display? And you'd like to count a TAB as a single "cell" even though it can take 1 to 8 columns on display? Why would something like that be useful? It also goes against current-column, which you said was the model for what you were looking. > If this calculation would be used in rigid-tabs for instance, I would > calculate different amount of spaces whether a variable-pitch font is > used or not, while my intention is much closer to (current-column). current-column does know that a TAB doesn't take a single column. And you said that variable-pitch fonts are not part of the problem yuou want to solve anyway. So now I'm confused regarding what you are looking for. > If you're using a variable pitch font, everything does down the drain > anyway. Not if you calculate dimensions in pixels, no.