From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width Date: Thu, 19 Oct 2017 01:40:15 +0300 Message-ID: References: <834lst5bep.fsf@gnu.org> <83d15mfqoj.fsf@gnu.org> <785ae770-ea0a-ec74-c986-fde32a48ab0f@yandex.ru> <834lqxg2ef.fsf@gnu.org> <83infce7ni.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1508366512 24297 195.159.176.226 (18 Oct 2017 22:41:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Oct 2017 22:41:52 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: steve@sanityinc.com, 28248@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 19 00:41:48 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4x1x-0005HU-QK for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Oct 2017 00:41:42 +0200 Original-Received: from localhost ([::1]:46792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4x25-00041C-9s for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Oct 2017 18:41:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4x1P-0003Xe-FI for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 18:41:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4x1K-0001Oq-Ib for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 18:41:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40134) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4x1K-0001Oi-EB for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 18:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4x1K-0006V6-2S for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 18:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Oct 2017 22:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28248-submit@debbugs.gnu.org id=B28248.150836642624938 (code B ref 28248); Wed, 18 Oct 2017 22:41:02 +0000 Original-Received: (at 28248) by debbugs.gnu.org; 18 Oct 2017 22:40:26 +0000 Original-Received: from localhost ([127.0.0.1]:48815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4x0k-0006U8-2G for submit@debbugs.gnu.org; Wed, 18 Oct 2017 18:40:26 -0400 Original-Received: from mail-wm0-f49.google.com ([74.125.82.49]:54882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4x0i-0006Tq-DN for 28248@debbugs.gnu.org; Wed, 18 Oct 2017 18:40:24 -0400 Original-Received: by mail-wm0-f49.google.com with SMTP id i124so12863788wmf.3 for <28248@debbugs.gnu.org>; Wed, 18 Oct 2017 15:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8S25w/GwAtgNCOkX8HFpTCZ2XqYqiGCCT/8obCSZaxA=; b=k3kzi9I1dPoa3gFwqMRA8GWoqeGc1lu5eBp6zNy7V0JoPfzUMDZ5tE1QJDmHuLKCip qVlSMSp9danBuVrD/F2trqrWj1FClSttAxKllNZAl3AWxr66TYt3PrHHiklTsb7ewm6l e5ziP/puCNwn0WfKQr8UBpiAbuZn6pMfKYFYS5oBB4+a2TlpGFfgXO2mqn1FlsBeS0Cz 9euzXUHRlE09L6FkzlpDfuR3FHge1bdInajqR+3euOPGenGBbna0NjnVmE31G4MG3UI9 EbiOaFZefQGTCdaK8hwFsNDJi/n9iPWIXtq7BHWKshgfKfWNYoYo3gqvMc9mZidFuaDn MeOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8S25w/GwAtgNCOkX8HFpTCZ2XqYqiGCCT/8obCSZaxA=; b=mTI5iqo/B0TGXrA/fNT80b16sMZuRjgHyITD103Ki+dFDCP9NjFoQa58GDozBN9zZc TlHMcycoeFPdCILt7+X8/1c3QWr6JqQwaQNIj/06tcAtulu8CxbT8jj+CEjxCCSQpqHH OaBDvlaWNu2faGvVzL+E136+/ohZgvKFC9mVlCqj80AiIhv09WUnxw/RZYSbLKorUqzJ G6gRmq+761UcpP/W1gTYlvLsoFhX4a7w5Z0ZY0nmJlPZpdPzm0do3J3NzeM+OvR5hce/ hv+863xem+PnZElnlV794/+cUgDgpTZxp8hlCKNKpYb+Y8gQSzKjyAgMA9AaGFJXfRkI jEeQ== X-Gm-Message-State: AMCzsaX96mFFiBzkCX+0QGszeT1Rf+J3s9g3zhh1RBCOzA7zwE1JM5/M oX5O+EUUQJzWebvu6A8ut4VV8cBQ X-Google-Smtp-Source: ABhQp+TWPVgQCl4yOKAZgyi7G8owsldGccERWqk3aEzDvXpCoOTSzNr89YKJM3akseKeBI+CoTXGUA== X-Received: by 10.80.179.10 with SMTP id q10mr112056edd.166.1508366418340; Wed, 18 Oct 2017 15:40:18 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id f27sm8340705edj.82.2017.10.18.15.40.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 15:40:17 -0700 (PDT) In-Reply-To: <83infce7ni.fsf@gnu.org> Content-Language: en-US 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: 208.118.235.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:138695 Archived-At: On 10/18/17 7:35 PM, Eli Zaretskii wrote: > It's not uncommon in Emacs to have optional arguments that modify the > behavior of a function and thus affect their results. It could be > that this is the first such function whose optional argument happens > to be called PIXELWISE, but if thats the problem, we can easily change > the name, and I will probably do so. The other functions with PIXELWISE argument just have it change the return value to be pixelwise, that's all. So I'm for consistency here. With the changed name, it will be the first function to have an argument that controls pixelwise-ness, that is named something else :) > I think I will add a 3rd value of the PIXELWISE argument, which will > report the full width, but in units of the frame's canonical character > (such a result will have to be a float, though). I think this will > satisfy your needs, and the needs of other applications. Do you > agree? Sure. Although I'd rather the third value made it return the "inner" width, and nil and t meant to measure the same thing (at the cost in some backward incompatibility with the pre-release Emacs versions). But, again, I'm not saying this issue is critical. > Are we miscommunicating? The value returned by the function when its > optional argument is nil or omitted is in columns of the line-number > face, not of the frame's default face. E.g., if someone customizes > line-number to use a font that is twice as large as that used for > 'default', the result will be half of what you'd expect. So dividing > by frame-char-face is exactly the wrong thing. All right, that's a good point, thank you. I'll look into this again when I revisit the code. > The division should be done with floats, then the accuracy loss due to > off-by-one errors will not be that catastrophic. Hmm, maybe so. But then we'll have to switch to floats everywhere, for this to have a meaningful benefit. > I think it's better to keep the number of similar functions to a > minimum, otherwise it's hard top remember which does what. I see no > problem to have a single function serve 2 or 3 different purposes, > controlled by optional arguments. We do this elsewhere. Sounds GTM.