From: Nathan Trapuzzano <nbtrap@nbtrap.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 13446@debbugs.gnu.org
Subject: bug#13446: 24.2; Fix loop test in linum.el
Date: Sun, 27 Oct 2013 15:36:07 -0400 [thread overview]
Message-ID: <87r4b68q1k.fsf@nbtrap.com> (raw)
In-Reply-To: <jwvtxg2on2v.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Sun, 27 Oct 2013 09:39:41 -0400")
The behavior you describe is actually doable using a combination of
`linum-before-numbering-hook' and `linum-format'. (In particular, I'm
talking about setting `linum-format' to a symbol, which will cause linum
to call the function with that symbol's name to retrieve the line number
as a string.) I know because I've implemented it, or something very
similar to it, myself.
Indeed, given these two variables, linum is actually very capable. On
the other hand, one seeminly irreparable problem with linum is _when_ it
applies the overlays--or when it doesn't. I'm not sure if there's a bug
report for this, but faily often linum won't display the overlays at
all, or will only display the line numbers on some of the lines in the
window. This happens especially frequently when bouncing on balanced
parens/brackets via `forward-' and `backward-sexp'. If something is
going to replace linum, I'd be very interested to know whether it fixes
this problem. Do you happen to know?
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> BTW, in nlinum-mode, the default behavior is half-way between the two:
> we don't try to accommodate the largest line number there can be
> (partly to avoid scanning the whole buffer, which can be a performance
> problem in itself), so we grow the margin only when we display a larger
> number, but we don't shrink it back when moving back to the beginning of
> the file with shorter line numbers.
next prev parent reply other threads:[~2013-10-27 19:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 1:13 bug#13446: 24.2; Fix loop test in linum.el Nathan Trapuzzano
2013-10-25 15:26 ` Nathan Trapuzzano
2013-10-27 4:20 ` Stefan Monnier
2013-10-27 11:54 ` Nathan Trapuzzano
2013-10-27 13:39 ` Stefan Monnier
2013-10-27 19:36 ` Nathan Trapuzzano [this message]
2013-10-28 0:36 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2013-01-15 5:36 bug#13454: 24.2; Small fix to reference manual Nathan Trapuzzano
2013-10-26 21:44 ` bug#13446: 24.2; Fix loop test in linum.el Nathan Trapuzzano
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=87r4b68q1k.fsf@nbtrap.com \
--to=nbtrap@nbtrap.com \
--cc=13446@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 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).