From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Better handling of window margins Date: Fri, 04 Dec 2015 08:22:26 -0500 Message-ID: References: <87mvttsvsj.fsf@fastmail.fm> <83k2oxj7d6.fsf@gnu.org> <565F2DD3.9020400@gmx.at> <838u5cka88.fsf@gnu.org> <565F3441.1020707@gmx.at> <83610gjabz.fsf@gnu.org> <566086FA.6010603@gmx.at> <83h9jzi99p.fsf@gnu.org> <83d1umiq9u.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1449235387 2512 80.91.229.3 (4 Dec 2015 13:23:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2015 13:23:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 04 14:22:56 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 1a4qK6-0006cu-KN for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2015 14:22:54 +0100 Original-Received: from localhost ([::1]:40792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4qK6-0006qY-3i for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2015 08:22:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4qJl-0006mL-3W for emacs-devel@gnu.org; Fri, 04 Dec 2015 08:22:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4qJk-0005c6-Fl for emacs-devel@gnu.org; Fri, 04 Dec 2015 08:22:33 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:4475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4qJg-0005b6-3S; Fri, 04 Dec 2015 08:22:28 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AxFgA731xV/yr292hcgxCEAoVVu0CHSwQCAoE8OxIBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQWMMI09mxcjhBYggngBAQE X-IPAS-Result: A0AxFgA731xV/yr292hcgxCEAoVVu0CHSwQCAoE8OxIBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQWMMI09mxcjhBYggngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="184469642" Original-Received: from 104-247-246-42.cpe.teksavvy.com (HELO pastel.home) ([104.247.246.42]) by ironport2-out.teksavvy.com with ESMTP; 04 Dec 2015 08:22:26 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 5344761422; Fri, 4 Dec 2015 08:22:26 -0500 (EST) In-Reply-To: <83d1umiq9u.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Dec 2015 10:14:53 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:195887 Archived-At: >> WRT to sizing the margin, I think if we want to "do it right" it'd make >> sense to provide an Elisp-layer that defines two functions which could >> look like: >> (window-margin-register OWNER SIZING-DESCRIPTOR) >> and >> (window-margin-unregister OWNER) >> so those two functions can appropriately combine the SIZING-DESCRIPTORS >> still active. > Not sure why window-margin-register and window-margin-unregister > couldn't be set-window-margins with additional arguments. Because we want this to be flexible, so it's better written in Elisp, so it's an extra layer, so it's another function. set-window-margins then becomes an internal function that we'd encourage people to stop using. >> Not sure what SIZING-DESCRIPTOR should look like (it could be >> a function which takes a size and returns a new size). > I don't think such a function can be implemented by any particular > mode, because a mode only knows well what it needs from the margins, > it has no better idea about other modes' needs than the rest of Emacs. That's the point of having SIZING-DESCRIPTOR be a function: it receives a description of the margin chosen by "all other users" and adjusts it according to its own needs. > functions for it. To say nothing of the fact that having more than > one function again raises a problem of in what order to apply them, > and what would be the results of applying conflicting functions in any > order. We'd push this responsibility on the package authors. If SIZING-DESCRIPTOR just returns the sum (or the max) of the provided size and its own use, ordering doesn't matter, for example. And for the remaining cases we could rely on add-function's `depth' to impose a particular ordering. Stefan