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: Fri, 13 Nov 2015 09:04:25 +0100 Message-ID: <56459989.4070408@gmx.at> References: <874mgrwerb.fsf@fastmail.fm> <5644A2AC.3080703@gmx.at> <83twori3n3.fsf@gnu.org> <8737wax5i9.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 1447401919 21338 80.91.229.3 (13 Nov 2015 08:05:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Nov 2015 08:05:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Joost Kremers , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 13 09:05:09 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 1Zx9M4-000111-Qx for ged-emacs-devel@m.gmane.org; Fri, 13 Nov 2015 09:05:08 +0100 Original-Received: from localhost ([::1]:51517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx9M4-0008Tg-Dm for ged-emacs-devel@m.gmane.org; Fri, 13 Nov 2015 03:05:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx9Lg-0008TQ-4e for emacs-devel@gnu.org; Fri, 13 Nov 2015 03:04:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zx9Lf-0000eD-8x for emacs-devel@gnu.org; Fri, 13 Nov 2015 03:04:44 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:59218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx9LZ-0000b5-DM; Fri, 13 Nov 2015 03:04:37 -0500 Original-Received: from [192.168.1.100] ([213.162.68.46]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M9s2y-1a8AuY0BOi-00B2ot; Fri, 13 Nov 2015 09:04:34 +0100 In-Reply-To: <8737wax5i9.fsf@fastmail.fm> X-Provags-ID: V03:K0:i4lMIXVve+zPpuB5Qa2Y4YWY4T38eKcZor6fMGxZ6lWlhntfs3K IIrMHxyv0Iqyla5i01mYvs5cvsC+zgPuArtb3SUGpDDfOrifzPis1t89gVnmdoDXyEpVBSW PbU3n4TNQSeKvAbieBfjpGCccLnAe+0ANN7kr8aCQO9pK4nqvvDNN78YJYYC3wrcfBjyoK2 QtTBSxI8176eNgOayxpaQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:JIgiEJbdLww=:l9wwPZ12qiMw2q2Bl6lfoS EwoZqucLf4jdUE+/zh9ddP6Jl4nPcxBQ9lZbxIH+N5y/5Zl3PO9MQTiFdnzkHOD7EritXPn2H mbJApAGs+i1sqeMDtWsZuI3OQtcLKY7UFWX/qF2QU9YgNXEKIFBiaf+YLJPuI6ras8Xhs7O6Z rneuuOq6jc1JY6j+0f3djUzXR7scofwuGsLst6RIoXQHTsU635PFchXCKnKTpR6bejcxG5r7D Ik0CTdXfxzpDx887lM9tnCpz2UjdmJKRlwHhK+1hJeO0yWnor9CA4349UevpXBZvn4V9nmShd Eq1JxVJdXwDskFYBI36YCOV/6agFOHjqE/uHuwYLHxOihpJ4dqMYNWBjgy+FpdXHkSPWHK56Z vCb8w6UgMz59S+l7PHL5Zp6covGCXlXd86emKpzActmwi+mqD/udngARO9e9z0KIiU8xoJ3F2 UKtFFxduKgKuNXkYazJSAw7IroNanxRq41shnSNQrpzdwqGvUy/z92EM2RZy/2OT8jW/2EbBX RaF2h7ygx7fJV6/Px/vdNvTfPfFJmc4eZaPubi9Nemhvz2lXfRzrEq64EjBPYtTwz479Mk9W+ wDJgMZF8Cr2xNefrQM7rYr/kUBFyZzNAsyT7IXUQYZU/Qn/KqA5iu6HoCg7jhbgYN3gmaDsku PbHdyHRraX3FGhLZ+8f0J6N6ibrs9KjIImcYaw0fw9DBTrYtgAO5/SU8OkmRnUvloOfZLjUHN 5U6iuunMRB3nXFPS+J4HKNi0KAAGRAjJBaI+f3na6pKXrL+nGei8I35UCVSG95lxS8cvI0Bz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 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:194325 Archived-At: > linum-mode seems to assume that no-one else is using the margins =2E.. the left margin only, to be precise ... > and > simply sets the left margin to the width it needs for itself. It'd be > great if linum-mode (or any other mode of course) would be able to > specify that it needs the left margin to be at least n characters wide= > and if there were an easy way for other packages to respect this. The number of characters used by =E2=80=98linum-mode=E2=80=99 can vary dy= namically according to the size of the buffer. If =E2=80=98linum-mode=E2=80=99 is = non-nil in a buffer, the left margin width of any window showing that buffer specifies the number of characters needed by =E2=80=98linum-mode=E2=80=99= =2E > If it would also be possible to specify a margin width without locking= > it, then this could help with the issue I posted about. If it's known > that parts of the margins are reserved, while others are not, the > window-splitting functions know what part of the margins they can safe= ly > assume will be adjusted. > > Perhaps an example to make things clearer: assume a window width of 20= 0 > characters. I want my text to be 80 chars wide and centered, so the le= ft > and right margins need to be (200-80)/2 =3D 60 each. Package X sets th= e > margins to 60, but doesn't lock them. linum-mode says it needs a left > margin of at least 4, so a width of 4 chars is locked. Now, the window= > is split and window-splittable-p must determine if the window can be > split horizontally. Currently, it will base its judgement on the width= > of the text area, which is 80, the result being `nil' for 'no, the > window cannot be split horizontally'. If a mode could "lock" part of t= he > margin, it would know that it can assume a width of 200-4 =3D 196 and > return `t' for 'yes, the window can be split horizontally'. The window= > is split and package X (through `window-configuration-change-hook') > adjusts the margins. I doubt it's easily possible for a package X to share the left margin with =E2=80=98linum-mode=E2=80=99. The latter has (set-window-margins win width (cdr (window-margins win))) so it simply doesn't care about other packages using the left margin. martin