emacs-devel
[Top][All Lists]
Advanced

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

Re: Question on set-window-margins


From: Eli Zaretskii
Subject: Re: Question on set-window-margins
Date: Tue, 02 Jan 2024 21:20:51 +0200

> From: "Nicolas P. Rougier (inria)" <nicolas.rougier@inria.fr>
> Date: Tue, 02 Jan 2024 18:58:51 +0100
> 
> 
> When I set margins on a window using 'set-window-margins', it 
> works as expected until I switched to another buffer and margins 
> are then reset to 0 on both sides. If I switch back to the 
> original buffer, margins stay at 0. Does that mean that margins 
> are not "attached" to the window nor to the buffer ?
> 
> The name of the function suggest it is attached to window (even 
> though nothing is really specified in the documentation)  but I 
> wonder if the 'set-window-margins' is actually meant to be 
> transient ?
> 
> To keep margins attached to a buffer, I'm using the 
> 'window-state-change-hook' and a buffer local margin definition 
> but maybe I missed a point.

>From the ELisp manual:

 -- Function: set-window-margins window left &optional right
     This function specifies the margin widths for window WINDOW, in
     character cell units.  The argument LEFT controls the left margin,
     and RIGHT controls the right margin (default ‘0’).

     If WINDOW is not large enough to accommodate margins of the desired
     width, this leaves the margins of WINDOW unchanged.

     The values specified here may be later overridden by invoking
     ‘set-window-buffer’ (*note Buffers and Windows::) on WINDOW with
     its KEEP-MARGINS argument ‘nil’ or omitted.



reply via email to

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