unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21092@debbugs.gnu.org
Subject: bug#21092: 25.0.50; Option `lazy-highlight-max-at-a-time' does not work
Date: Fri, 28 Aug 2015 09:59:18 -0700 (PDT)	[thread overview]
Message-ID: <360259eb-56eb-49d2-9c98-edd0c79fc4d6@default> (raw)
In-Reply-To: <31c8bd13-e53c-41b8-ae36-cbbb13d2001d@default>

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

> OK, I think I found the problem.  I have something working,
> but will send it in the form of a patch in a while.
> 
> Essentially, it is the isearch.el code itself that imposes, in
> a few places, not searching past (window-end) or before
> (window-start), regardless of the value of
> `isearch-lazy-highlight-max-at-a-time'.  This is what needs to
> be fixed, to be (point-max) and (point-min) when
> `isearch-lazy-highlight-max-at-a-time' is nil.
> 
> A more thoroughgoing fix would take into account a numeric
> value of `isearch-lazy-highlight-max-at-a-time', but I won't
> bother with that, for now.

Attached is a quick patch that seems to be OK wrt fixing
things for a nil value of `isearch-lazy-highlight-max-at-a-time'.

Please give it a try.  If OK then I will update the doc and
defcustom to make clear that (for now) this works only for
nil and not for a large value.

Feel free to adjust the fix.  Or to extend it to also take a
numeric value into account.  But I will be happy if it is fixed
at least for nil.

[-- Attachment #2: isearch-2015-08-28.patch --]
[-- Type: application/octet-stream, Size: 1378 bytes --]

diff -uw isearch.el isearch-patched-2015-08-28.el
--- isearch.el	2015-08-28 09:47:45.431252800 -0700
+++ isearch-patched-2015-08-28.el	2015-08-28 09:51:40.683708500 -0700
@@ -3092,13 +3092,13 @@
 				(+ isearch-lazy-highlight-start
 				   ;; Extend bound to match whole string at point
 				   (1- (length isearch-lazy-highlight-last-string)))
-			      (window-end)))
+			      (if lazy-highlight-max-at-a-time (window-end) (point-max))))
 		     (max (or isearch-lazy-highlight-start-limit (point-min))
 			  (if isearch-lazy-highlight-wrapped
 			      (- isearch-lazy-highlight-end
 				 ;; Extend bound to match whole string at point
 				 (1- (length isearch-lazy-highlight-last-string)))
-			    (window-start))))))
+			    (if lazy-highlight-max-at-a-time (window-start) (point-max)))))))
 	;; Use a loop like in `isearch-search'.
 	(while retry
 	  (setq success (isearch-search-string
@@ -3142,12 +3142,12 @@
 			  (if isearch-lazy-highlight-forward
 			      (if (= mb (if isearch-lazy-highlight-wrapped
 					    isearch-lazy-highlight-start
-					  (window-end)))
+					  (if max (window-end) (point-max))))
 				  (setq found nil)
 				(forward-char 1))
 			    (if (= mb (if isearch-lazy-highlight-wrapped
 					  isearch-lazy-highlight-end
-					(window-start)))
+					(if max (window-start) (point-min))))
 				(setq found nil)
 			      (forward-char -1)))
 

  reply	other threads:[~2015-08-28 16:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<9e1b9e19-6a1e-4241-a3e6-2876509e1423@default>
     [not found] ` <<7245a30d-355a-425e-b19b-1c9ecc5e94e3@default>
     [not found]   ` <<83lhcv4wp4.fsf@gnu.org>
2015-08-28 15:19     ` bug#21092: 25.0.50; Option `lazy-highlight-max-at-a-time' does not work Drew Adams
2015-08-28 15:46       ` Eli Zaretskii
2015-08-28 21:14       ` Juri Linkov
2015-08-28 21:43         ` Drew Adams
2015-08-29  7:07           ` Eli Zaretskii
     [not found]     ` <<56e13714-27a7-47f9-93df-299b4a25457d@default>
     [not found]       ` <<83wpwf2z6m.fsf@gnu.org>
2015-08-28 15:59         ` Drew Adams
2015-08-28 16:03           ` Eli Zaretskii
     [not found]         ` <<e4ec2bca-0db5-43ba-a100-e99601d39e4c@default>
     [not found]           ` <<83twrj2ye6.fsf@gnu.org>
2015-08-28 16:15             ` Drew Adams
2015-08-28 16:44               ` Drew Adams
2015-08-28 16:59                 ` Drew Adams [this message]
     [not found]       ` <<87si73dsjt.fsf@mail.linkov.net>
     [not found]         ` <<b0d4a886-77ae-4b58-b1b8-3b15999f5052@default>
     [not found]           ` <<83pp26373z.fsf@gnu.org>
2015-08-29 14:42             ` Drew Adams
2015-08-29 21:10               ` Juri Linkov
2015-08-30  2:40                 ` Eli Zaretskii
2015-08-30  5:39                   ` Drew Adams
2015-08-30 20:58                   ` Juri Linkov
2015-08-30 22:39                     ` Drew Adams
2015-08-31 20:01                       ` Juri Linkov
2015-08-31 21:35                         ` Drew Adams
2015-09-01 22:55                           ` Juri Linkov
2015-09-02  0:07                             ` Drew Adams
2015-09-02 22:40                               ` Juri Linkov
2015-12-24  0:47                             ` Juri Linkov
2017-02-22  0:16                               ` Juri Linkov
2015-07-19 13:36 Drew Adams
2015-08-27 20:29 ` Drew Adams
2015-08-28  8:57   ` Eli Zaretskii

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=360259eb-56eb-49d2-9c98-edd0c79fc4d6@default \
    --to=drew.adams@oracle.com \
    --cc=21092@debbugs.gnu.org \
    --cc=eliz@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 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).