unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29279: Sharing the margins
@ 2017-11-12 23:51 Dmitry Gutov
  2017-11-13 15:43 ` Eli Zaretskii
  2017-11-13 15:46 ` Eli Zaretskii
  0 siblings, 2 replies; 39+ messages in thread
From: Dmitry Gutov @ 2017-11-12 23:51 UTC (permalink / raw)
  To: 29279

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?





^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2017-11-21 15:40 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-12 23:51 bug#29279: Sharing the margins Dmitry Gutov
2017-11-13 15:43 ` Eli Zaretskii
2017-11-13 17:24   ` Dmitry Gutov
2017-11-13 18:15     ` Eli Zaretskii
2017-11-13 19:02       ` Dmitry Gutov
2017-11-13 19:22         ` Eli Zaretskii
2017-11-13 19:33           ` Dmitry Gutov
2017-11-13 15:46 ` Eli Zaretskii
2017-11-13 17:54   ` Dmitry Gutov
2017-11-13 18:29     ` Eli Zaretskii
2017-11-13 19:16       ` Dmitry Gutov
2017-11-13 19:32         ` Eli Zaretskii
2017-11-13 21:16           ` Dmitry Gutov
2017-11-14 15:30             ` Eli Zaretskii
2017-11-14 22:39               ` Dmitry Gutov
2017-11-15  3:42                 ` Eli Zaretskii
2017-11-15 14:23                   ` Dmitry Gutov
2017-11-15 18:00                     ` Eli Zaretskii
2017-11-15 21:49                       ` Dmitry Gutov
2017-11-16 15:50                         ` Eli Zaretskii
2017-11-18 23:55                           ` Dmitry Gutov
2017-11-19 15:34                             ` Eli Zaretskii
2017-11-20 22:23                               ` Dmitry Gutov
2017-11-21 15:40                                 ` Eli Zaretskii
2017-11-15 18:51                 ` martin rudalics
2017-11-15 20:03                   ` Eli Zaretskii
2017-11-15 21:09                     ` Dmitry Gutov
2017-11-16 15:39                       ` Eli Zaretskii
2017-11-18 23:46                         ` Dmitry Gutov
2017-11-19 15:30                           ` Eli Zaretskii
2017-11-19  0:47             ` Joost Kremers
2017-11-19  9:20               ` Dmitry Gutov
2017-11-14  9:54       ` martin rudalics
2017-11-14 15:51         ` Eli Zaretskii
2017-11-15 18:50           ` martin rudalics
2017-11-14  9:54   ` martin rudalics
2017-11-14 15:51     ` Eli Zaretskii
2017-11-14 18:30       ` martin rudalics
2017-11-14 19:05         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).