From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Window splitting issues with margins Date: Thu, 26 Nov 2015 09:23:42 +0100 Message-ID: <5656C18E.8040508@gmx.at> References: <874mgrwerb.fsf@fastmail.fm> <5644A2AC.3080703@gmx.at> <871tbux3vb.fsf@fastmail.fm> <564599A6.6060306@gmx.at> <838u62guhm.fsf@gnu.org> <87mvugs4la.fsf@fastmail.fm> <836112c554.fsf@gnu.org> <87mvudlw6g.fsf@fastmail.fm> <564A26ED.6000208@gmx.at> <564AE6ED.5080002@gmx.at> <87si4214q5.fsf@fastmail.fm> <87610rlfj8.fsf@fastmail.fm> <5654B9C9.6010503@gmx.at> <877fl5lutk.fsf@fastmail.fm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1448526271 18819 80.91.229.3 (26 Nov 2015 08:24:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Nov 2015 08:24:31 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Joost Kremers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 26 09:24:19 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a1rqZ-0001rE-K9 for ged-emacs-devel@m.gmane.org; Thu, 26 Nov 2015 09:24:07 +0100 Original-Received: from localhost ([::1]:49817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1rqb-0000bM-4q for ged-emacs-devel@m.gmane.org; Thu, 26 Nov 2015 03:24:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1rqO-0000bD-20 for emacs-devel@gnu.org; Thu, 26 Nov 2015 03:23:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1rqK-0006DG-Vi for emacs-devel@gnu.org; Thu, 26 Nov 2015 03:23:56 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:54772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1rqK-0006Cx-Lq; Thu, 26 Nov 2015 03:23:52 -0500 Original-Received: from [192.168.1.100] ([212.95.7.61]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lee2I-1afwYl2BuI-00qPda; Thu, 26 Nov 2015 09:23:49 +0100 In-Reply-To: <877fl5lutk.fsf@fastmail.fm> X-Provags-ID: V03:K0:U2DVOb7s9tYMKR07ymdZuobP1cKPNTJr2s3S/CWiCDQP/busgN5 BmzkJCHNncttP9FHaIhMN4UvWQ19YoXgK73NFxZO1rD5Roz6DWcNbEfcna0pDiGenRANCU/ WNbI7MCgSo+3qIgBD4p5xERBFdWs0vWbwLIOMpf8bm3i/mtaR+/LDdWtpFpCYCuridxH6xY 5u9FF8KQuplQM6YttFTXQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:QL3n/M+R4L8=:MtzrHH1YkE9q/A7TWpFEKM M3K9Iysi0ZrjLH6UEbsDcORXOSXdtr1OZgwhwUZ+4H07XMMt8GsWqkxZGJY3uuafgUFsb+df3 O/reKdJB1BYkb/kDW8lotejJgc+1keVAJJJM+rPAKEAC6KD+TgWeBztVLW7w5uoM++0jkgThv GkxbLX8WjWc68YZg+7/q1KMUZA0iFbEOa/AbQ8UNPSdNzlJAH2ppcGnoOVq/wrzw0Si4hHaq2 jzdL7iLUkBwkxkHaek1atfbedSsvR4mLZga6mc29+i19/Jl9w08uHMu6+JHRX0fNZ9Ib+moJh PRBdimBtfLcy05URXY8v7UQv4psa6PnfIobzir6zh3ZPFCTe8imdxQCREAFww/blnun896TPD 9Jq5WLOPA3JRzXUd5tYhsk5CVuQPxPvCI89iEjsMJxWUv2jfCpMgutkHMXZh5heuCnuLH6DVK 4VsPPstLxJFsV7boDIc9ctmWKcPGrseV0Plo/vofd7Y4S7+TLdoLJbvupvQvghj8ydyBGOWqq vqs57gzHGrjgbSjH1deZo5Og0apuBUVef3ohiYbzk4JqNVaUcbsZDZHfla5R/uPPubTyrOnzy exxvK+j9N8m5Wtouo/7In8RzmBQWyVYYpsW6ySAROeZJ9FxXo27HwVBYM01U/bpJ2VA5UkGfV bSiPiK0bx6g5ezt3NWIstWL+SV5676Xg0MJ04qonL0aVDn8cu4COdyrf7xYjIDtmjFeQcmhvt 4HU6KtMe0Cq7/DD5OkvwRr10EXgmGyzhdlOtfqKDFuEfuSyRjEXWuWwJ3jd6JTJ34O3kFvFs X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195276 Archived-At: > One question that came up while reading this is whether it is possible > for two modes to display something in the (same) margin. Can we do that? > If yes, your > proposal will probably not work right. If we have, say, nlinum-mode > requesting a left margin of 4 and some-other-mode requesting a margin of > 2, also in order to display something there, the window parameter would > be ((4 . 0) (2 . 0)). Then the actual left margin width should not be > (max 4 2) but (+ 4 2). Agreed. > writeroom-mode is different, however, because it just wants the margins > to be a certain width, regardless of what other packages display in them. > > I would probably use a window parameter that stores the requested margin > widths in an alist with the requesting modes as keys, e.g.: > > ((nlinum 4 . 0) (some-other-mode 2 . 0)) OK. I thought about doing that because then a mode doesn't have to remember the margin sizes it requested for the sole purpose to remove them eventually. > (The symbol can be freely chosen by the mode, but it should obviously be > properly prefixed.) `set-window-margins' then sets the margins to the > sum of the requested values. Or the requesting mode. We'd still have to agree first on who's to decide. > As a special case, the symbol can also be t, which indicates that the > associated widths are not additive but minimum widths. This is what > writeroom-mode would use. So if the window parameter has the value: > > ((nlinum 4 . 0) (some-other-mode 2 . 0) (t 40 . 40)) > > a call to set-window-margins would set the margins to (40 . 40), because > 4+2=6 and 6<40. But if it has the value: > > ((nlinum 4 . 0) (some-other-mode 2 . 0) (t 4 . 4)) > > `set-window-margins' would set the margins to (6 . 4), because > nlinum-mode and some-other-mode request a total width of 6, while the > minimum width is 4. I we already use mode identifiers we can easily add a fourth value to tell whether the values are additive or minimum. > This would require adding an additional argument to set-window-margins > for the symbol to be used as a key in the window-margin alist. If the > symbol is left out, set-window-margins would behave in the old way, > setting window margins to absolute values and ignoring the window-margin > alist. > > Anyway, all of this probably only makes sense if it's actually possible > for two modes to display something in the same margin without > interfering with each other. Indeed. martin