unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Antoine Levitt'" <antoine.levitt@gmail.com>, <emacs-devel@gnu.org>
Subject: RE: Box attribute in mode-line and scrolling
Date: Sun, 27 Mar 2011 08:06:40 -0700	[thread overview]
Message-ID: <32AF9E291ACC41DFA9C6A33A111F8541@us.oracle.com> (raw)
In-Reply-To: <87tyeospbb.fsf@gmail.com>

> > 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	other threads:[~2011-03-27 15:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27 11:43 Box attribute in mode-line and scrolling Antoine Levitt
2011-03-27 12:15 ` Juanma Barranquero
2011-03-27 12:35   ` Antoine Levitt
2011-03-27 12:47   ` Antoine Levitt
2011-03-27 15:06     ` Drew Adams [this message]
2011-03-27 17:12       ` Antoine Levitt
2011-03-27 17:39     ` Drew Adams
2011-03-27 13:24 ` Eli Zaretskii
2011-03-27 13:43   ` Antoine Levitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32AF9E291ACC41DFA9C6A33A111F8541@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=antoine.levitt@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).