Closed petrux closed 10 years ago
Emacs doesn't provide the option of a top (or bottom) margin similar to the left and right margins. I looked into ways of creating something that has a similar visual effect, but there doesn't seem to be something that's robust enough to add to a package such as writeroom-mode
.
So unless I stumble upon a better method, I'll have to leave this one unimplemented.
Ok, ignore last comment... There appears to be a way to sort-of do this. I added a new global effect "Add border" which adds a border around the text area. That should provide more or less what you want and should be robust. It is disabled by default, but you can enable it in the user option writeroom-global-effects
. The width of the border is controlled by writeroom-border-width
, which defaults to 30 (it's a value in pixels).
Great! Already on Marmalade?
Melpa. :-) But yes, it is.
BTW, packages on Melpa are updated automatically from the source repository. The maintainer doesn't need to do anything for that. So normally you only need to wait a bit (usually just a few hours) for updates to appear on Melpa.
Melpa, right! :-)
Ok, sorry for my dumbness and for the question I'm about to ask: how can I activate/customize the mode effects? Thanks!
EDIT: got it, it's just M-: (writeroom-toggle-internal-border-width 1)
. Anyway, I think I discovered a couple of bugs.
EDIT: got it, it's just
M-: (writeroom-toggle-internal-border-width 1)
. Anyway, I think I discovered a couple of bugs.
No, that's not the best way. The recommended way is to use the Emacs' Customize interface:
M-x customize-group RET writeroom RET
Open the option "Global Effects" and check the box "Add border".
I'd like to achieve a top margin, but the described method isn't working for me. I activated "Add border" and set the border width, but still don't see a top margin (padding).
'(writeroom-border-width 100)
'(writeroom-global-effects (quote (writeroom-set-internal-border-width))
It's working fine for me (Emacs 26.2). What effect exactly are you expecting? All that happens is that there is a larger space between the frame edge and the text. This is a screen shot with "Add border" active and a border width of 100 pixel:
And this is without "Add Border":
Yes, that's exactly what I wanted to achieve. Anyway, I removed all writeroom specific settings from my config file and reconfigured them from the GUI and now it's working fine.
Just a (minor) enhancement. When opening buffer in
writeroom-mode
it would be nice to have a three lines top margin.