From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21835: 25.0.50; cursor height wrong when line-spacing is used Date: Thu, 05 Nov 2015 18:12:21 +0200 Message-ID: <831tc4togq.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1446740006 19553 80.91.229.3 (5 Nov 2015 16:13:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Nov 2015 16:13:26 +0000 (UTC) Cc: 21835@debbugs.gnu.org To: David Reitter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 05 17:13:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZuNA1-0001dF-8Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Nov 2015 17:13:13 +0100 Original-Received: from localhost ([::1]:33279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuNA0-0000y1-Ml for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Nov 2015 11:13:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuN9u-0000u6-JU for bug-gnu-emacs@gnu.org; Thu, 05 Nov 2015 11:13:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuN9q-0007g0-8c for bug-gnu-emacs@gnu.org; Thu, 05 Nov 2015 11:13:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuN9q-0007fv-5U for bug-gnu-emacs@gnu.org; Thu, 05 Nov 2015 11:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZuN9p-0007lf-Nr for bug-gnu-emacs@gnu.org; Thu, 05 Nov 2015 11:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Nov 2015 16:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21835 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21835-submit@debbugs.gnu.org id=B21835.144673997429846 (code B ref 21835); Thu, 05 Nov 2015 16:13:01 +0000 Original-Received: (at 21835) by debbugs.gnu.org; 5 Nov 2015 16:12:54 +0000 Original-Received: from localhost ([127.0.0.1]:54868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZuN9h-0007lI-Bw for submit@debbugs.gnu.org; Thu, 05 Nov 2015 11:12:53 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:60278) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZuN9a-0007l6-TI for 21835@debbugs.gnu.org; Thu, 05 Nov 2015 11:12:51 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NXC00A00NGIQL00@mtaout29.012.net.il> for 21835@debbugs.gnu.org; Thu, 05 Nov 2015 18:11:52 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NXC00AVHNNSM800@mtaout29.012.net.il>; Thu, 05 Nov 2015 18:11:52 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108479 Archived-At: > From: David Reitter > Date: Wed, 4 Nov 2015 23:21:13 -0500 > > Start Emacs 25 (master branch) (with -Q if you like) > > (setq line-spacing 1.0) > > (Note how the display doesn’t update, so enter C-l to force it) It does update for me if I evaluate that with C-j at the right parenthesis. How did you evaluate it? > Result: cursor is displayed with wrong (large, two-line) height when at the end of a line, and correctly when not at the end of a line. Strange as it might sound, this is not a bug, but intended behavior. It is a consequence of improvements in display code that avoid extremely large lines with some fonts (in particular, math fonts) that declare preposterously large font sizes. Previously, the line height, and the height of the cursor at EOL, was determined by the font-global ascent/descent values. We now determine the height of the line by looking at the glyphs we actually display on that line. See bug#20628 for more details. The problem with displaying the cursor at the end of the line is that there's no displayable glyph there, whose dimensions in the font we could use to determine the cursor height. So we set the cursor height to the line height. > This wasn’t the case in Emacs 24. Yes, the changes to use the glyph metrics are new in Emacs 25. > Also note bug#17977 That's unrelated to this issue, AFAICS. That bug is NS specific, whereas what you describe happens on all supported GUI frames. > In any case, the cursor’s height should not change. When you say "should not change", what do you have in mind? Should not change from what value? If you think that the value of the cursor height is fixed when it is displayed on other characters of the line, then this is not so, unfortunately. Please keep in mind that characters on a line can have different dimensions, even if they come from the same font, let alone if they come from different fonts (which happens quite a lot in Emacs, given today's abundance of rare characters in plain text). When the cursor is displayed on a character, it gets its dimensions from that character (you can see the effect of that if you display a line where some characters come from a larger font). But that doesn't work when the cursor is at the end of a line, where there's no character to begin with. So we use the line's height instead. I agree that the result looks somewhat ugly, especially when the value of line-spacing is large. Suggestions for better defaults are welcome; at the time, I tried several other ideas, but they all had worse problems. > If it has to be this high the actual text line should be vertically > centered. We cannot do that without changing how line-spacing is applied. Since Emacs 21.1, when this feature was added, we always added the spacing _below_ each line. The ELisp manual documents this: You can specify the line spacing for all lines in a buffer via the buffer-local ‘line-spacing’ variable. An integer specifies the number of pixels put below lines. A floating-point number specifies the spacing relative to the default frame line height. and elsewhere: ‘line-spacing’ Additional space to leave below each text line, in pixels (a positive integer). (Note the "below" parts in both excerpts.) I personally never use these features, so I don't object to changing the effect of line-spacing to have it distributes between the ascent and descent parts somehow. Not sure what others will say. In any case, doing this will require non-trivial changes to display code. Thanks.