unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4996: 23.1; linum mode fails to number lines properly when just scrolling buffer
@ 2009-11-21  5:30 ` Mark Lillibridge
  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
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Lillibridge @ 2009-11-21  5:30 UTC (permalink / raw)
  To: bug-gnu-emacs


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








^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#4996: marked as done (23.1; linum mode fails to number lines properly when just   scrolling buffer)
  2009-11-21  5:30 ` bug#4996: 23.1; linum mode fails to number lines properly when just scrolling buffer Mark Lillibridge
@ 2009-11-24 22:35   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-11-24 22:35 UTC (permalink / raw)
  To: Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

Your message dated Tue, 24 Nov 2009 17:28:27 -0500
with message-id <jwv4oojimmj.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#4996: problem found
has caused the Emacs bug report #4996,
regarding 23.1; linum mode fails to number lines properly when just   scrolling buffer
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4996: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4996
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4488 bytes --]

From: Mark Lillibridge <mark.lillibridge@hp.com>
To: bug-gnu-emacs@gnu.org
Subject: 23.1; linum mode fails to number lines properly when just scrolling buffer
Date: Fri, 20 Nov 2009 21:30:46 -0800
Message-ID: <200911210530.nAL5UkcT017095@mailhub-pa1.hpl.hp.com>


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





[-- Attachment #3: Type: message/rfc822, Size: 1952 bytes --]

From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Markus Triska <markus.triska@gmx.at>
Subject: Re: bug#4996: problem found
Date: Tue, 24 Nov 2009 17:28:27 -0500
Message-ID: <jwv4oojimmj.fsf-monnier+emacsbugreports@gnu.org>

>> I propose changing that line to:
>> 
>> (let ((old-inhibit inhibit-point-motion-hooks))
>> (setq inhibit-point-motion-hooks t)
>> (forward-line)
>> (setq inhibit-point-motion-hooks old-inhibit))

> I suggest:

>       (let ((inhibit-point-motion-hooks t))
>         (forward-line))

Thanks, installed,


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-24 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <jwv4oojimmj.fsf-monnier+emacsbugreports@gnu.org>
2009-11-21  5:30 ` bug#4996: 23.1; linum mode fails to number lines properly when just scrolling buffer Mark Lillibridge
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

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).