From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean Perry Newsgroups: gmane.emacs.bugs Subject: bug#12428: 23.4; Add padding for rendering of the line numbers by linum-mode Date: Fri, 26 Oct 2012 11:34:55 -0700 Message-ID: <672727B6-0D0E-4680-9C81-B7E83C2A40EB@speakeasy.net> References: <62162.1347479828@speakeasy.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1351276257 4948 80.91.229.3 (26 Oct 2012 18:30:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 18:30:57 +0000 (UTC) Cc: 12428@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 26 20:31:05 2012 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 1TRogS-0005Eu-GO for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 20:31:04 +0200 Original-Received: from localhost ([::1]:48042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRogK-0004kK-L0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 14:30:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRogH-0004k3-EL for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 14:30:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRogG-0008PP-0e for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 14:30:53 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRogF-0008PB-TZ for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 14:30:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TRoiL-0001Va-RW for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 14:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Perry Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Oct 2012 18:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12428 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12428-submit@debbugs.gnu.org id=B12428.13512763725781 (code B ref 12428); Fri, 26 Oct 2012 18:33:01 +0000 Original-Received: (at 12428) by debbugs.gnu.org; 26 Oct 2012 18:32:52 +0000 Original-Received: from localhost ([127.0.0.1]:35106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRoiB-0001VB-NB for submit@debbugs.gnu.org; Fri, 26 Oct 2012 14:32:52 -0400 Original-Received: from asbnvacz-mailrelay01.megapath.net ([207.145.128.243]:48547) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRoi9-0001V4-EE for 12428@debbugs.gnu.org; Fri, 26 Oct 2012 14:32:50 -0400 Original-Received: from mail6.sea5.speakeasy.net (mail6.sea5.speakeasy.net [69.17.117.50]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 25B52A72AF8 for <12428@debbugs.gnu.org>; Fri, 26 Oct 2012 14:30:38 -0400 (EDT) Original-Received: (qmail 18022 invoked from network); 26 Oct 2012 18:30:37 -0000 Original-Received: by simscan 1.4.0 ppid: 14267, pid: 14651, t: 1.4369s scanners: clamav: 0.88.2/m:52/d:10739 spam: 3.0.4 Original-Received: from dsl027-178-229.sfo1.dsl.speakeasy.net (HELO [192.168.67.109]) (shaleh@[216.27.178.229]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with AES128-SHA encrypted SMTP for ; 26 Oct 2012 18:30:36 -0000 In-Reply-To: X-Mailer: Apple Mail (2.1084) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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:66088 Archived-At: On Oct 26, 2012, at 9:47 AM, Stefan Monnier wrote: >> I was experiencing the issue discussed here at StackOverflow >> = http://stackoverflow.com/questions/4920210/what-causes-this-graphical-erro= r-in-emacs-with-linum-mode-on-os-x. >=20 > I'm not sure I understand what is the problem there. Is it really > a display glitch where the fringe is displayed on top of the margin? > If so, that's just a bug that needs fixing. I.e. please provide > a recipe (I haven't bumped into such a display glitch in my tests > of linum.el). >=20 That is exactly the issue. When I turn the fringe off the text of the = buffer is now right next to the line numbering so I wanted some padding. = I thought other people might too without changing their fringe settings. = I agree the bug needs fixing. I just do not know whose bug it is. For me this is very easy to reproduce. Load a no config emacs. Open some code that is over 100 lines long -- = you need 3 digits of numbering to really see it although it is present = with less. Start linum-mode. The number 1-9 are ok but ever so slightly = chopped. The 10-99 show clear chopping. Now set the following. (custom-set-variables '(fringe-mode (quote (0)) nil (fringe)) ) Now the numbers are fine but the code display is ugly since there is no = padding. I am using the emacs for mac osx build of 23.2. "This is GNU Emacs = 23.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.29) of 2010-05-08 on = black.local" as well as 23.4.1. I just downloaded the build of 24.2 and = it is still there. I only have 23.1 on my local Linux installs. It does = not reproduce there. It may be a font related issue on OS X. The default = for Emacs on OSX is Monaco which is indeed monospace. If I switch the = font by putting just this in ~/.emacs (set-face-attribute 'default nil :family "Inconsolata" :height 145 :weight 'normal) I can clearly see the line being drawn through the linum numbers. Set = the height to 90 and the back of the numbers are being obscured instead. = The screen capture in the link to StackOverflow shows this nicely. >=20 >> - (setq width (max width (length str))) >> + (setq width (max width (+ (length str) = linum-margin-padding))) >=20 > Why not add linum-margin-padding only at the end, in the call to > set-window-margins? >=20 Because it made the call to set-window-margins noisier than it needed to = be. We still want to use (max) since there is no need to add the padding = unless the desired width requires it. Do I misunderstand the code?