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: Add a function that returns pixel distance between points? Date: Sun, 31 Jan 2021 22:13:20 +0200 Message-ID: <83ft2g7tlr.fsf@gnu.org> References: <960DAE7C-A1AF-416A-ACA5-F6674C87A2C9@gmail.com> <837dnt9400.fsf@gnu.org> <1EDD0FA5-025C-4A87-BBA1-7B8944E91A12@gmail.com> <83tuqx6sdz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25458"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 31 21:13:44 2021 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 1l6J6N-0006Vv-KW for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Jan 2021 21:13:43 +0100 Original-Received: from localhost ([::1]:45694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6J6M-0007pS-NG for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Jan 2021 15:13:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6J5e-0007OZ-8n for emacs-devel@gnu.org; Sun, 31 Jan 2021 15:12:58 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38408) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6J5e-0001OU-1V; Sun, 31 Jan 2021 15:12:58 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4459 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l6J5b-0000xv-UT; Sun, 31 Jan 2021 15:12:56 -0500 In-Reply-To: (message from Yuan Fu on Sun, 31 Jan 2021 14:41:52 -0500) 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:263666 Archived-At: > From: Yuan Fu > Date: Sun, 31 Jan 2021 14:41:52 -0500 > Cc: emacs-devel@gnu.org > > > Finally, I'm not sure why the behavior of window-text-pixel-size is a > > problem: if you use :align-to with pixel units (as opposed to column > > units), then you should _want_ it to account for stuff like > > line-prefix, no? > > Yes, value given to :align-to needs to account for line-prefix. But when I want to calculate the pixel width of a column, I don’t want to include the prefix: that makes the returned value larger than the actually width of the column (because the line-prefix width is added to it). But the pixel coordinate to which you need to align also needs to be increased due to line-prefix, doesn't it? IOW, can you show a test case where using window-text-pixel-size returns incorrect results for :align-to due to line-prefix?