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#29279: Sharing the margins Date: Wed, 15 Nov 2017 23:49:05 +0200 Message-ID: <9bbfd79b-9e80-db5a-fe57-d0d629477d5d@yandex.ru> 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> 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 1510782763 27907 195.159.176.226 (15 Nov 2017 21:52:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Nov 2017 21:52:43 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: 29279@debbugs.gnu.org, joostkremers@fastmail.fm To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 15 22:52:39 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 1eF5br-0006uo-1P for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Nov 2017 22:52:39 +0100 Original-Received: from localhost ([::1]:37988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eF5bw-0007sM-Tl for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Nov 2017 16:52:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eF5ZO-00062d-E2 for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2017 16:50:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eF5ZL-0004SX-3R for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2017 16:50:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33542) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eF5ZK-0004SC-Vu for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2017 16:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eF5ZK-0004Yq-Hh for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2017 16:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Nov 2017 21:50: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.151078255517461 (code B ref 29279); Wed, 15 Nov 2017 21:50:02 +0000 Original-Received: (at 29279) by debbugs.gnu.org; 15 Nov 2017 21:49:15 +0000 Original-Received: from localhost ([127.0.0.1]:42223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF5YZ-0004XZ-GH for submit@debbugs.gnu.org; Wed, 15 Nov 2017 16:49:15 -0500 Original-Received: from mail-wm0-f51.google.com ([74.125.82.51]:43490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF5YY-0004XN-1B for 29279@debbugs.gnu.org; Wed, 15 Nov 2017 16:49:14 -0500 Original-Received: by mail-wm0-f51.google.com with SMTP id g141so5806154wmg.2 for <29279@debbugs.gnu.org>; Wed, 15 Nov 2017 13:49:13 -0800 (PST) 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=a/TL/X7lp7HMMu4CT5icnDanpTz8RIeVQAtcu2qS5xc=; b=LOZPKdg+vZ3JaRRXbyTx9+CUCbuF3rdKgxC68DjQSZLCS+A9xzycBaN02fMaxUXawR aY5ZY/Cn2OnAIGLg3URuaa++rhndYwwhlGL2VGelQt2rMqrL20qOQHBArmRvZYXvmHli /C5IivWAZ5R2gybEmRt5gN9n7p2qN0CDGeBnaD8ATL82PEFl25Qge75TV+B6IugBKtK9 IpCObBqKNEPQd1bfh4nBDbKn+szFCTcwptJHFi3u8Xx5mgfP6PMgLEptmO5uBpj+ey4f PNOAXjwOwbkrbVhA9hVbRE1J5XlWt4q2CEG5Bm1I9W1BYrm4walcmOraEfMcrrBF1Mv/ sRfw== 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=a/TL/X7lp7HMMu4CT5icnDanpTz8RIeVQAtcu2qS5xc=; b=ick6dBvcXg0VaYAU4NQTEqq8H8My95jygbi5SZOVDfmk/2O7a3ybYCWvKktvAHU5ku y2zTOB+BFgXUCdTPaxL4HlnAZaomVsCG6ueVH6zDa6xmRbcjZZAqOIljdQmenRbB2qsn Z+3em1I7vTuIKWh10FudQDMs206Z82U84Dek5c/E3yn6AU31JPWEexdgnaMulz4clyP2 9NJPpIynXQzi+4DBDBhu0rWvaCDeTXg+O0qBH9kUAOFBbhiQzFpO2RLGWdU0a4ydrVFN p1QCHTjYkbx0anwpHu10dSfE1/WHVfiPtjL58hsxht5GbcGvv0Zb9MqipbuLRfYaIAOI 0cBQ== X-Gm-Message-State: AJaThX4zv3AWMFgUlxbOGuwN2jEDuH+cBJ2bX7eiJBZPTtxj44D7Xii5 g/fEwt8HIHnS0IdhZmdglNk= X-Google-Smtp-Source: AGs4zMZWA5w4ic3vKRn7Rp8Qox04nrWhxxHDR53tXY4E7MaDs1mIXSrePNjtLb2+v7ST4VJ5C65I5Q== X-Received: by 10.80.213.90 with SMTP id f26mr4077661edj.225.1510782548196; Wed, 15 Nov 2017 13:49:08 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id x49sm12375793edb.76.2017.11.15.13.49.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 13:49:07 -0800 (PST) In-Reply-To: <83a7znjuc5.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:139944 Archived-At: On 11/15/17 8:00 PM, Eli Zaretskii wrote: >>> Yes, but "being the rightmost" might mean "being right next to the >>> text", for whatever purposes. >> >> So far, I doubt it's going to come up as a real, hard requirement. But >> we'll probably see. > > I could think of something similar to overlay-arrow, only using the > margin. Such a feature will want the arrow to be as close to buffer > text as possible. Yeah, OK. >> 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. Having extra padding between columns (your original idea) would be more complex to implement, IIUC. >>> Again, as long as the text-area dimensions didn't change, it could be >>> argued that the hook shouldn't run. >> >> That's some creative nomenclature lawyering. :-) > > It isn't. It's just how the implementation works. Still. To the user, the line numbers column is more like an extra margin than anything else. 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? >> OK then, what's the practical problem with saying that margins are also >> part of "text-area dimensions"? > > It's hard to implement. window-configuration-change-hook currently > runs from functions that change window dimensions or the buffer > displayed in it; those never run inside redisplay. What you (and some > others) propose will have to run in the middle of redisplaying a > window, and who knows what running arbitrary Lisp at that point will > or could do? Not necessarily. Can't you save the necessary data to a variable, finish redisplay, and then run the hook (if the data says so)? > In addition, it will require us to record somewhere (probably, in the > window object) the last used width for number display, so we could > compare that with the new one. This is not as simple as it sounds, > because most redisplay cycles avoid redrawing the entire window, so > determining just where in the code to perform this comparison is a > non-trivial decision. *resigned shrug* > So I'd like to avoid this if possible. It's somewhat hypothetical, but I'd like to refer to (*) above. That is, somebody will probably ask for that anyway, sooner or later.