![writeroom 2 writeroom 2](https://www.iculture.nl/wp-content/uploads/2009/07/screen-capture-28.jpg)
Present example, `set-window-margins' should compare 4+2=6 with 40 for Or to the *total* of all static values, whichever is larger. In this case, the window width is set to the *largest* dynamic value, * If DYNAMIC is t, this is recorded in `window-margins-alist', e.g.:
#Writeroom 2 code#
Now, in order to prevent existing code from breaking. Without checking `window-margins-alist', i.e., it behaves as it does * If `set-window-margins' is called without SYM, it sets the margins Requested widths, so in the example above to (6 0). Subsequently, the window margins are set to the total of all * If `set-window-margins' is called with a non-nil value for SYM, anĮntry is recorded in `window-margins-alist', or updated if one isĪlready present, or deleted if both LEFT-WIDTH and RIGHT-WIDTH are
![writeroom 2 writeroom 2](https://images.sftcdn.net/images/t_app-cover-l,f_auto/p/d3377a0e-a4cb-11e6-b280-00163ed833e7/1860188485/writeroom-screenshot.png)
SYM is a symbol (chosen by the caller) that identifies the mode that (set-window-margins WINDOW LEFT-WIDTH &optional RIGHT-WIDTH SYM DYNAMIC) * Amend `set-window-margins' to take two additional parameters: * Add a window parameter (say `window-margins-alist') that records Static (i.e., should not be changed when the window width changes) or Set the margins and to which values they set them and whether they are Of the proposal is that `set-window-margins' keeps track of which modes I'd like to outline a way to hopefully solve both issues. Margins after the window has been split.) Isn't, but the aforementioned modes compensate for this by adjusting the Window (including margins) is wide enough.
#Writeroom 2 windows#
`window-splittable-p' currentlyĭetermines that such windows cannot be split horizontally, even when the When the window widthĬhanges, the margins are recalculated. Such modes, the width of the margins is determined on the basis of theĭesired text width and the current window width. `writeroom-mode', `olivetti' (both on MELPA) or `darkroom-mode' (onĮLPA), that use the margins to center the text area in the window. The assumption is not necessarily correct, specifically in modes such as 'split-window-sensibly'), because this function makes this sameĪssumption when determining whether a window can be split horizontally. It becomes a problem in `window-splittable-p' (and Margin width can do so in `window-configuration-change-hook'. Itself is not a problem, because a mode that does want to change the Margins need to be retained, i.e., their width doesn't change. There is currently no good wayįor a mode to prevent such interference reliably.Ģ) When a window's width is changed, Emacs currently assumes that the That the modes use to adjust the margins. Is depends on the order in which they were activated and on the hooks (left) margin to a value x and package B sets it to a value y, whichever Two issues specificallyġ) If two modes use the margins at the same time, there is no way toĮnsure that they don't interfere. Window margins that could stand improvement. In two recent threads, one here ("Window splitting issues with margins")Īnd one on (bug 22009), some issues were discussed with