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: Tue, 24 Nov 2015 20:26:01 +0100 Message-ID: <5654B9C9.6010503@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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1448393207 2401 80.91.229.3 (24 Nov 2015 19:26:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Nov 2015 19:26:47 +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 Tue Nov 24 20:26:36 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 1a1JEZ-0007jy-3Z for ged-emacs-devel@m.gmane.org; Tue, 24 Nov 2015 20:26:35 +0100 Original-Received: from localhost ([::1]:40986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1JEa-0002jG-6J for ged-emacs-devel@m.gmane.org; Tue, 24 Nov 2015 14:26:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1JEF-0002bY-S8 for emacs-devel@gnu.org; Tue, 24 Nov 2015 14:26:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1JEE-00039N-QZ for emacs-devel@gnu.org; Tue, 24 Nov 2015 14:26:15 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:65376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1JEA-00038X-Hn; Tue, 24 Nov 2015 14:26:10 -0500 Original-Received: from [192.168.1.100] ([213.162.68.41]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MWhRH-1Zr90f23Mh-00XwnC; Tue, 24 Nov 2015 20:26:06 +0100 In-Reply-To: <87610rlfj8.fsf@fastmail.fm> X-Provags-ID: V03:K0:fYYxE0v3427K8JphLKjHfGuUP+dSHsaRig5ABDhNqQSOTpCPatt SQqhU+wvX7Rtm3QQOIMtt15J1v2//tcHpYL0WjayV4GXuSFMgpN+DOgl2HBJ+gbfJjuTFK/ ob2R4EWQcg0su5ZQ0obsNxNLtxEmTnH2LP/QQTHVoYdbOKYTVWI02gYc00QdpyV9SYPE2IE vfvsv1qc96Oua0Lfzy1Lg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ItEPZqFuoDQ=:7ksiP+O9ZukqQfHuY4dGep ZfhT6I211SaRpvGIcyWCCFjpTklk2JGhmb9UTPK3+cbfie/7Cmf5EU9dcqxA7XaJV2T/TBWhB ZYXnrVfcmXW7xK9pimtdMae8DRaeyNoAvkNH9bF5s9KPP4+WWOx1rfE19ramzuSLGaY2jc0ZV IokzAWRbto1VW82ozR0lOIQChpFLqQiV7Y21ZREApn/IMDtjXnLJdFWi58t27KWZLI/2MSBXL +yihOeiRHngP9Rqj6hhm+wr+New3WEQ+fj5Hau0G+VRdljc4RhsosTmu9NMRxoFWplFPbfnmo yFie7BnswT0QMjMZKlZrGwRyC/4PGkj0HZhF3XpQil3EtllqQFrXyftcU5fw3E1UoUUVdCJXm xeRew875tPGzENpPLdORm4Jq/lHZudEas9Z6GYKPfYyMPpAWvxir2B9YtobOq4hlmiV0mCMro mHfFmI2MwKyLGYq+bQIwBkmkykt3hqWbIrPVFrnVouTl3fqpGEb+gO8Yxk0iGcU8Eau2DVpfj hs0Tdx/3/etkT5lpfuhj3WFtxbOkRU6W2ZwvNuUMKpobM4RHfYARfdBX97Wm0qaSD45mKMuXC OO0S4XJKVmRVy4NWXXwcUS97dPVL1YXzK/uO3xnf9PcYxZAufC6TefsHvFj/4Xz9OrIATfVtw LseQryiReDoJWh87hnwGVCPyVJvk8icQjKOal8LbpPgp3uhxkum+ehZ91ZXdC4bVIC5O+Ev2C fIxZsITm0IPIPPi4ykRJloYnJ3X1c1sTcjCMYxb8y2vL6O1MuHn1Y/Gjosax6Q1II20EQllz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.21 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:195179 Archived-At: > Well, I tried implementing this policy in `visual-fill-column-mode', b= ut > it didn't work, because it's not clear at all where margins come from.= > E.g., suppose `nlinum-mode' and `visual-fill-column-mode' are both > active in a buffer. Now, `nlinum-mode' only sets the left margin, so > when `visual-fill-column-mode' needs to reset the margins, the existin= g > width of the right margin has been set by `visual-fill-column-mode' > during the previous margin update. The problem is that > `visual-fill-column-mode' has no way of knowing this and therefore > assumes it cannot reduce the right margin, even though it can. > > So, summarising, the situation as it is doesn't really provide a way t= o > allow multiple packages to use the margins safely. Making that possibl= e > would require some big changes to the way margins are handled. I think we agree that =E2=80=98nlinum-mode=E2=80=99 and =E2=80=98visual-f= ill-column-mode=E2=80=99 have to file their requests via =E2=80=98set-window-margins=E2=80=99 and the l= atter uses the maximum value requested. All this is simple until the moment when the mode that requested the current maximum size gets turned off. In any case I would maintain a window parameter as a list of requested margin widths like ((4 . 0) (40 . 40)). Basically there are then two ways to handle this: Let =E2=80=98set-window-margins=E2=80=99 decide or l= et the modes agree among themselves. For the former, when a mode gets turned off it calls, for example, (set-window-margins nil -40 -40) and =E2=80=98set-window-margins=E2=80=99= decides that there is one contender less for a left margin width of 40 and a right margin width of 40 and it may have to set new widths. -0 might require special care. Having the modes agree among themselves means that a mode that wants to change the margins has to consult that parameter, add its own value to it and only if its own value is larger than the current value, use it in a call to =E2=80=98set-window-margins=E2=80=99. When a mode is turned of= f, it has to remove its value from the window parameter, and possibly call =E2=80=98set-window-margins=E2=80=99 with the new largest value. WDYT? martin