all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* any way to get white margin around text?
@ 2020-12-24 18:39 Jean Louis
  2020-12-24 18:55 ` Omar Polo
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2020-12-24 18:39 UTC (permalink / raw)
  To: Help GNU Emacs

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.









    
  



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any way to get white margin around text?
  2020-12-24 18:39 any way to get white margin around text? Jean Louis
@ 2020-12-24 18:55 ` Omar Polo
  2020-12-24 19:04   ` Drew Adams
  2020-12-24 19:25   ` Jean Louis
  0 siblings, 2 replies; 7+ messages in thread
From: Omar Polo @ 2020-12-24 18:55 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs


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)

HTH



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: any way to get white margin around text?
  2020-12-24 18:55 ` Omar Polo
@ 2020-12-24 19:04   ` Drew Adams
  2020-12-24 19:19     ` Omar Polo
  2020-12-24 19:25   ` Jean Louis
  1 sibling, 1 reply; 7+ messages in thread
From: Drew Adams @ 2020-12-24 19:04 UTC (permalink / raw)
  To: Omar Polo, Jean Louis; +Cc: help-gnu-emacs

> 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.

`set-window-margins', not `set-window-margin'.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any way to get white margin around text?
  2020-12-24 19:04   ` Drew Adams
@ 2020-12-24 19:19     ` Omar Polo
  0 siblings, 0 replies; 7+ messages in thread
From: Omar Polo @ 2020-12-24 19:19 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Jean Louis


Drew Adams <drew.adams@oracle.com> writes:

>> 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.
>
> `set-window-margins', not `set-window-margin'.

Ops, I tried it in the scratch buffer, but for some reason I decided to
re-type it by hand.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any way to get white margin around text?
  2020-12-24 18:55 ` Omar Polo
  2020-12-24 19:04   ` Drew Adams
@ 2020-12-24 19:25   ` Jean Louis
  2020-12-24 21:47     ` Drew Adams
  1 sibling, 1 reply; 7+ messages in thread
From: Jean Louis @ 2020-12-24 19:25 UTC (permalink / raw)
  To: help-gnu-emacs

* 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...




^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: any way to get white margin around text?
  2020-12-24 19:25   ` Jean Louis
@ 2020-12-24 21:47     ` Drew Adams
  2020-12-24 22:54       ` Jean Louis
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2020-12-24 21:47 UTC (permalink / raw)
  To: Jean Louis, help-gnu-emacs

> (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)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: any way to get white margin around text?
  2020-12-24 21:47     ` Drew Adams
@ 2020-12-24 22:54       ` Jean Louis
  0 siblings, 0 replies; 7+ messages in thread
From: Jean Louis @ 2020-12-24 22:54 UTC (permalink / raw)
  To: help-gnu-emacs

Thank you.

What I find more important would be to `ps-print-buffer-with-faces' in
exact same line order as shown on screen. That is missing in Emacs and
would be useful to have dynamic calculation so that lines as shown on
screen are printed properly.

If these lines are shown
on screen then the printer
function would rather give
this output here:

If these lines are shown on screen then the printer function would
rather give this output here.

Unless I increase ps fonts then it becomes somehow similar as on
screen. But that is guess work, it requires formula.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-24 22:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-24 18:39 any way to get white margin around text? Jean Louis
2020-12-24 18:55 ` Omar Polo
2020-12-24 19:04   ` Drew Adams
2020-12-24 19:19     ` Omar Polo
2020-12-24 19:25   ` Jean Louis
2020-12-24 21:47     ` Drew Adams
2020-12-24 22:54       ` Jean Louis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.