all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 49534@debbugs.gnu.org
Subject: bug#49534: 26.3; Isearch should support using filter predicates with empty search hits
Date: Mon, 12 Jul 2021 14:34:29 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488D606F5F4E9EACB351B5BF3159@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)

Consider regep-searching for just $.  No problem; search goes to every
line end.

Now consider wanting to use a filter predicate that allows search hits
only for lines that are at least 80 chars long, e.g.:

 (defun line>79-p (beg end)
   "Return non-nil if END is past column 79."
   (save-excursion
     (goto-char end)
     (> (current-column) 79)))

 (defun foo ()
   (interactive)
   (let ((isearch-filter-predicate  #'line>79-p))
     (isearch-forward 4)))

That won't work.  Isearch is unnecessarily restrictive because of this
test in `isearch-search', which if non-nil prevents invoking
`isearch-filter-predicate'.

 (= (match-beginning 0) (match-end 0))

I've fixed this in my own code (isearch+.el).  But there are now many
differences between vanilla isearch.el and my code, so it's better if
you fix the vanilla code for this bug.

The fix should be pretty straightforward, but if you have trouble let me
know.  You can anyway see my fix here:

  https://www.emacswiki.org/emacs/download/isearch%2b.el


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19042
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''






             reply	other threads:[~2021-07-12 14:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 14:34 Drew Adams [this message]
2021-07-13 16:27 ` bug#49534: 26.3; Isearch should support using filter predicates with empty search hits Lars Ingebrigtsen
2021-07-13 19:25   ` Juri Linkov
2021-07-13 20:20     ` Juri Linkov
2021-07-13 20:41       ` Lars Ingebrigtsen
2021-07-13 22:30         ` Juri Linkov
2021-07-13 21:42       ` bug#49534: [External] : " Drew Adams
2021-07-13 22:30         ` Juri Linkov
2021-07-13 23:00           ` Drew Adams
2021-07-13 22:48       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-13 23:21         ` Juri Linkov
2021-07-13 21:44     ` bug#49534: [External] : " Drew Adams
2021-07-13 22:31       ` Juri Linkov
2021-07-13 23:04         ` Drew Adams
2022-02-16  4:20 ` Drew Adams
2022-02-16 18:20   ` Juri Linkov
2022-02-16 18:54     ` bug#49534: [External] : " Drew Adams
2022-02-16 19:09       ` Juri Linkov
2022-02-16 19:17         ` Drew Adams
2022-02-16 19:25           ` 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

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

  git send-email \
    --in-reply-to=SJ0PR10MB5488D606F5F4E9EACB351B5BF3159@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=49534@debbugs.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 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.