all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark Lillibridge <mark.lillibridge@hp.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#4996: 23.1; linum mode fails to number lines properly when just scrolling buffer
Date: Fri, 20 Nov 2009 21:30:46 -0800	[thread overview]
Message-ID: <200911210530.nAL5UkcT017095@mailhub-pa1.hpl.hp.com> (raw)


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


    In emacs, invoke report-emacs-bug :-) while global-linum-mode is on.
Observe that there is some kind of overlay that occupies 9 lines before
this point.  That is, the spot where this paragraph starts is labeled
line 7.  Now page down (^v) and back (esc v).  Observe that now every
display line, including inside the overlay, has a line number.  *BUG*
What was line 7 is now shown as line 17.

    As soon as you do another command like a right arrow, the line
numbers revert to the original correct line numbering.


Linum has a hook for window-scroll-functions:

linum.el:74:
(define-minor-mode linum-mode
  "Toggle display of line numbers in the left margin."
  :lighter ""                           ; for desktop.el
  (if linum-mode
      (progn
        (if linum-eager
            (add-hook 'post-command-hook (if linum-delay
                                             'linum-schedule
                                           'linum-update-current) nil t)
          (add-hook 'after-change-functions 'linum-after-change nil t))
        (add-hook 'window-scroll-functions 'linum-after-scroll nil t)
        (add-hook 'window-size-change-functions 'linum-after-size nil t)
        (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t)
        (add-hook 'window-configuration-change-hook
                  'linum-after-config nil t)
        (linum-update-current))


linum.el:175:
(defun linum-after-scroll (win start)
  (linum-update (window-buffer win)))


If I disable this function by doing (via {esc}:):

(defun linum-after-scroll (win start)
  t)

the bug goes away.  


    I am investigating further, but the problem appears to be that
forward-line acts differently during window-scroll-functions hook then
normally.  Some sort of dynamic variable binding, perhaps?

- Mark








             reply	other threads:[~2009-11-21  5:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwv4oojimmj.fsf-monnier+emacsbugreports@gnu.org>
2009-11-21  5:30 ` Mark Lillibridge [this message]
2009-11-24 22:35   ` bug#4996: marked as done (23.1; linum mode fails to number lines properly when just scrolling buffer) Emacs bug Tracking System

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=200911210530.nAL5UkcT017095@mailhub-pa1.hpl.hp.com \
    --to=mark.lillibridge@hp.com \
    --cc=4996@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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.