GNU bug report logs - #19004
24.4; Please provide a non-regexp interface to occur

Previous Next

Package: emacs;

Reported by: Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>

Date: Sun, 9 Nov 2014 20:02:02 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 19004 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>
Cc: 19004 <at> debbugs.gnu.org
Subject: Re: bug#19004: 24.4; Please provide a non-regexp interface to occur
Date: Sun, 09 Nov 2014 22:49:50 +0200
> I like occur a lot, but I find it inflexible -- the matched lines can only
> be specified by a regexp.  I'd like to be aple to pass a function to occur
> instead of a regexp.
>
> The function should be called with point at the beginning of a line to
> match/not match, so that
>
>   (occur regexp)
>
> is equivalent to
>
>   (occur #'(lambda () (looking-at regexp)))
>
> Of course, the function should be able to examine the context around the
> line being matched.

At the core of the Occur engine there is the function re-search-forward.
We could move it out to a separate variable e.g. occur-search-function
(as we do for isearch-search-fun-function).  Then you will be able to
override it with your own like

  (let ((occur-search-function 'word-search-forward))
    (occur string))




This bug report was last modified 3 years and 363 days ago.

Previous Next


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