From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bryan Gilbert Newsgroups: gmane.emacs.bugs Subject: bug#27281: Fix nlinum missing line numbers. Date: Sat, 10 Jun 2017 10:35:29 -0400 Message-ID: <4a1fa05f-94ea-a048-c1fb-73d62d4bdc45@gmail.com> References: <87h8zovz62.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1497105375 22875 195.159.176.226 (10 Jun 2017 14:36:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Jun 2017 14:36:15 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 Cc: 27281@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 10 16:36:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJhUm-0005Xg-6u for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Jun 2017 16:36:08 +0200 Original-Received: from localhost ([::1]:58702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJhUr-0007Pv-MO for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Jun 2017 10:36:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJhUk-0007Pd-ON for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2017 10:36:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJhUh-0000Wk-C7 for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2017 10:36:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJhUh-0000WY-6Y for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2017 10:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dJhUg-0005dL-I2 for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2017 10:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bryan Gilbert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Jun 2017 14:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27281 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27281-submit@debbugs.gnu.org id=B27281.149710533721624 (code B ref 27281); Sat, 10 Jun 2017 14:36:02 +0000 Original-Received: (at 27281) by debbugs.gnu.org; 10 Jun 2017 14:35:37 +0000 Original-Received: from localhost ([127.0.0.1]:39035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJhUH-0005ch-L4 for submit@debbugs.gnu.org; Sat, 10 Jun 2017 10:35:37 -0400 Original-Received: from mail-yb0-f182.google.com ([209.85.213.182]:36090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJhUG-0005cV-H0 for 27281@debbugs.gnu.org; Sat, 10 Jun 2017 10:35:36 -0400 Original-Received: by mail-yb0-f182.google.com with SMTP id o9so20398240yba.3 for <27281@debbugs.gnu.org>; Sat, 10 Jun 2017 07:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:cc:subject:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=C8XceK9ck7Ejh+nYagbCbJMVuqUWhdXaSRVFzy00K8Y=; b=OvOl0THMAJ6QdOupkuhj7yTaT+5QpzXTM8M2p4MnmSX462NPq1f+aoRF2mO0+vXk2E gCbNF5cfbCTqprTiaU3yL36/fbV8phILPd0v0sMW4fOTKSlLU8B3ZgPLqyCiFEpw8ZzM hXz6Yyit4Ko9Lj2IWD8R+zG89UEpfQ2RjG6YcW9CF1wrD/raRPpACfs6lK5NFzEGD0Q/ yjaLHTkUitBuCWulpP0bkwWDWqUS2ta//jOrtlVJ023Q/qJCIjkuFgh9yVz6E/YKpEMX aU4ft/1EGpXhO9V7uMr036ch4atciyjv1tKx5peavRy4zyuFOK+kpT9poXHoEhD9fnlh XLmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:cc:subject:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=C8XceK9ck7Ejh+nYagbCbJMVuqUWhdXaSRVFzy00K8Y=; b=asHXe25xyF5ZPus/082QLRCQ9GtNNVihJsiRF5ZpwSDN1ox1DQ8WhEoRkBystGCji4 d5qVIghNwLsS/Uxpx08euZ7IevbdBec4b8yFZtUkl7Jr8TRJ152KOTK5m5Sgom2pBQZc 7bCzXC/7zFjxHt2Dd2R2UT6HnQz38/b6fWcjlVeR6cXlJ7e2jLgsGNZO1oCwagNVkuqv 9Rn5P9fDungquPgk7DjMj7tcAKrX9RMb2KMSsPT0mz2Iq75X3vxVlracS/5E9ocoejlW OQ30on7105kjgWEWCNU7Miv7b+0ghG05SvdyHoq0TYYUbPbq3ikPfheSUbwLwqpnxkx8 RhFw== X-Gm-Message-State: AODbwcB+3PudPCdIiaNTCxA8Wz0ecBn74Dugrwn7sX5RR+wX2V4dHhxk kS1aoMn+BZP+435XaGc= X-Received: by 10.37.35.83 with SMTP id j80mr18009349ybj.24.1497105330518; Sat, 10 Jun 2017 07:35:30 -0700 (PDT) Original-Received: from [10.0.0.12] (23-116-242-116.lightspeed.chtnsc.sbcglobal.net. [23.116.242.116]) by smtp.gmail.com with ESMTPSA id f66sm1759851ywh.47.2017.06.10.07.35.30 for <27281@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2017 07:35:30 -0700 (PDT) In-Reply-To: <87h8zovz62.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133444 Archived-At: On 06/10/2017 07:51 AM, npostavs@users.sourceforge.net wrote: > William Gilbert 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.