reddit / emacs

Experiments: abusing margins, mode-line and header-line

Nicolas-Rougier · 2022-10-01 14:45
Nicolas-Rougier · 2022-10-01 14:48
Code (WIP) at https://github.com/rougier/book-mode
xplosm · 2022-10-01 15:01
Looks clean. Nice!
mklsls · 2022-10-01 15:02
It looks super neat! People could use it instead of `visual-fill-column-mode` without problem.
arthurno1 · 2022-10-01 15:56
Pretty!
ftrx · 2022-10-01 19:29
While as always you craft wonderful result I feel that Emacs as such a visual document-UI is simply too hackish/fragile/limited/limiting... Sure document UIs are the past and the future, the past because the first real Desktops was document UIs, the present and future because the actual web trend prove again that widget-based apps can't really scale much but IMO Emacs need a significant under-the-wood work to reach such level of beauty in robust, simple and effective ways... Or, so to speak something to render buffers in much more elaborated ways, starting from a good images, video support like WebVMs monsters and web(cr)applications do "in the modern desktop of someone else computer". When we can have a real 3D parametric CAD in an Emacs buffer, following the Emacs UI model than it will be time for real document-UIs :-) BTW thanks for keeping humans delighted by your wonderful design !
pellucidar7 · 2022-10-01 21:28
Nice, though I'd rather it didn't resize the frame.
[deleted] · 2022-10-02 00:38
Always a pleasure to see your creations :) Author of `olivetti` here. Something I've wanted to do for a while is have a large header/footer margin, so that only a few lines in the middle of the page are visible (for all that *negative spaaace*). Tried a couple of approaches but nothing seemed to work well. Any ideas you may have about this would be much appreciated.
Nicolas-Rougier · 2022-10-02 05:16
For large header/footer, I use the `raise`property that is normally used for subscript/superscript but you can abuse if by setting a very large value on a space such that it is invisible. The all other characters on the header line / mode line will be "pushed" up or down. Only drawback is that you cannot have a background because it will cover the whole area. For the underline on the header line, you can also control the position quite accurately.
GreenSubstantial4469 · 2022-10-02 08:36
I really really like it.
cerka · 2022-10-02 16:49
I like the minimalist look. One thing that is visually counterintuitive is that lower-level section headings get more weight. For example, "Subsubsection" gets ### while "Section" only gets #. In regular org-mode, indentation + org-hide-leading-stars avoids this problem, but the result looks less like something we might see in print. To put more visual emphasis on higher-level section headings, can the size or the weight of the font for the headings be changed instead of putting hash marks next to them?
alessandrobertulli · 2022-10-02 16:55
Wonderful! I really like it! A suggestion: wouldn't it be better to provide \`book-mode\` as a minor mode, instead of a function? Right now, for example, you can't "switch it off", whereas with minor modes you can.
nobiot · 2022-10-02 17:21
Great 👍Thank you very much for putting this out. Book-mode provides great control over top and bottom margins. I have managed to extract some pieces from your code and combined them with Olivetti mode - great result :) Thank you. And thank-you to u/NervousTerrarium for the question and Olivetti :)
Gus_Gustavsohn · 2022-10-02 17:47
Wow. I’m actually clapping at my screen right now, too bad u/Nicolas-Rougier cant hear me. Très jolie!
[deleted] · 2022-10-02 18:20
[deleted]
redblobgames · 2022-10-03 01:30
Olivetti is great! Thank you. I use it when writing.
Nicolas-Rougier · 2022-10-03 04:56
Yes. It's still work in progress but that's the goal.
Nicolas-Rougier · 2022-10-03 04:56
Thanks
Nicolas-Rougier · 2022-10-03 04:59
The idea of having stars in the margin was to keep text aligned while visually showing the level. Ideally, if you use different font for org-level-1/2/3, it should be more obvious on screen.
Nicolas-Rougier · 2022-10-03 04:59
It's temporary but the idea was to enforce a kind of A4 paper format.
Nicolas-Rougier · 2022-10-03 05:00
Thanks
Nicolas-Rougier · 2022-10-03 05:00
Thanks
Nicolas-Rougier · 2022-10-03 05:00
Thanks
Nicolas-Rougier · 2022-10-03 05:00
Thanks
pellucidar7 · 2022-10-03 13:34
You could always abuse the margin harder, like people do on the web if they really want a particular line width.
maxxcan-fox · 2022-10-04 06:11
there is a way to not show the marks in org mode and only the result (setq org-hide-emphasis-markers t)