comparison lisp/replace.el @ 44860:72ec4ee68d47

(occur-engine): Make nlines argument actually mean number of context lines. Handle it.
author Colin Walters <walters@gnu.org>
date Thu, 25 Apr 2002 21:12:09 +0000
parents ca887baefc80
children 590c97430876
comparison
equal deleted inserted replaced
44859:3eea5fbe1501 44860:72ec4ee68d47
777 `(face prefix-face)) 777 `(face prefix-face))
778 '(occur-prefix t))) 778 '(occur-prefix t)))
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
786 ;; style. Generate a list of lines, 786 ;; style. Generate a list of lines,
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)
801 `(occur-target ,(cons buf marker) 801 `(occur-target ,(cons buf marker)
802 mouse-face highlight help-echo 802 mouse-face highlight help-echo