From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Occur multi-line matches Date: Tue, 30 Mar 2010 19:05:55 +0300 Organization: JURTA Message-ID: <8739zhdcbg.fsf@mail.jurta.org> References: <87fx3rmrie.fsf@mail.jurta.org> <87k4sxfsqk.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269965707 29614 80.91.229.12 (30 Mar 2010 16:15:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Mar 2010 16:15:07 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 30 18:15:03 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwe5n-0004gP-4g for ged-emacs-devel@m.gmane.org; Tue, 30 Mar 2010 18:15:03 +0200 Original-Received: from localhost ([127.0.0.1]:34901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwe5m-0001hR-I5 for ged-emacs-devel@m.gmane.org; Tue, 30 Mar 2010 12:15:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwdzM-0003Vg-Di for emacs-devel@gnu.org; Tue, 30 Mar 2010 12:08:24 -0400 Original-Received: from [140.186.70.92] (port=36256 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwdzK-0003Us-R1 for emacs-devel@gnu.org; Tue, 30 Mar 2010 12:08:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwdzJ-0008F8-3c for emacs-devel@gnu.org; Tue, 30 Mar 2010 12:08:22 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:40418 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwdzI-0008EZ-UX for emacs-devel@gnu.org; Tue, 30 Mar 2010 12:08:21 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.68.10.cable.starman.ee [82.131.68.10]) by mx2.starman.ee (Postfix) with ESMTP id 9FB373F407E for ; Tue, 30 Mar 2010 19:08:12 +0300 (EEST) In-Reply-To: <87k4sxfsqk.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 27 Mar 2010 21:51:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122918 Archived-At: If someone for some reason might want to keep the old behaviour, then a new option could be added. This patch gives a hint where to use such an option to restore the old behaviour: === modified file 'lisp/replace.el' --- lisp/replace.el 2010-03-28 23:16:36 +0000 +++ lisp/replace.el 2010-03-29 16:02:35 +0000 @@ -1379,7 +1379,7 @@ (defun occur-context-lines (out-line nli ;; Combine after-lines of the previous match ;; with before-lines of the current match. - (when prev-after-lines + (when nil ;; use some new option ;; Don't overlap prev after-lines with current before-lines. (if (>= (+ prev-lines (length prev-after-lines)) (- lines (length before-lines))) @@ -1390,7 +1390,7 @@ (defun occur-context-lines (out-line nli ;; Separate non-overlapping context lines with a dashed line. (setq separator "-------\n"))) - (when prev-lines + (when nil ;; use some new option ;; Don't overlap current before-lines with previous match line. (if (<= (- lines (length before-lines)) prev-lines) @@ -1408,7 +1408,7 @@ (defun occur-context-lines (out-line nli (append (and prev-after-lines (occur-engine-add-prefix prev-after-lines)) - (and separator (list separator)) + (and prev-after-lines (list "-------\n")) (occur-engine-add-prefix before-lines) (list out-line))) ;; And the second element is the list of context after-lines. -- Juri Linkov http://www.jurta.org/emacs/