Centre Emacs buffer within window -


I wrap all my code in 80 columns, and there are times when the MX window is more than 80 columns wide And many unused whitepaces on the right side.

I would like to create the status of amax buffer, so all the text is displayed in the center of the window.

It is different from the center, align the text (like seeing a pdf, on both sides of the text, similar to aerospace).

I think it can be achieved dynamically by adjusting the fringe mode width based on the current window size, I'm not sure where to start any ideas?

It looks like this is actually possible:

  (set-fringe-mode (/ (- (frame-pixel-width) (* 80 (frame-four-width)) 2))   

However, as I am testing it, I feel more fortunate to use margin, at least when my frame size changes:

  (defun myrise-margin () ((margin-size (/ (- (width width) 80) 2)) (set-window-margin zero (Marg-size-margin) (my-size-margin)    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -