Window margins that could stand improvement. 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. 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. 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. No menus or formatting options exist, so youll have no choice but. It becomes a problem in `window-splittable-p' (and Margin width can do so in `window-configuration-change-hook'. When placed into distraction-free mode, WriteRoom creates a black screen with green font. 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. `writeroom-mode', `olivetti' (both on MELPA) or `darkroom-mode' (onĮLPA), that use the margins to center the text area in the window. Such modes, the width of the margins is determined on the basis of theĭesired text width and the current window width. `window-splittable-p' currentlyĭetermines that such windows cannot be split horizontally, even when the When the window widthĬhanges, the margins are recalculated. 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. 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. 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 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). Now, in order to prevent existing code from breaking. 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# Present example, `set-window-margins' should compare 4+2=6 with 40 for Or to the *total* of all static values, whichever is larger.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |