Subject: bug#37213: Execute set-window-margins. left-margin-width remains 0.

From: Alan Mackenzie <[email-masked]>
Date: Sun, 1 Sep 2019 09:48:45 +0000

Hello, Martin.

On Sun, Sep 01, 2019 at 10:26:35 +0200, martin rudalics wrote:
>  > Is the read value well-defined?  Never having set it, the value it has
>  > seems always to be 0.

> All margin-related values are zero by default.

>  > But even if it is well-defined, is it useful for
>  > anything?

> To keep you informed about the sizes of the margins of a window
> whenever the buffer will be shown in it via 'set-window-buffer'.

OK.  It seems there are two alternative strategies for manipulating a
window's margins.  One is to use set-window-margins together with
window-margins, the other is to use left/right-margin-width and
set-window-buffer.

>  > Yes, that's the thing.  We don't have "window local variables" in Emacs,
>  > so anything specific to a window needs a function interface with the
>  > window being one of the parameters.

> Right.  Windows behave like frames in this regard.

>  > I've proposed a simple amendment to the "Display Margins" page of the
>  > elisp manual, saying "don't use these variables to ....!".  This would
>  > solve the misunderstanding I experienced earlier.

> Hmm...  What is the "current width of the left or right margin"?

I'm not sure I understand the question.  In a given window with a left
margin, there will be a maximum length of string which can be displayed
in that margin.  That is its "current width".  The same for a right
margin.  What are you getting at, here?

> martin

-- 
Alan Mackenzie (Nuremberg, Germany).