From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#37770: [PATCH] Expose scale factor through the redisplay interface Date: Thu, 17 Oct 2019 10:01:40 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="76581"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37770@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 17 10:02:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iL0jg-000Jgp-NN for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Oct 2019 10:02:17 +0200 Original-Received: from localhost ([::1]:39156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL0jf-0001bw-G4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Oct 2019 04:02:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41942) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL0jY-0001bf-H8 for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2019 04:02:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL0jT-0000r2-FH for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2019 04:02:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL0jT-0000qv-9j for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2019 04:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iL0jT-0002N9-6B for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2019 04:02:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Oct 2019 08:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37770 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37770-submit@debbugs.gnu.org id=B37770.15712993189108 (code B ref 37770); Thu, 17 Oct 2019 08:02:02 +0000 Original-Received: (at 37770) by debbugs.gnu.org; 17 Oct 2019 08:01:58 +0000 Original-Received: from localhost ([127.0.0.1]:47065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iL0jM-0002Mn-2g for submit@debbugs.gnu.org; Thu, 17 Oct 2019 04:01:56 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:46438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iL0jI-0002MZ-Rr for 37770@debbugs.gnu.org; Thu, 17 Oct 2019 04:01:54 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id o18so1143882wrv.13 for <37770@debbugs.gnu.org>; Thu, 17 Oct 2019 01:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=FVa2JvePGsudzllAvaYOZo4PjFYvzP3qTi61jp0lVmE=; b=U2FHQRyxbbgtHtaBdUXMbllz8c0JsRKJbYidy15gDrJg2b7ygIzYPlDaTgmMX5BQph fVUzO78P4aooaPW9+w+n+KklyGmhBLfZ/bvlm7ia0XBCChu+lz+VLu3LsQA+kw4nj5lG DQxmjUNEm9lhtO3yW4Mg1jZ9YaBXw0glpT2zcSgjyCjzPy7RmNOlPlnceGSlDO+Gkuuq HUtw8CklJzG4X4kNAWsXU2jf43Ap7HfgQW3Ry6eHrCUfnrzjXCiduwQKTUsBPx/E8PHO xygZWsPBVxcc3EejJRW22OjijgTByyqwzYDj5vwyurij4yaikKvBpYm6XkKOnAx0LfJ3 TilQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=FVa2JvePGsudzllAvaYOZo4PjFYvzP3qTi61jp0lVmE=; b=sqTGLmM/OFdRh/4yllBA0ySg7lFOeABM7pijdDav121G1ak1u6WvMWkS8Jr6HQQtxx 1kgYFeEcyQHvDEdGm6D7BCjDJH3OWchqMPgq7aNBewj3ET9cljvTshbU0oG9yzJ4cfTt VS46QM+nCE0JvDctZS/v2ZFvqr+WOUGluBBCsHYnwctTkEATd95ySNQRES8EOd6L+aDo nnFhtkpuJwhgLmsZLV8iKGFRZsWRS9wTMYow44jTpfwFthIwbVhQ1g6dd2lMlV1/Uma3 2CM821wSrmwTV/ZufwjJzteJqN5EQkWYO64cKj2+vkmWOzAMjdEanKBQYHwbAU47PErM U5Sw== X-Gm-Message-State: APjAAAVVZ/tSQbga+dYPC7+K+vcmTb1XnoPI8+2v2Q+LGlb3gyGBKuVh IbiHgJn3cisooxjQjaBpVIGZ6/Ha X-Google-Smtp-Source: APXvYqw5VsDGq1IOpdBCOOOgWcIlFnXZ3yPFkgHezBV8Xxhtm57/8Unqu8gbHQMWVqDhL2JJNlVb/g== X-Received: by 2002:a5d:6984:: with SMTP id g4mr1783792wru.43.1571299306270; Thu, 17 Oct 2019 01:01:46 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id u1sm1134511wru.90.2019.10.17.01.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 01:01:40 -0700 (PDT) In-Reply-To: (Carlos Pita's message of "Wed, 16 Oct 2019 16:08:47 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169534 Archived-At: >>>>> On Wed, 16 Oct 2019 16:08:47 -0300, Carlos Pita said: Carlos> I've capitalized changelog entries in the message and also added a Carlos> reference to the bug number. Carlos> Eli told me that you prefer code comments to long commit messages but Carlos> in this case I think the rationale would be lost in fragmentary Carlos> comments here and there. It's true that there is still the reference Carlos> to this discussion in the commit message, but I believe it's Carlos> convenient to quickly get a description of the change using git blame Carlos> when browsing the code. If you disagree I will remove the notes from Carlos> the commit message and copy them here. If by 'you' you mean 'Emacs', then yes, putting stuff in the code is preferred, I think. Of course nothing stops us from doing both. Carlos> From 01e52de9ce49bc0b3490492891f066d2f9306cf4 Mon Sep 17 00:00:00 2001 Carlos> From: memeplex Carlos> Date: Tue, 15 Oct 2019 19:14:03 -0300 Carlos> Subject: [PATCH] Expose scale factor through the redisplay interface Carlos> (Bug#37770) Carlos> * src/dispextern.h (redisplay_interface): Add get_scale_factor API. Carlos> * src/xterm.c (x_get_scale_factor): Consolidate with xg_get_scale (see Carlos> bug#37752) and export through the rif. Simplify scale inferring Carlos> logic (see note 1 below). 2 spaces after '.' Carlos> Note 1: both x_get_scale_factor and w32_get_scale_factor computed Carlos> distinct scales for x and y by taking the ratio between effective Carlos> resolution in each direction and a standard 96 dpi resolution. Since Carlos> this ratio is then truncated to an integer (the floor) it seems to me Carlos> that there is no sensible possibility that these two numbers Carlos> diverge. Moreover, modern toolkits report one number as scale factor Carlos> and we need a common interface here. For those reasons I'm arbitrarily Carlos> picking the horizontal scale factor as THE scale factor. Carlos> Note 2: I decided to let get_scale_factor return a double, even tough Carlos> factors currently in use are all integers AFAIK. This is in Carlos> anticipation of fractional scaling. I believe it's prudent to keep Carlos> the interface general in this regard. I tend to lean towards putting this sort of rationale at the beginning of the commit message, and let the ChangeLog message explain the mechanics of the change. Robert