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: Mon, 13 Nov 2017 19:54:45 +0200 Message-ID: References: <0a54e927-cab1-1f1d-4996-85bb36949a33@yandex.ru> <83375imbaa.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 1510595719 31191 195.159.176.226 (13 Nov 2017 17:55:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Nov 2017 17:55:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: 29279@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 13 18:55:10 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 1eEIws-0007R0-Pu for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Nov 2017 18:55:07 +0100 Original-Received: from localhost ([::1]:55715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEIwy-0007PL-HQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Nov 2017 12:55:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEIws-0007P4-E7 for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2017 12:55:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEIwo-0005M5-82 for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2017 12:55:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eEIwo-0005M1-4C for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2017 12:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eEIwn-0003Ru-NK for bug-gnu-emacs@gnu.org; Mon, 13 Nov 2017 12:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Nov 2017 17:55:01 +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.151059569613244 (code B ref 29279); Mon, 13 Nov 2017 17:55:01 +0000 Original-Received: (at 29279) by debbugs.gnu.org; 13 Nov 2017 17:54:56 +0000 Original-Received: from localhost ([127.0.0.1]:38791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEIwh-0003RX-WF for submit@debbugs.gnu.org; Mon, 13 Nov 2017 12:54:56 -0500 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]:39988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEIwg-0003RJ-Gb for 29279@debbugs.gnu.org; Mon, 13 Nov 2017 12:54:54 -0500 Original-Received: by mail-wm0-f45.google.com with SMTP id b189so9754326wmd.5 for <29279@debbugs.gnu.org>; Mon, 13 Nov 2017 09:54:54 -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=VCtoshp7GSO3lIE3vBP4w1jA0GNXupe/Ag+ndjsYzi0=; b=jA8J/dhoIucHUnAAWq8t9FMfLL4gv42WskvQMGuRDGlQmUc3MIAG1npxgK5VMseJpa WN2X8CxToeVxHni6N3lYY9O81Lv2ZNtDcVlvtfp0UflWR3JNcGzbGRVaA+uZHA2AQhiR ac6tS074w3RhhBDVF19hFlyHJP2M8n2D+M82s174ozig54KUjXwXRN5nZ2cw5xfWP/se qRSBfzVBJjZ/SpDD5/EB5jvzSMU/IfcCGwySdgK1lO5bT/yqPkmDbQB45ODCMTmH9WCI yYcP3fiDzU+IEnJfSlCwOnNoieR0SPP5on+LXw0+1JcE5vU5hubkflzgWZJJA1lDfl2M 2gJg== 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=VCtoshp7GSO3lIE3vBP4w1jA0GNXupe/Ag+ndjsYzi0=; b=KrZx99ceI1wxgeH0VqKf0mjfRh7TbTInMgCOi64jAnco9oY5WlG3GTmFureLLtiqhW G/HMV3ZtlpSbSboS8xl9eCvbhK+8GvXfaUoe20hSx/D1rLhwjGMZ6rTXZx15ziHtb9pz REjB1O61lZY3GDGyk3z4USQOl6OOWleGbMi0ecSJ25gEOgPXBWLo3YpJe23E0Wo/4KyV 21ThLCaE0F3C1F6A7ggQ2XfeJ4HtbgGJslG9tsC22SNpLHwwq6tpDvtsJ5+fniMjkHa4 Uv8YsoykiyeYxYI/xR7TzmI4DivBQOcw1iENY3G0UKTtwbe363EXibgKz6YAYFuIpeAw AqhQ== X-Gm-Message-State: AJaThX4X96gJwnO01udTa/7xbMd9cu3tB8bisAiKS5rSzbxZaNKQHaUB TTIlxIeBPZ/PnaGUYEwvntc9WQrB X-Google-Smtp-Source: AGs4zMbUbm87ld/fdvAGJfPtAnPM17BViqV8XZ+V4ZiH5qmAKqeIO1cQFh3GQq/YbTbhaf8oYsOAqw== X-Received: by 10.80.245.181 with SMTP id u50mr11720033edm.171.1510595688303; Mon, 13 Nov 2017 09:54:48 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id m8sm14224983edl.74.2017.11.13.09.54.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 09:54:47 -0800 (PST) In-Reply-To: <83375imbaa.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:139834 Archived-At: On 11/13/17 5:46 PM, Eli Zaretskii wrote: > I tend to like better the proposal originally made by Joost Kremers in > http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01540.html. > Here it is with slight variations of my own: Overall, it seems like a friendlier API over fairly similar structures as what I suggested (just replace left-margin-columns-alist with left-margin-params). Except SYMBOL is not given a meaningful name (they are "columns" in my description). > We add 3 new functions: > > (defun window-margin-add (window side symbol cols &optional ordinal) > "Request allocation of COLS columns of WINDOW's marginal area. > WINDOW must be a live window and defaults to the selected one. > SIDE is the window side, either `left' or `right', in whose margin > the allocation is requested. > SYMBOL identifies the request, in case the allocation needs to be > changed or deleted. > ORDINAL is the optional ordinal number of the requested area, counted > from left to right. Negative ordinal numbers count from right to > left. Zero means the value of COLS is the maximum width of the > marginal area, and no separate allocation is requested. ORDINAL meaning the same as "order priority"? And the lower the value is, the more "left" the column should be positioned? Sounds OK to me. I'm not sure I understand the "Zero means ..." passage, though. In addition to signifying a neutral position, does it supposed to switch the meaning of this function into something that set-right-margin/set-left-margin can call, for backward compatibility? Seems like a wart, using ORDINAL this way. And what's going to happen when somebody else calls window-margin-add with non-zero ORDINAL? Will the end result depend on which call happens first? > Value is the actual positive ordinal number of the allocated area." Return value? > If the stuff (text, image, etc.) to be displayed in a specified > portion of the marginal area is too wide and doesn't fit the width of > the portion, it will be truncated; if it is narrower, it will be > padded. Padded from the left or from the right? :) > This keeps the display engine design intact, and I think will allow > relatively straightforward implementation (although some non-trivial > changes in management of the glyph matrices will be necessary). It > can also be implemented in a way that keeps backward compatibility > with the current APIs. > > WDYT? Aside from the ORDINAL edge case, it sounds good to me. Here's an interesting question: after such an API is added, will it be feasible to re-implement display-line-numbers-mode using a margin column, instead of the special separate area? And if not, how can we make this API better that you could?