all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bryan Gilbert <gilbertw1@gmail.com>
Cc: 27281@debbugs.gnu.org
Subject: bug#27281: Fix nlinum missing line numbers.
Date: Sat, 10 Jun 2017 10:35:29 -0400	[thread overview]
Message-ID: <4a1fa05f-94ea-a048-c1fb-73d62d4bdc45@gmail.com> (raw)
In-Reply-To: <87h8zovz62.fsf@users.sourceforge.net>

On 06/10/2017 07:51 AM, npostavs@users.sourceforge.net wrote:
 > William Gilbert <gilbertw1@gmail.com> writes:
 >
 >> I've been working to track to down a bug where line numbers are
 >> occasionally missing when using nlinum mode. Currently there is a 
package
 >> written to workaround the problem that has a picture and description 
of the
 >> problem: https://github.com/hlissner/emacs-nlinum-hl.
 >>
 >> After extensive debugging I've tracked the problem down to the
 >> 'nlinum--region' function. Specifically the while loop check that
 >> determines if '(point)' is less than the limit. I've found that the 
problem
 >> exists when '(point)' is exactly equal to 'limit'. In this scenario the
 >> loop terminates and the last line in the region is not provided with 
a line
 >> number.
 >
 > Do you know how to reproduce this scenario?

I don't know how to easily and reliably reproduce this problem. I 
normally encounter it at least once every few minutes. I've reproduced 
the problem in my configuration, which is a derivative of the doom 
configuration (https://github.com/hlissner/.emacs.d), and using 
spacemacs with nlinum enabled. I don't know if there is anything 
specific to those two configurations that makes the problem present 
itself more frequently, but using one of those setups you should see the 
problem relatively quickly.

I lucked out and had a saved perspective (persp-mode) that exhibited 
this problem every time I loaded it, which was what allowed me to 
reliably debug the problem.

 >
 >> I was able to remedy the problem by changing the condition from
 >> 'less than' to 'less than or equal to', which will allow the last 
line in
 >> the region to be properly assigned a line number.
 >
 > This sounds like a workaround, possibly to a bug in jit-lock. Or
 > perhaps we need to return a list of the form (jit-lock-bounds BEG END)
 > from nlinum--region?

I am not familiar with jit-lock and am still all around very much a 
novice with elisp and emacs. I essentially zeroed in on the problem, but 
instrumenting some of the nlinum functions with print messages. I still 
have the perspective and underlying files preserved that replicate this 
problem everytime I load them. If there is anything you would like me to 
test or debug, please let me know. I will try to dig a little deeper to 
understand nlinum's interaction with jit-lock.





  reply	other threads:[~2017-06-10 14:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 21:46 bug#27281: Fix nlinum missing line numbers William Gilbert
2017-06-10 11:51 ` npostavs
2017-06-10 14:35   ` Bryan Gilbert [this message]
2017-06-10 17:44   ` Alex
2017-06-10 22:12     ` npostavs
2017-06-11  1:18       ` Alex
2017-06-11  1:37         ` npostavs
2017-06-11  2:37       ` Bryan Gilbert
2017-06-11  2:50         ` Bryan Gilbert
2019-09-29 15:04           ` Lars Ingebrigtsen

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=4a1fa05f-94ea-a048-c1fb-73d62d4bdc45@gmail.com \
    --to=gilbertw1@gmail.com \
    --cc=27281@debbugs.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.