GNU bug report logs - #42609
28.0.50; Issue with highlight in long files

Previous Next

Package: emacs;

Reported by: Ergus <spacibba <at> aol.com>

Date: Thu, 30 Jul 2020 00:47:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: 42609 <at> debbugs.gnu.org
Cc: spacibba <at> aol.com
Subject: bug#42609: 28.0.50; Issue with highlight in long files
Date: Thu, 06 Aug 2020 02:43:50 +0300
>> If in line 3407 I do:
>>
>> M-s h r 0x20141e140
>> Only the first 6 occurrences are highlighted
>>
>> Else if I do instead
>> M-g g 73188
>> M-s h r 0x20141e140
>>
>> then only the occurences in lines [73184 -> 91916] are highlighted
>>
>> I don't attach the log because it is too big for an email.
>
> Please try to increase the value of hi-lock-highlight-range.
> Recently it was changed from 200_000 to 2_000_000 in bug#40224.
> Do you think it should be increased more?

My first thought was to add a new option 'nil' "No limit" to
hi-lock-highlight-range.  But actually it's easy to just set it
to a big value.  And this still doesn't solve the problem
when hi-lock gives an impression that it highlights everything.

So a better idea is to notify the user with a warning when hi-lock
highlights less occurrences than there are in the buffer:

diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index a18310322a..33ca40f8de 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -812,7 +812,9 @@ hi-lock-set-pattern
               (setq hi-lock-interactive-patterns
                     (cdr hi-lock-interactive-patterns)
                     hi-lock-interactive-lighters
-                    (cdr hi-lock-interactive-lighters)))))))))
+                    (cdr hi-lock-interactive-lighters))))
+          (when (or (> search-start (point-min)) (< search-end (point-max)))
+            (message "Hi-lock added only in range %d-%d" search-start search-end)))))))
 
 (defun hi-lock-set-file-patterns (patterns)
   "Replace file patterns list with PATTERNS and refontify."




This bug report was last modified 4 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.