[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: any way to get white margin around text?
From: |
Drew Adams |
Subject: |
RE: any way to get white margin around text? |
Date: |
Thu, 24 Dec 2020 13:47:47 -0800 (PST) |
> (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)))
>
> The above function is not handling zooming and set-fill-column
> automatically. It is still more enjoyable with margins.
1. I don't see the problem with setting the fill-column.
But maybe you want to also turn on `auto-fill-mode'.
Or maybe you want to refill the existing text
(`fill-region' or similar).
2. If you use library `zoom-frm.el' zooming works fine.
That is to say that frame-zooming takes care of the
margin also. But buffer-zooming (aka text-scaling)
does not. (`C-u' with a zooming command flips between
frame-zooming and buffer-zooming.)
In addition to the recommended key bindings, you might
want to add bindings for the margins, such as these
same as the recommended ones, but for use in the
margins:
(global-set-key [left-margin C-wheel-down] 'zoom-in)
(global-set-key [right-margin C-wheel-down] 'zoom-in)
(global-set-key [left-margin C-wheel-up] 'zoom-out)
(global-set-key [right-margin C-wheel-up] 'zoom-out)