579 |
:type 'face |
:type 'face |
580 |
:group 'matching) |
:group 'matching) |
581 |
|
|
582 |
(defun occur-accumulate-lines (count) |
(defun occur-accumulate-lines (count &optional no-props) |
583 |
(save-excursion |
(save-excursion |
584 |
(let ((forwardp (> count 0)) |
(let ((forwardp (> count 0)) |
585 |
(result nil)) |
(result nil)) |
591 |
(decf count) |
(decf count) |
592 |
(incf count)) |
(incf count)) |
593 |
(push |
(push |
594 |
(buffer-substring |
(funcall (if no-props |
595 |
|
#'buffer-substring-no-properties |
596 |
|
#'buffer-substring) |
597 |
(line-beginning-position) |
(line-beginning-position) |
598 |
(line-end-position)) |
(line-end-position)) |
599 |
result) |
result) |
788 |
;; concatenate them all together. |
;; concatenate them all together. |
789 |
(apply #'concat |
(apply #'concat |
790 |
(nconc |
(nconc |
791 |
(add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines))))) |
(add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines) t)))) |
792 |
(list out-line) |
(list out-line) |
793 |
(add-prefix (cdr (occur-accumulate-lines nlines)))))))) |
(add-prefix (cdr (occur-accumulate-lines nlines t)))))))) |
794 |
;; Actually insert the match display data |
;; Actually insert the match display data |
795 |
(with-current-buffer out-buf |
(with-current-buffer out-buf |
796 |
(let ((beg (point)) |
(let ((beg (point)) |