all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bryan Gilbert <gilbertw1@gmail.com>
To: npostavs@users.sourceforge.net
Cc: Alex <agrambot@gmail.com>, 27281@debbugs.gnu.org
Subject: bug#27281: Fix nlinum missing line numbers.
Date: Sat, 10 Jun 2017 22:37:04 -0400	[thread overview]
Message-ID: <0cc87a2c-d024-edda-bce1-671c130d46de@gmail.com> (raw)
In-Reply-To: <8737b7wkyx.fsf@users.sourceforge.net>



On 06/10/2017 06:12 PM, npostavs@users.sourceforge.net wrote:
> I suspect the debugger is suppressed while jit-lock occurs.  You would
> need to log things silently and print it later.  I think
> 'jit-lock--run-functions' and 'jit-lock-fontify-now' would be
> interesting targets.  Something easy to check would be if there are
> certain values of 'jit-lock-functions' needed to trigger this (apart
> from nlinum--region of course).  Here's my guess as to a fix (untested):
Applying that fix seemed to solve the problem! I had to make a slight 
modification to put the 'jit-lock-bounds' function call inside the 
'let', but other than that it seems to work well. I've yet to see the 
problem since applying the patch and my 'bad' perspective worked 
properly as well.

Here's the slightly modified diff:

diff --git a/packages/nlinum/nlinum.el b/packages/nlinum/nlinum.el
index ca4f949fc..82872d571 100644
--- a/packages/nlinum/nlinum.el
+++ b/packages/nlinum/nlinum.el
@@ -297,7 +297,8 @@ it may cause the margin to be resized and line 
numbers to be recomputed.")
    (save-excursion
      ;; Text may contain those nasty intangible properties, but
      ;; that shouldn't prevent us from counting those lines.
-    (let ((inhibit-point-motion-hooks t))
+    (let ((inhibit-point-motion-hooks t)
+          (end start))
        (goto-char start)
        (unless (bolp) (forward-line 1))
        (remove-overlays (point) limit 'nlinum t)
@@ -321,9 +322,10 @@ it may cause the margin to be resized and line 
numbers to be recomputed.")
                     ;;   (run-with-idle-timer 0.5 nil 
#'nlinum--flush-overlays
                     ;;                        (current-buffer)))
                     (setq line (1+ line))
-                   (zerop (forward-line 1))))))))
+                   (setq end (line-end-position))
+                   (zerop (forward-line 1))))))
    ;; (setq nlinum--desc (format "-%d" (nlinum--ol-count)))
-  nil)
+  `(jit-lock-bounds ,start . ,end)))

  ;;;###autoload
  (define-globalized-minor-mode global-nlinum-mode nlinum-mode







  parent reply	other threads:[~2017-06-11  2:37 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
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 [this message]
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=0cc87a2c-d024-edda-bce1-671c130d46de@gmail.com \
    --to=gilbertw1@gmail.com \
    --cc=27281@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    /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.