unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How to keep window margins after switching buffers?
@ 2021-04-25 15:41 Jean Louis
  2021-04-25 17:12 ` martin rudalics
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Louis @ 2021-04-25 15:41 UTC (permalink / raw)
  To: Help GNU Emacs


I have rather aesthetical need to have window margins, I use it as: 

(set-window-margins (get-buffer-window) 10 10)

But when I switch to other buffer and come back margins disappea.

Would there any way to keep margins for specific buffer even after
switching?

Jean



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

* Re: How to keep window margins after switching buffers?
  2021-04-25 15:41 How to keep window margins after switching buffers? Jean Louis
@ 2021-04-25 17:12 ` martin rudalics
  2021-04-25 17:34   ` Jean Louis
  0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2021-04-25 17:12 UTC (permalink / raw)
  To: Jean Louis, Help GNU Emacs

 > I have rather aesthetical need to have window margins, I use it as:
 >
 > (set-window-margins (get-buffer-window) 10 10)
 >
 > But when I switch to other buffer and come back margins disappea.
 >
 > Would there any way to keep margins for specific buffer even after
 > switching?

I suppose you want to set `left-margin-width' and `right-margin-width'
for that buffer instead.

martin



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

* Re: How to keep window margins after switching buffers?
  2021-04-25 17:12 ` martin rudalics
@ 2021-04-25 17:34   ` Jean Louis
  0 siblings, 0 replies; 3+ messages in thread
From: Jean Louis @ 2021-04-25 17:34 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

* martin rudalics <rudalics@gmx.at> [2021-04-25 20:12]:
> > I have rather aesthetical need to have window margins, I use it as:
> >
> > (set-window-margins (get-buffer-window) 10 10)
> >
> > But when I switch to other buffer and come back margins disappea.
> >
> > Would there any way to keep margins for specific buffer even after
> > switching?
> 
> I suppose you want to set `left-margin-width' and `right-margin-width'
> for that buffer instead.

That is right, thanks. I was setting that one in expectation it will
automatically resize margins. I see that I have to use both
set-window-margins and then also those variables for it to persist.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

end of thread, other threads:[~2021-04-25 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 15:41 How to keep window margins after switching buffers? Jean Louis
2021-04-25 17:12 ` martin rudalics
2021-04-25 17:34   ` Jean Louis

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).