From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#19004: 24.4; Please provide a non-regexp interface to occur Date: Sun, 09 Nov 2014 22:49:50 +0200 Organization: JURTA Message-ID: <87tx28w13l.fsf@mail.jurta.org> References: <87oasgrvnx.wl-jch@pps.univ-paris-diderot.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415566349 8083 80.91.229.3 (9 Nov 2014 20:52:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Nov 2014 20:52:29 +0000 (UTC) Cc: 19004@debbugs.gnu.org To: Juliusz Chroboczek Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 09 21:52:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XnZTB-00019a-EQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Nov 2014 21:52:21 +0100 Original-Received: from localhost ([::1]:39976 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnZTA-0002h6-Rq for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Nov 2014 15:52:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnZT0-0002g1-72 for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 15:52:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnZSs-0004QT-5K for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 15:52:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnZSs-0004QN-2K for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 15:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XnZSr-0000q3-T6 for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 15:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Nov 2014 20:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19004 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19004-submit@debbugs.gnu.org id=B19004.14155662813170 (code B ref 19004); Sun, 09 Nov 2014 20:52:01 +0000 Original-Received: (at 19004) by debbugs.gnu.org; 9 Nov 2014 20:51:21 +0000 Original-Received: from localhost ([127.0.0.1]:55179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XnZSD-0000p4-4M for submit@debbugs.gnu.org; Sun, 09 Nov 2014 15:51:21 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.222.226]:50103 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XnZSA-0000ov-DA for 19004@debbugs.gnu.org; Sun, 09 Nov 2014 15:51:18 -0500 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id A1495348328E59; Sun, 9 Nov 2014 12:51:17 -0800 (PST) In-Reply-To: <87oasgrvnx.wl-jch@pps.univ-paris-diderot.fr> (Juliusz Chroboczek's message of "Sun, 09 Nov 2014 21:00:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95806 > 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))