[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed b
From: |
Mark Lillibridge |
Subject: |
bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers |
Date: |
Sat, 9 Jan 2010 17:32:18 -0800 |
Markus wrote:
> In my opinion, a more general solution than only for linum.el would be
> best, one that also makes for example line-number-mode show line numbers
> that work as expected with M-x goto-line RET also for narrowed buffers.
> Ideally, it should work without having to customize each of these
> features (and new modes in the future) separately. I think a promising
> suggestion (found in this thread) is to generalise narrowing itself,
> possibly with a single new customization option instead of many.
That's a good idea. We could add a buffer local variable that
determines how to number lines when a restriction is in effect. Rmail,
Info, and similar modes could set this variable for their buffers to
start numbering the visible restriction at 1. Other buffers would
depend on the user's global customization setting. goto-line, linum,
and related features would consult this variable.
I don't know any good arguments for which way to set the global
default.
What do people think of this plan? The alternative KISS strategy is
to just make line numbering always start with one for restrictions; I
think this makes everybody happy. The downside is that you can't see
the external line numbers of lines while you have restricted the buffer
and you can't go to lines by their external line number while you have
restricted the buffer. I, at least, don't use narrow (interactively)
enough that that these drawbacks would matter.
- Mark
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Mark Lillibridge, 2010/01/07
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Markus Triska, 2010/01/07
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers,
Mark Lillibridge <=
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Lennart Borgman, 2010/01/09
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Juanma Barranquero, 2010/01/09
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Mark Lillibridge, 2010/01/16
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Juanma Barranquero, 2010/01/16
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Mark Lillibridge, 2010/01/23
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Drew Adams, 2010/01/23
- bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers, Juanma Barranquero, 2010/01/24