emacs-devel
[Top][All Lists]
Advanced

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

RE: Box attribute in mode-line and scrolling


From: Drew Adams
Subject: RE: Box attribute in mode-line and scrolling
Date: Sun, 27 Mar 2011 08:06:40 -0700

> > That doesn't seem like a bug, but the fact that adding the box
> > enlarges the size of the modeline, and likely the last line of the
> > window isn't fully displayed.
> 
> Yes, that seems to be what's happening. But how is that not a 
> bug?
> 
> > Does it also happen if, instead of ":box t" you use ":box
> > '(:line-width -1 :style released-button)"?
> 
> Yup, that fixes it, and even if I don't use :style released-button.

This gotcha should be pointed out more clearly in the doc, since the default
behavior increases the height of the current line, which can throw off various
things.

The doc is clear, but it could help to explicitly point out that (a) the default
value's effective :line-width of 1 increases the height of the text line
containing the boxed characters, and that that (b) can automatically lead to a
change the window or frame height because Emacs uses an integral number of
lines.

[If and when the latter is alleviated (there was some talk of making it
pixel-based instead of line-based), the doc can be updated to reflect the
improvement.]

Another possibility, which I would support, would be to change the default
:line-width to -1 instead of 1.  For backward compatibility we probably should
not just reinterpret `t', but we could change the default to `inside', meaning
the same as `t' but with a :line-width of -1.

The following information, necessary to using :box without problems, is not
obvious without studying various parts of the doc (parts that do not cross
reference each other):

1. You can use a negative :line-width, and a positive value always increases the
effective line height.

2. Window height is based on an integral number of text lines.

We would avoid making the user understand all of that just to use boxes, by
changing the default :line-width to -1.

In that case, a user might still wonder how to get a box with the line moved
farther out (analog of #1), but we have doc for that, and that doesn't require
understanding of the details about line height.

Note too that underline and overline face attributes correspond to a box
:line-width of -1, not 1.  At least they appear to on my platform.  Which is why
this line-height gotcha only bites users for :box.




reply via email to

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