From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Zero height line causing arithmetic errors Date: Sat, 14 Jun 2008 13:35:30 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1213464959 21116 80.91.229.12 (14 Jun 2008 17:35:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Jun 2008 17:35:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 14 19:36:42 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K7Zfx-0005dW-KC for ged-emacs-devel@m.gmane.org; Sat, 14 Jun 2008 19:36:30 +0200 Original-Received: from localhost ([127.0.0.1]:52026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7Zf9-0003e2-5B for ged-emacs-devel@m.gmane.org; Sat, 14 Jun 2008 13:35:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7Zf4-0003dQ-PG for emacs-devel@gnu.org; Sat, 14 Jun 2008 13:35:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7Zf3-0003ce-Is for emacs-devel@gnu.org; Sat, 14 Jun 2008 13:35:34 -0400 Original-Received: from [199.232.76.173] (port=42874 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7Zf3-0003cb-Fh for emacs-devel@gnu.org; Sat, 14 Jun 2008 13:35:33 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:1904 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K7Zf3-0000Bv-11 for emacs-devel@gnu.org; Sat, 14 Jun 2008 13:35:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhcFACeeU0jO+KWv/2dsb2JhbACBW6sY X-IronPort-AV: E=Sophos;i="4.27,644,1204520400"; d="scan'208";a="22521354" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 14 Jun 2008 13:35:30 -0400 Original-Received: from pastel.home ([206.248.165.175]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id UXX00031; Sat, 14 Jun 2008 13:35:31 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 724FD8336; Sat, 14 Jun 2008 13:35:30 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99193 Archived-At: My MPC.el package uses an overlay placed at the end of a line with an after-string of #("\n" 0 1 (face (:height 0.05 :inverse-video t))) in order to place a horizontal line in the display. In Emacs-22, this worked fine (except the line was a bit thicker than 0.05 times the base line height). In Emacs-CVS until recently this worked except that the line was full-height (i.e. 13 pixels in my case). Recently, it has started to cause more problems because now FRAME_SMALLEST_FONT_HEIGHT returns 0, and that value is used at 2 places in the divisor position. I guess the 0 is because 13 pixels (default font height) * 0.05 -> 0.65 pixels which are truncated to 0. I currently use the patch below, which makes it all work again (tho still with the problem that the 0.05 isn't taken into account and line line is 13 pixel think), but I suspect it's not the right place to fix it, Stefan === modified file 'src/font.c' --- src/font.c 2008-06-13 16:25:44 +0000 +++ src/font.c 2008-06-14 17:30:14 +0000 @@ -2682,6 +2682,7 @@ if (FRAME_SMALLEST_FONT_HEIGHT (f) > font->height) FRAME_SMALLEST_FONT_HEIGHT (f) = font->height, fonts_changed_p = 1; } + FRAME_SMALLEST_FONT_HEIGHT (f) = max (1, FRAME_SMALLEST_FONT_HEIGHT (f)); #endif return font_object;