From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Add a function that returns pixel distance between points? Date: Wed, 3 Feb 2021 11:48:27 -0500 Message-ID: <9D8765CF-5C32-4407-BF28-AF2857C943FC@gmail.com> References: <960DAE7C-A1AF-416A-ACA5-F6674C87A2C9@gmail.com> <837dnt9400.fsf@gnu.org> <1EDD0FA5-025C-4A87-BBA1-7B8944E91A12@gmail.com> <83tuqx6sdz.fsf@gnu.org> <83ft2g7tlr.fsf@gnu.org> <51016978-4D2F-45A8-8589-F4562B6DC4A8@gmail.com> <83v9bb6429.fsf@gnu.org> <83bld25t7o.fsf@gnu.org> <83r1lx42g9.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) 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="39876"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 03 17:50:58 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 1l7LMn-000AG0-Ud for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Feb 2021 17:50:57 +0100 Original-Received: from localhost ([::1]:55328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7LMm-0007eI-N8 for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Feb 2021 11:50:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LKU-0005wd-GO for emacs-devel@gnu.org; Wed, 03 Feb 2021 11:48:35 -0500 Original-Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]:41931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7LKR-0006uc-A6; Wed, 03 Feb 2021 11:48:34 -0500 Original-Received: by mail-qv1-xf2d.google.com with SMTP id h21so254875qvb.8; Wed, 03 Feb 2021 08:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lpXD53ImGyZtn1/NL1RgODvvMdgbUyArRRSUAUOQlKU=; b=P5X5eauK4wMxI1HgQ+eQorUYv4g/tTupsdpGldIhknf41VCgq98aGPPe4SmkFeVXii 0AOcV7rmn8JyJGHqQ3PRmnlXYR8smTxRnyAKzLqwcPA0vZ4oSe94HM6Sj5/UjerVigqg hEWyyJlrqhV3+JAJPYzlz2DoSRhPshvLt6sGveJe+UUaTWwQyXWe8DROIzAirBhio2Lv gsqo0YVbeKlwxcwtbWedWITfpMDVlgb/ZSuOKCJdigiwbhPli8cBxbgiSi3/LAF7PCk6 +MuOaSneLT0/3EsJXRkGWlOjUPGw8dW1Jk5Apl7RST9lCPzzFh3WR0G2voPWJeUBsjv0 Jwdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=lpXD53ImGyZtn1/NL1RgODvvMdgbUyArRRSUAUOQlKU=; b=nmn+vVgoFyQ33tJhyA87QDeLBSg7TXxeGOg0GqjUGo2kLcDpqjZojTwsHXLwejjYuR EibER85H6GdSCizfdPnmFT3wzGPvvR1vNtjDgsDEeeqFuvSwBzXFbYV2C39TxJ2XZahZ Bcl5o7wXvO0boapMbFVt+STm8Bv7gPiGyiTDZzP676w/17g4aHk7iDHx/R+jhGz6O56T oVBKjRmPNzIHFuiwXWRorjJpphXFdKpdzqdFaNdlBBKR/KLWnpGzhdbTqmDiRmvdpKtU ke7gw9OOC65CrSY1TcedMNS8+w6JmND6JS/m/x8dPirvXFZDzMOsN30qJSICvqtHXeVs fDig== X-Gm-Message-State: AOAM532F7lpIpUJ+956H+GgEiFdo81dv6oHOHAWvndXrBiVoWqD6f3E4 Vz39pH3EsFzZ5G7qq91sWHO9j/wlvOsC1g== X-Google-Smtp-Source: ABdhPJzzJOGMOaplprIiN63azbmkd7l2K550A+cHA0jXh1nG/1NFXWV0viyIbcT54LufKXrr9ruwHw== X-Received: by 2002:a0c:8485:: with SMTP id m5mr3782852qva.14.1612370909161; Wed, 03 Feb 2021 08:48:29 -0800 (PST) Original-Received: from ?IPv6:2601:98a:4200:9210:994b:448d:5677:d025? ([2601:98a:4200:9210:994b:448d:5677:d025]) by smtp.gmail.com with ESMTPSA id a11sm1972591qkc.111.2021.02.03.08.48.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Feb 2021 08:48:28 -0800 (PST) In-Reply-To: <83r1lx42g9.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.40.0.2.32) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=casouri@gmail.com; helo=mail-qv1-xf2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:263812 Archived-At: > On Feb 3, 2021, at 10:04 AM, Eli Zaretskii wrote: >=20 >> Date: Tue, 02 Feb 2021 18:29:15 +0200 >> From: Eli Zaretskii >> Cc: emacs-devel@gnu.org >>=20 >>> From: Yuan Fu >>> Date: Mon, 1 Feb 2021 18:00:18 -0500 >>> Cc: emacs-devel >>>=20 >>> This code inserts a mini table >>>=20 >>> | looooong | >>> | world | >>>=20 >>> And tries to aligns it to >>>=20 >>> | looooong | >>> | world | >>>=20 >>> You will notice there are extra white space on the right of the = cells, and the table actually looks like this: >>>=20 >>> | loooooong | >>> | world | >>>=20 >>> That=E2=80=99s because window-text-pixel-size returned a width = that=E2=80=99s larger than the true with of the cells. If you enlarge = the line-prefix, the extra space grows. >>=20 >> Hmm... this sounds like some bug in window-text-pixel-size. Let me >> take a closer look. >=20 > It turned out the function wasn't designed to handle text that spans > less than a single screen line. >=20 > Does the patch below fix your problems? Yes, it worked well. Thanks! Yuan=