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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19004 in the body.
You can then email your comments to 19004 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19004; Package emacs. (Sun, 09 Nov 2014 20:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 09 Nov 2014 20:02:02 GMT) Full text and rfc822 format available.

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

From: Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; Please provide a non-regexp interface to occur
Date: Sun, 09 Nov 2014 21:00:50 +0100
Hi.

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.

-- Juliusz




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19004; Package emacs. (Sun, 09 Nov 2014 20:52:01 GMT) Full text and rfc822 format available.

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))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19004; Package emacs. (Fri, 28 May 2021 02:21:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.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: Fri, 28 May 2021 04:20:06 +0200
Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr> writes:

> 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.

(I'm going through old bug reports that unfortunately got little response at
the time.)

There are many ways to search in Emacs, and there's a some packages that
provide structured searching, too.  (For instance, to search based on
semantic qualities in the code.)

Given that, I don't think it makes that much sense to extend the `occur'
command itself -- it does the thing it does very well, and extending it
in that way would make an already complex command even more complicated.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 28 May 2021 02:21:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19004 <at> debbugs.gnu.org and Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 28 May 2021 02:21:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Jun 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 306 days ago.

Previous Next


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