all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sean Perry <shaleh@speakeasy.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 12428@debbugs.gnu.org
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	[thread overview]
Message-ID: <672727B6-0D0E-4680-9C81-B7E83C2A40EB@speakeasy.net> (raw)
In-Reply-To: <jwvfw51xk7t.fsf-monnier+emacs@gnu.org>

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-error-in-emacs-with-linum-mode-on-os-x.
> 
> 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).
> 

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.

> 
>> -        (setq width (max width (length str)))
>> +        (setq width (max width (+ (length str) linum-margin-padding)))
> 
> Why not add linum-margin-padding only at the end, in the call to
> set-window-margins?
> 

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?






  reply	other threads:[~2012-10-26 18:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 19:57 bug#12428: 23.4; Add padding for rendering of the line numbers by linum-mode Sean Perry
2012-10-26 16:47 ` Stefan Monnier
2012-10-26 18:34   ` Sean Perry [this message]
2012-10-28 15:27     ` Stefan Monnier
2016-05-26 19:56 ` Alan Third
2016-05-26 20:19   ` shaleh
2017-09-25 13:53     ` Alan Third

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

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

  git send-email \
    --in-reply-to=672727B6-0D0E-4680-9C81-B7E83C2A40EB@speakeasy.net \
    --to=shaleh@speakeasy.net \
    --cc=12428@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.