GNU bug report logs -
#4996
23.1; linum mode fails to number lines properly when just scrolling buffer
Previous Next
Reported by: mark.lillibridge <at> hp.com
Date: Sat, 21 Nov 2009 05:40:05 UTC
Severity: normal
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
This is an automatic notification regarding your bug report
which was filed against the emacs package:
#4996: 23.1; linum mode fails to number lines properly when just scrolling buffer
It has been closed by Stefan Monnier <monnier <at> IRO.UMontreal.CA>.
Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Stefan Monnier <monnier <at> IRO.UMontreal.CA> by
replying to this email.
--
4996: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4996
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
>> 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
[Message part 3 (message/rfc822, inline)]
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 <at> 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
This bug report was last modified 15 years and 182 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.