emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [mentoring-done] a darkroom/writeroom mode for Emacs


From: martin rudalics
Subject: Re: [mentoring-done] a darkroom/writeroom mode for Emacs
Date: Mon, 15 Dec 2014 15:15:21 +0100

> How would you code the condition in (3)? To test "if fits" don't you
> need the width of the window? I can more or less see how it could be
> done if I could find a character position that I am sure is at the
> window edge, but that would just be a rehash of what the hack of
> `darkroom--real-window-width' already does

The function `window-text-pixel-size' gives you the width of some block
of text in pixels. The function `window-width' when called with
PIXELWISE non-nil gives you the width of the window in pixels.  The
difference of the two gives you the pixel width you can distribute.

>> window and there is some space left, distribute that space evenly among
>> the fringes of the window.
>
> If I understand correctly, this is related to (1) and independent of the
> implementation in (2,3). I chose to use the margins to center because
> (1) the term "margins" made sense for this purpose (2) I consider the
> fringes more still useful for continuation markers and other bitmaps.

Presently we cannot resize margins pixelwise.  But we can set fringe
sizes pixelwise.  If you prefer using the margins, you have to round the
difference calculated above (which means that the text might not get
centerd exactly by at most one frame character width minus one pixel).

> Indeed, this is not the intent of darkroom.el, at least in its current
> state. I don't even understand what how such a feature would work or
> feel like. Do you mean like "center paragraph", where a typing a word
> alone on a line makes it occupy the horizontal center?

If it's not the intent of darkroom then don't bother.

martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]