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: Wed, 18 Oct 2017 03:33:52 +0300 Message-ID: References: <834lst5bep.fsf@gnu.org> <83d15mfqoj.fsf@gnu.org> <785ae770-ea0a-ec74-c986-fde32a48ab0f@yandex.ru> <834lqxg2ef.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 1508286921 8251 195.159.176.226 (18 Oct 2017 00:35:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Oct 2017 00:35:21 +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 Wed Oct 18 02:35:16 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 1e4cKC-0000Qp-8X for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Oct 2017 02:35:08 +0200 Original-Received: from localhost ([::1]:41998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4cKG-0005OF-N7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 20:35:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4cKA-0005O9-Nr for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 20:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4cK7-0003wB-I7 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 20:35:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38091) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4cK7-0003vu-Dv for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 20:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4cK6-0007LH-BB for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 20:35: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 00:35: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.150828684728156 (code B ref 28248); Wed, 18 Oct 2017 00:35:02 +0000 Original-Received: (at 28248) by debbugs.gnu.org; 18 Oct 2017 00:34:07 +0000 Original-Received: from localhost ([127.0.0.1]:46771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4cJD-0007K3-20 for submit@debbugs.gnu.org; Tue, 17 Oct 2017 20:34:07 -0400 Original-Received: from mail-wr0-f170.google.com ([209.85.128.170]:48253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4cJ8-0007JV-So for 28248@debbugs.gnu.org; Tue, 17 Oct 2017 20:34:03 -0400 Original-Received: by mail-wr0-f170.google.com with SMTP id u5so3373038wrc.5 for <28248@debbugs.gnu.org>; Tue, 17 Oct 2017 17:34:02 -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=pefQd5UiVee+U0taQQkzX/YvO8d7qvHsOjbwE9G7l7A=; b=LnwqEy0OW3qKHHXq++z0sxvAsOibxfU9caIQcDQRg4OYw7cwOIxk1Q2Qmd6bSb73FD xl+HZFEeJgb09rzLWmAxXr++dfuxJzi/ESBY3VPgn1qrEkGVz3J/QusYMkT4g1HJyPuX 4gPC3oGfwxsx7Vlt3m2lBk+vokq/fUiByJPQQbZC8irSAClsRT12v6SE9nzXu0FOVFSO vxOeqSXPP+XKSV49psTlpe4FaNIvfSQIPZuEzl9zrzHD/ghNqA7L7nlfGeH5P8VZeUeh qxueQIH2D8dMLur0wPnsEh36lqL/MtZf/CGh3CGudvs58gfeBrLRk25L91WPZZ5RgHcp ocjA== 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=pefQd5UiVee+U0taQQkzX/YvO8d7qvHsOjbwE9G7l7A=; b=Naao51R361OJ8Z/CPMMfTwaFpcGq7vsMfzDYHuRrfjJOaTZwGUhcsIOsznZKL7/pTH GChtNk8v75E/PKmblT4xbUl3OTXHJJG2O9/yx6THpbKSvmYHUuEL/Nb68bk1MIk50QNq +ZGqHzZaWla6Ip7QSinx3nVgqvLfJeEKkjNBu4jNG81Alp+imMWxWIDa+3xO9o0rFz2W K6bYhkQ8U2Pw2xmRjQxxf01+y37WkIcJYid8JlWYi7lAMkJNqiXvbxu583igfPin6V7A c/y3NIzdhg55SU9/a9lmbCZh6+YLBLjXKNyNR9dygf2PRSzG4NzBL8wqLScA54+xX1Sd 407w== X-Gm-Message-State: AMCzsaXOqnspRZUqewR9CuU0IK9j9DldyL1OhgYgMXitC91MvXYgT24I LybmMYCpu05pQFambWd5vcbWr6ZI X-Google-Smtp-Source: ABhQp+TZiBY6vWY7CrSnJDKx+7O0C7+5LHMzQx7CZiRTPP0UDnFEO6B6Ijv4+06jTkxNffaw4YsyJQ== X-Received: by 10.223.167.76 with SMTP id e12mr4672697wrd.259.1508286836850; Tue, 17 Oct 2017 17:33:56 -0700 (PDT) Original-Received: from [192.168.42.182] (46-38-248.wireless.cytamobile.com.cy. [46.199.38.248]) by smtp.googlemail.com with ESMTPSA id o138sm12281339wmg.36.2017.10.17.17.33.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2017 17:33:55 -0700 (PDT) In-Reply-To: <834lqxg2ef.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:138650 Archived-At: On 10/17/17 7:33 PM, Eli Zaretskii wrote: > They are used for 2 different purposes, which are contradictory to > some degree. But that's true for all core functions with a PIXELWISE argument, isn't it? Yet, the rest measure the same thing in both cases, AFAIK. > The value in column units is primarily meant to be used > for setting display-line-numbers-width (see, e.g., how > display-line-numbers.el uses that), and also for users, so burdening > them with anything that is not directly related to the value of the > largest visible line number would be a nuisance. Maybe display-line-numbers-width could include the separator columns as well. > OTOH, the > column-unit value is of limited utility for layout calculations, > because the columns are of the line-number face, which could be > smaller or larger than the default face. That changes little for me: overlay-based layout can't do anything with pixels anyway. If all I can do is divine the resulting value by frame-char-width and hope for the best, I might as well use the return value in columns to begin with. Furthermore, in Company, we already call similar functions (like window-body-height) with PIXELWISE nil. > Therefore, layout > calculations should use the function's pixelwise variety, and convert > into columns by dividing by the width of the font used for buffer > text. (Which btw means my response to you earlier -- see above -- was > incomplete: you should use the function in pixel-unit mode, if you > need to account for the screen space eaten by line numbers, and then > you don't have to add anything to the value it returns.) I can't help but worry about how an off-by-one error in pixel width (which is not strictly defined) would result in an off-by-one error in column width after division. And again, I'm in no position to use the pixelwise value. >> On the other hand, the return value of the function can differ from what >> a variable is set to. > > I think that'd be a nuisance; again, see what display-line-numbers.el > does. > > I agree that this is not ideal, to say the least, but I hope you at > least understand the issues now. If there's a better solution, I'm > all ears. display-line-numbers-update-width might look worse, I agree. But we could have two functions, right? Both line-number-display-width and display-line-numbers-update-width could delegate to line-number-display-inner-width. Just a suggestion. >> the function's docstring needs updating. > > Done. Thank you. > P.S. I'd still like to hear your opinions on the related questions I > asked here: > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28855#8 Sorry, I haven't noticed your question, and I don't know what :align-to is about. And to be frank, I don't understand that question now. I'll try to re-read and respond.