0

I want to mainly margin only the left side, for example, to set the left margin to about 30% of the total width and 5% on the right side.

I'm using olivetti now but this package doesn't seem to be able to specify separately on the left and right. Is there any solution?

2
  • Is this what you mean by margin?
    – shynur
    Mar 5, 2023 at 9:46
  • It's probably set by built-in left-margin-width, your link is fringe? maybe.
    – roomworoof
    Mar 5, 2023 at 10:02

1 Answer 1

1

I would say just create a custom function for it e.g.:

(defun set-window-margins-relatively (window left-fraction &optional right-fraction)
  (set-window-margins window
                      (round (* (window-width) left-fraction))
                      (when right-fraction
                        (round (* (window-width) right-fraction)))))

This function uses fractions (i.e. percentage/100) instead of percentage.

I haven't looked at Olivetti though (so I am not sure how it implemented things).

1
  • 1
    It worked perfectly as my purpose. Thanks!
    – roomworoof
    Mar 5, 2023 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.