aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorColin Walters2002-04-25 21:12:09 +0000
committerColin Walters2002-04-25 21:12:09 +0000
commitac76acf7fb9bf893a25e6de8fc62f745ea3a0a8a (patch)
tree12da875574f1b9afaae2f694d0f513844a4a196d /lisp/replace.el
parentd2e064f1a987b5e46870c25c303198d994cfa167 (diff)
downloademacs-ac76acf7fb9bf893a25e6de8fc62f745ea3a0a8a.tar.gz
emacs-ac76acf7fb9bf893a25e6de8fc62f745ea3a0a8a.zip
(occur-engine): Make nlines argument actually mean number of context
lines. Handle it.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el8
1 files changed, 4 insertions, 4 deletions
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'."
779 curstring 779 curstring
780 "\n")) 780 "\n"))
781 (data 781 (data
782 (if (= nlines 1) 782 (if (= nlines 0)
783 ;; The simple display style 783 ;; The simple display style
784 out-line 784 out-line
785 ;; The complex multi-line display 785 ;; The complex multi-line display
@@ -787,14 +787,14 @@ See also `multi-occur'."
787 ;; concatenate them all together. 787 ;; concatenate them all together.
788 (apply #'concat 788 (apply #'concat
789 (nconc 789 (nconc
790 (add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines) t)))) 790 (add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ nlines)) t))))
791 (list out-line) 791 (list out-line)
792 (add-prefix (cdr (occur-accumulate-lines nlines t)))))))) 792 (add-prefix (cdr (occur-accumulate-lines (1+ nlines) t))))))))
793 ;; Actually insert the match display data 793 ;; Actually insert the match display data
794 (with-current-buffer out-buf 794 (with-current-buffer out-buf
795 (let ((beg (point)) 795 (let ((beg (point))
796 (end (insert-get-point data))) 796 (end (insert-get-point data)))
797 (unless (= nlines 1) 797 (unless (= nlines 0)
798 (insert-get-point "-------\n")) 798 (insert-get-point "-------\n"))
799 (add-text-properties 799 (add-text-properties
800 beg (1- end) 800 beg (1- end)