From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#29279: Sharing the margins Date: Thu, 16 Nov 2017 17:50:31 +0200 Message-ID: <83shdei5o8.fsf@gnu.org> References: <0a54e927-cab1-1f1d-4996-85bb36949a33@yandex.ru> <83375imbaa.fsf@gnu.org> <83o9o6kp61.fsf@gnu.org> <83h8tykm99.fsf@gnu.org> <83375glvx4.fsf@gnu.org> <0547e92c-a574-0fe4-6122-1d11b24ee3c5@yandex.ru> <83efp0jjhi.fsf@gnu.org> <77ddb7fc-d57f-05fa-026c-e23e3bcd3432@yandex.ru> <83a7znjuc5.fsf@gnu.org> <9bbfd79b-9e80-db5a-fe57-d0d629477d5d@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1510847486 8479 195.159.176.226 (16 Nov 2017 15:51:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Nov 2017 15:51:26 +0000 (UTC) Cc: 29279@debbugs.gnu.org, joostkremers@fastmail.fm To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 16 16:51: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 1eFMRX-0001AB-8h for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Nov 2017 16:51:07 +0100 Original-Received: from localhost ([::1]:41482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFMRe-0006Ys-JA for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Nov 2017 10:51:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFMRY-0006Yb-J2 for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2017 10:51:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFMRU-0001yE-3g for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2017 10:51:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFMRT-0001xa-Vu for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2017 10:51:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFMRS-0002hg-Dg for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2017 10:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Nov 2017 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29279 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29279-submit@debbugs.gnu.org id=B29279.151084743210351 (code B ref 29279); Thu, 16 Nov 2017 15:51:02 +0000 Original-Received: (at 29279) by debbugs.gnu.org; 16 Nov 2017 15:50:32 +0000 Original-Received: from localhost ([127.0.0.1]:43738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFMQy-0002gs-2q for submit@debbugs.gnu.org; Thu, 16 Nov 2017 10:50:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFMQw-0002gf-7k for 29279@debbugs.gnu.org; Thu, 16 Nov 2017 10:50:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFMQp-0001SD-Q1 for 29279@debbugs.gnu.org; Thu, 16 Nov 2017 10:50:24 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFMQj-0001NE-DB; Thu, 16 Nov 2017 10:50:17 -0500 Original-Received: from [176.228.60.248] (port=1956 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eFMQi-000497-R2; Thu, 16 Nov 2017 10:50:17 -0500 In-reply-to: <9bbfd79b-9e80-db5a-fe57-d0d629477d5d@yandex.ru> (message from Dmitry Gutov on Wed, 15 Nov 2017 23:49:05 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:139959 Archived-At: > Cc: 29279@debbugs.gnu.org, joostkremers@fastmail.fm > From: Dmitry Gutov > Date: Wed, 15 Nov 2017 23:49:05 +0200 > > >> If not, let's put all padding on the outside and be done with that concern. > > > > This is doable, but the implementation will be more complex. > > Remember: the display engine lays out stuff left to right. So padding > > what's left after we are done with all of the "columns" is easy; > > padding _before_ requires that you either compute all the widths in > > advance, or that you come back after laying out the columns and insert > > the stretch before it, moving all the glyphs to the right. > > Sounds straightforward to me. Since we know the sizes of all the columns > in advance, we can just substract them from the target total width, and > pad with the resulting number of spaces. Maybe, but IME things are rarely so easy. > Further, even though we have a separate accessor for its width > (line-number-display-width), if a package depends on it and needs to > draw something based on its value, it should want to be notified when > there is a change (*). window-configuration-change-hook seems natural. > Unless we have a separate hook for that? The way this feature is designed and implemented, it doesn't lend itself easily to hooks, primarily because it works in the inner-most level of redisplay. > Can't you save the necessary data to a variable, finish redisplay, > and then run the hook (if the data says so)? That would be pointless, because there are already hooks which work before redisplay or after it finishes. All such a hook needs to do is compare the value returned by line-number-display-width with the last value it saw. That's what I did in tabulated-list-mode, which has some unique requirements in this area. Avoiding the comparison doesn't justify a new hook. And anyway, what do you envision that a hook function will want to do? Most probably, it will want to change the window dimensions, or affect what's on display in some other way, which means an immediate second redisplay cycle. So we gain nothing by making the display engine call the hook. > It's somewhat hypothetical, but I'd like to refer to (*) above. That is, > somebody will probably ask for that anyway, sooner or later. Somebody already did, and I declined for now, because I think the same effect can be achieved via existing hooks.