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

From: Alan Mackenzie <[email-masked]>
Date: Sat, 31 Aug 2019 14:07:36 +0000

Hello, Martin.

On Thu, Aug 29, 2019 at 09:46:54 +0200, martin rudalics wrote:
>  > The documentation says "This variable specifies the width of the left
>  > margin".  As best, this is unclear.  What you're saying is that the
>  > variable ceases to specify that width, should the margin be altered by
>  > other means.

> Eli didn't say that.

>  > I maintain that this is either a bug in the documentation, or in the
>  > code.

>  > If the former, it should explicitly state that the variable is
>  > write-only, and its read value is undefined.  It should say that the
>  > function window-margins should be used instead.

> The variable is not write-only and its read value is well-defined.

Is the read value well-defined?  Never having set it, the value it has
seems always to be 0.  But even if it is well-defined, is it useful for
anything?

>  > But it might be easier just to amend the code.  There appear to be just
>  > two ways to set the width of the left margin (or the right margin), so
>  > if it gets set the second way, why not just set that variable?  Could
>  > this do any harm?  (Note: I haven't looked at the code, yet.)

> Please re-read the documentations of 'left-margin-width' and
> 'set-window-margins' having in mind that the same buffer may appear in
> different windows and the same window may show different buffers all
> with differing margins.

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.

> Once you've done that, please look at the respective documentations
> for fringes and scroll bars which are even more complicated because
> they have to obey a frame parameter as well.

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.

> Thanks, martin

-- 
Alan Mackenzie (Nuremberg, Germany).