help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: any way to get white margin around text?


From: Jean Louis
Subject: Re: any way to get white margin around text?
Date: Thu, 24 Dec 2020 22:25:00 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Omar Polo <op@omarpolo.com> [2020-12-24 21:56]:
> 
> Jean Louis <bugs@gnu.support> writes:
> 
> > I would like to get margin around the text, let us say 2 lines from
> > top and 4 columns from the left side. The marging should not be
> > indentation or something that is part of text, but rather only visual.
> >
> > The command `set-left-margin' does not do what I mean, it sets margin
> > but is part of the text. I just would like it visually separated form
> > the window borders to gain better nicer note display.
> 
> set-window-margin should do what you're saying.  For instance
> 
>     (set-window-margin (get-buffer-window) 4 4)
> 
> will set the borders on both sides to 4 columns, without affecting the
> buffer content.  The fringe will be between the margin and the buffer
> content though.
> 
> (I've never used this function directly before, I've found it now by
> inspecting the olivetti-mode implementation)

Thank you, I have made now this:

(defun rcd-word-processing ()
  "Sets margins around `fill-column' and invokes `ruler-mode'"
  (interactive)
  (let ((fill-column (or fill-column 70))
        (width (window-total-width)))
    (when (> width fill-column)
      (let* ((left (/ (- width fill-column) 2))
             (right (- width left fill-column)))
        (set-window-margins (get-buffer-window) left right)))
    (ruler-mode)))

That is already good, although the top display margin I still do not
know how to set but is not important.

The above function is not handling zooming and set-fill-column
automatically. It is still more enjoyable with margins.

And if I could now use margins for some reference lists, click and
insert...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]