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: Add a function that returns pixel distance between points? Date: Sat, 30 Jan 2021 15:47:38 -0500 Message-ID: <960DAE7C-A1AF-416A-ACA5-F6674C87A2C9@gmail.com> 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="37966"; mail-complaints-to="usenet@ciao.gmane.io" To: "emacs-devel\\@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 30 21:48:51 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 1l5xAn-0009lS-BL for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Jan 2021 21:48:49 +0100 Original-Received: from localhost ([::1]:45616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5xAm-0000W5-Ci for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Jan 2021 15:48:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5x9k-00087K-CX for emacs-devel@gnu.org; Sat, 30 Jan 2021 15:47:44 -0500 Original-Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:36773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5x9h-0002jg-1k for emacs-devel@gnu.org; Sat, 30 Jan 2021 15:47:44 -0500 Original-Received: by mail-qk1-x734.google.com with SMTP id 19so12412363qkh.3 for ; Sat, 30 Jan 2021 12:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=spB37lOOdxyxyoWHoGzFdu04aRK1d+akNJNnwitsZcU=; b=RALF5aGFT4Ojb+RaTJz5h2Fpht9Q8HcrRMLGsH7ceW40qel2fboI8sbCEQdgy/x2Oy ymSTw4Xz++fLNQJTa6c1lpC2wDZTJd6gofo73GN7rTefMU0jjOaC9b5ttlJA4l7S8uOp ntK8Ri6cpLSdaR2j5ldrCkXcvm+5uO94CTX8uKudHCluLXmdJiV3zjRbuYCMArfRlSIy J3HDlhHioA/bo08ivLxg9zlO8hDk6CqhpOKXsRz5GvNAde3WuQ6XuXZZXDTtgqbwqIEc lRB/LKAbLlxUDeS6Q/f1fFBFQl2l4MlOhW6Y0odtlAxWeMbUnlzRCGQMLyLWvitSsl3b /tTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=spB37lOOdxyxyoWHoGzFdu04aRK1d+akNJNnwitsZcU=; b=NakmtWkkLfgeCJ5VFCEh/SwwkwpjKTtDVGQ4Slnu322wmNuQsPeJHUNs2b5Q9lvnsK KsqfeCXJqQKCjse6J++R8Wx/y3w0o04gMrHflOQvL6LjGDml95MLfZ6rC2VHHcfkGJtb F5gFRH2+LcvXJ1F9DL9dSlon4IB3F1XXvhbyMbgwQCbBbCDD8chGlE0HK2dQZZACV2kp Uj7DPGPV1xnBwK+Wet8wau/viqoQHms84Ystfo0r/Me6j18aOXaLVKugs1PhdQwjDumw HoknuSjy+5dhRxmOk6EAjseUy4Sx20rHRk2QHZiB1jRzw8tQ46t05muvXwaybLhkbHl7 K3uw== X-Gm-Message-State: AOAM533kZsW0ynuJQ1UkpBbKEloh9785LPfbK+EqsoPtX62ofYu/xO/p JO64ZmPDAA/fX3nEv4QlARsVSZLum3FDmg== X-Google-Smtp-Source: ABdhPJw7/2Sw3wBo1VFa7Ua5WqzpCCB2VJNBP2mxmSQ0t5Krz0QQplUmzGLNu/hQhjnVdIOuPvPwow== X-Received: by 2002:a37:a6d2:: with SMTP id p201mr9942034qke.186.1612039659585; Sat, 30 Jan 2021 12:47:39 -0800 (PST) Original-Received: from ?IPv6:2601:98a:4200:9210:ecbd:be8f:9e6f:3a5b? ([2601:98a:4200:9210:ecbd:be8f:9e6f:3a5b]) by smtp.gmail.com with ESMTPSA id y135sm10107016qkb.14.2021.01.30.12.47.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jan 2021 12:47:39 -0800 (PST) X-Mailer: Apple Mail (2.3654.40.0.2.32) Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=casouri@gmail.com; helo=mail-qk1-x734.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:263639 Archived-At: For aligning text according to their display size, I need to calculate = the width of some text. Currently I=E2=80=99m using = window-text-pixel-size, but it has some problem: if the text I=E2=80=99m = measuring has line-prefix or wrap-prefix, the size returned will include = the width of the prefix. So if the prefix is 14 pixels wide and the text = is 7 pixels wide, the returned value is 21 instead of 7. Line number = width is sometimes included in the result and sometimes not. There is also posn-at-point but that requires the point to be visible in = the window. My alignment function wants to run in jit-lock so point is = not always visible, so I can=E2=80=99t use posn-at-point. Yuan=