From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri D'Elia Newsgroups: gmane.emacs.devel Subject: Re: Getting column position accounting for overlays Date: Sat, 8 Aug 2015 18:29:18 +0200 Message-ID: <55C62E5E.8050300@thregr.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1439051399 15998 80.91.229.3 (8 Aug 2015 16:29:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2015 16:29:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 08 18:29:51 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 1ZO70H-0002ow-MQ for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 18:29:49 +0200 Original-Received: from localhost ([::1]:53316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO70C-0007Ge-2E for ged-emacs-devel@m.gmane.org; Sat, 08 Aug 2015 12:29:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO700-0007GT-9R for emacs-devel@gnu.org; Sat, 08 Aug 2015 12:29:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZO6zv-0003g2-OG for emacs-devel@gnu.org; Sat, 08 Aug 2015 12:29:32 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZO6zv-0003fr-Hl for emacs-devel@gnu.org; Sat, 08 Aug 2015 12:29:27 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZO6zt-0002Ws-2J for emacs-devel@gnu.org; Sat, 08 Aug 2015 18:29:25 +0200 Original-Received: from 193.106.183.2 ([193.106.183.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Aug 2015 18:29:25 +0200 Original-Received: from wavexx by 193.106.183.2 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Aug 2015 18:29:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.2 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.1.0 In-Reply-To: <831tfdrdjw.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:188621 Archived-At: 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, and was explicitly looking for character lengths/distances between arbitrary points. 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). But maybe I'm just arguing about nothing, and this is not really something that can be generalized. If you're using a variable pitch font, everything does down the drain anyway.