I'm trying to emulate some behavior of the darkroom-mode Emacs mode -- specifically the margins setup.

I've figured out one piece of the puzzle -- specifically, to change window margins, I can eval (set-window-margins nil <left margin> <right margin>).

Which is fine, but I'm noticing that the changes only occur in the current window, and will actually go back to the default margin if I switch to a different buffer using C-x left or right arrow key.

I'd like to figure out how to do the following:

  • Set it so that all buffers get the same window-margin settings.
  • Set it so that the margin settings persist after changing windows.

I know that it might involve using hooks, but I'm not exactly sure which hooks to use.

link|improve this question
To whom might be tempted to close-vote: Emacs falls into the "software tools commonly used by programmers" so according to the FAQ it's on topic. – Cosmin Prund Jul 7 '11 at 7:44
@cosmin-prund Also, the solution would probably involve programming, specifically coding in Elisp. Had it not I'd have gone to Super User. – T-Boy Jul 7 '11 at 10:44
feedback

migrated from stackoverflow.com Jul 7 '11 at 17:21

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.