Subject: Re: bug#5042: 23.1; linum-mode gives incorrect line numbers with narrowed buffers

From: Juanma Barranquero <[email-masked]>
Date: Tue, 1 Dec 2009 01:32:26 +0100

X-Debbugs-CC: [email-masked]
quit

On Thu, Nov 26, 2009 at 01:39, Mark Lillibridge <[email-masked]> wrote:

>    Linum-mode does not work correctly with buffers that have been
> narrowed.  As a simple example, type ^h i.  You will note that the first
> line is assigned line number one.  You can verify that this is wrong
> either by using goto-line

Let's hear Markus' opinion, but IMHO that's not necessarily a bug.
Linum's function is to add line numbers, but these do not have to
correspond to buffer lines. For example, nothing stops you from doing

  (defvar my-num 1000)
  (make-variable-buffer-local 'my-num)

  (setq linum-format (lambda (n) (format "%4d" (+ n my-num))))

    Juanma