emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Occur multi-line matches


From: Juri Linkov
Subject: Re: Occur multi-line matches
Date: Tue, 30 Mar 2010 19:05:55 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]