unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 42609@debbugs.gnu.org
Cc: spacibba@aol.com
Subject: bug#42609: 28.0.50; Issue with highlight in long files
Date: Thu, 06 Aug 2020 02:43:50 +0300	[thread overview]
Message-ID: <87k0ycr6gx.fsf@mail.linkov.net> (raw)
In-Reply-To: <87wo2kboec.fsf@mail.linkov.net> (Juri Linkov's message of "Fri,  31 Jul 2020 01:59:07 +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."





  reply	other threads:[~2020-08-05 23:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200730004613.y3ubvmdwam3jh4pg.ref@ergus>
2020-07-30  0:46 ` bug#42609: 28.0.50; Issue with highlight in long files Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-30 22:59   ` Juri Linkov
2020-08-05 23:43     ` Juri Linkov [this message]
2020-08-06 23:55       ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0ycr6gx.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=42609@debbugs.gnu.org \
    --cc=spacibba@aol.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).