[Top][All Lists]

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

Re: Better handling of window margins

From: martin rudalics
Subject: Re: Better handling of window margins
Date: Wed, 02 Dec 2015 19:11:13 +0100

>>   > For example, linum-mode
>>   > will specify a margin width of N columns, and display width of the
>>   > same N columns in pixels.
>> How would this work with scaled text?
> Not sure what problem bothers you.

You say that linum-mode will specify a "display width of the same N
columns in pixels".  How would it react to an increase of the width of
the default face?  IIUC this is not covered by any special hook so it
has to be done via ‘post-command-hook’.  No great deal but it shows that
‘post-command-hook’ is indispensable for such modes.

> set-window-margins interpret its
> argument as the number of character cells.  Converting from pixels, if
> needed, is simple.  If worse comes to worst, the requesting mode can
> use the likes of string-width to compute that.
>>   >   . for splitting the window with "C-x 2" and "C-x 3", the mode could
>>   >     simply invoke the correct splitting function itself
>> When two modes simultaneously use the margins, which splitting function
>> would be chosen?
> It's up to the mode that wants to support splitting in any non-trivial
> manner.  The mode knows exactly what are its needs, so it is free of
> the guesswork.

So you mean there's no need for any new infrastructure here - the
‘split-window’ window parameter can take care of this.

> In any case, the same problem exists if this is somehow guessed.  The
> infrastructure cannot know enough about the modes to make a decision.
>>   >   . for splitting the window as result of some command calling
>>   >     display-buffer, we could expect the modes to customize the
>>   >     display-buffer-* variables to control how the window is split (if
>>   >     there are currently no features/variables to that effect, we should
>>   >     add them)
>> When two modes simultaneously use the margins, which buffer display
>> function would be chosen?
> The same problem exists with the proposed solution, doesn't it?

Is there one?


reply via email to

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