From: Colin Walters Date: Thu, 25 Apr 2002 21:12:09 +0000 (+0000) Subject: (occur-engine): Make nlines argument actually mean number of context X-Git-Tag: ttn-vms-21-2-B4~15398 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ac76acf7fb9bf893a25e6de8fc62f745ea3a0a8a;p=emacs.git (occur-engine): Make nlines argument actually mean number of context lines. Handle it. --- diff --git a/lisp/replace.el b/lisp/replace.el index 1288a4591f5..eb33ab87137 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -779,7 +779,7 @@ See also `multi-occur'." curstring "\n")) (data - (if (= nlines 1) + (if (= nlines 0) ;; The simple display style out-line ;; The complex multi-line display @@ -787,14 +787,14 @@ See also `multi-occur'." ;; concatenate them all together. (apply #'concat (nconc - (add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines) t)))) + (add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ nlines)) t)))) (list out-line) - (add-prefix (cdr (occur-accumulate-lines nlines t)))))))) + (add-prefix (cdr (occur-accumulate-lines (1+ nlines) t)))))))) ;; Actually insert the match display data (with-current-buffer out-buf (let ((beg (point)) (end (insert-get-point data))) - (unless (= nlines 1) + (unless (= nlines 0) (insert-get-point "-------\n")) (add-text-properties beg (1- end)