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 01:51:53 +0200 Message-ID: <0a54e927-cab1-1f1d-4996-85bb36949a33@yandex.ru> 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 1510530793 29519 195.159.176.226 (12 Nov 2017 23:53:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Nov 2017 23:53:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 To: 29279@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 13 00:53:05 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 1eE23l-0007Cr-A0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Nov 2017 00:53:05 +0100 Original-Received: from localhost ([::1]:51639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eE23s-0007Lm-Oq for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Nov 2017 18:53:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eE23l-0007Lh-Ov for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:53:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eE23i-0004HL-Me for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:53:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eE23i-0004HH-IS for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eE23i-000414-B0 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Nov 2017 23:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29279 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151053073215373 (code B ref -1); Sun, 12 Nov 2017 23:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2017 23:52:12 +0000 Original-Received: from localhost ([127.0.0.1]:37359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eE22u-0003zt-HL for submit@debbugs.gnu.org; Sun, 12 Nov 2017 18:52:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eE22r-0003zf-QV for submit@debbugs.gnu.org; Sun, 12 Nov 2017 18:52:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eE22l-0003xG-MF for submit@debbugs.gnu.org; Sun, 12 Nov 2017 18:52:04 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42462) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eE22l-0003x9-JI for submit@debbugs.gnu.org; Sun, 12 Nov 2017 18:52:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eE22j-0006Yh-7j for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:52:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eE22g-0003uS-52 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:52:01 -0500 Original-Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]:50301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eE22f-0003sO-U5 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2017 18:51:58 -0500 Original-Received: by mail-wr0-x22e.google.com with SMTP id p96so12932926wrb.7 for ; Sun, 12 Nov 2017 15:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=RlmxkejVfa2XfNPfKuWEX37X6lNpjCO4DTKete6X7eQ=; b=nVGRoom8uWFNcxy/nGiqPA+tt2D7QxfDwKicRcM0QU1iUWsz5qFW5+A3D47SgzznYR PpxYuCllShqbocvouyF7tCR/lOvJpOscECxTEbtD5PHXhVTxOJR0fDNwX724RZXWKVE4 nldf9MKXeE6Wl1b6jf6MSwV6zYdbmsw02J086RBQ0UwOc5a2xhEqbKITR0AMNUQlF43U ksGkmtmdiqds5+Y+kPKf4nz8HKcY28zi4QXegOUTzdkaYfTLvdbkbapw4efEVr5IJOsd d+JzF1wHCnzAJLEoJNCte+h0zC46dzvFana60DMmUhImNY0RQO3YHpfXTpsCAYha26q/ sKsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=RlmxkejVfa2XfNPfKuWEX37X6lNpjCO4DTKete6X7eQ=; b=Zozsa//3hyFEwby8R9u5Qq5ngjxKdbqhFBP0CvOE+bd7ZxT3+g3ayiPdjt6KJFYPMg 0gJdB9/Cjt/5Nj6fhxWOV1Ga4STujGENAYdfYXsULUB84UlNCclOQJebJ/ZIiOW8xwUx se627cp6CaChCg6PZkt2sC9W8bN3BjAu4W+mYyiKdvltROUTcyr4kBl5kCs03FxkxgZL L82tMu28VcbeAtZp49V8dao8UcvhN7Z6qGYQKMfzwisorj2hTLHqr2r6KRftTRYb8CH4 +Dc9yzC0K5ed8hE+CPmrdgRdLKE1FEA7ftP/+uevjH5k49qCZxZ8/3F+A6H7reeOivOq k3Tw== X-Gm-Message-State: AJaThX74ZiU9HeH3ruGwMFkmwlC3uV8mcvva9jNHo5v5Xj/CSVBNSupf lIUGoAyk5vGtdlamsnq4BCG2xJEq X-Google-Smtp-Source: AGs4zMbedjBfdhLVLbdipmI4QCBA1RxtSliUG7gUUWP3wcSEzxg7eo5dVUxrTsYAAhgJ4szrCI2PVA== X-Received: by 10.223.183.13 with SMTP id l13mr6197863wre.1.1510530716067; Sun, 12 Nov 2017 15:51:56 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id p79sm15278572wmf.43.2017.11.12.15.51.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Nov 2017 15:51:55 -0800 (PST) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:139817 Archived-At: This is a rough proposal on how separate bodies of code (minor modes, etc) can use the same margin without conflict. Previous discussions: http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01171.html https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27427#53 Primary goals: - Allow multiple kinds of margin content to coexist (examples: http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01505.html). - Continue to use the text properties to set the contents of the margins (as opposed to having a line number based API, which seems to come with its own difficulties). Outline: We introduce two new variables, named like left-margin-columns-alist. Each element is a cons which specifies some properties of the element, for instance: - Priority (so the columns are in the same order on each line) - Minimum width (if we want that, as opposed to just adding strings with that length the contents of this margin column) - Minimum "total" width, which would allow to use this column as padding so that the combined width of the margin reaches a given number (hopefully solving the writeroom-mode problem). - Padding (whether to pad this column with a space on one side if there is a next column) - Text alignment within the column (left or right) The keys in left-margin-columns-alist will be used as alternatives to `left-margin' in margin display specs. The display engine would scan the contents of the current window, process said specs, calculate which lines fit the window and which do not, set the total margin width appropriately, and display all columns in it. Some reflowing might be required. If the latter is considered too difficult, we can add "width" as a necessary parameter to the column properties. I think that would rule out the possibility of efficiently using the margins for the line numbers feature, though, which seems unfortunate. But the other uses of the margin that I'm aware of are not as dynamic. Similar feature can be added for the fringes, too (for them, dynamic sizing isn't needed at all, probably). Comments?