changeset 44832:d60f225edddc

(occur-accumulate-lines): Add optional argument `no-props'. Handle it. (occur-engine): Use it.
author Colin Walters <walters@gnu.org>
date Wed, 24 Apr 2002 23:28:45 +0000
parents 56a3e3132102
children 71ada764104b
files lisp/replace.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/replace.el	Wed Apr 24 23:27:43 2002 +0000
+++ b/lisp/replace.el	Wed Apr 24 23:28:45 2002 +0000
@@ -579,7 +579,7 @@
   :type 'face
   :group 'matching)
 
-(defun occur-accumulate-lines (count)
+(defun occur-accumulate-lines (count &optional no-props)
   (save-excursion
     (let ((forwardp (> count 0))
 	  (result nil))
@@ -591,7 +591,9 @@
 	    (decf count)
 	  (incf count))
 	(push
-	 (buffer-substring
+	 (funcall (if no-props
+		      #'buffer-substring-no-properties
+		    #'buffer-substring)
 	  (line-beginning-position)
 	  (line-end-position))
 	 result)
@@ -786,9 +788,9 @@
 				 ;; concatenate them all together.
 				 (apply #'concat
 					(nconc
-					 (add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines)))))
+					 (add-prefix (nreverse (cdr (occur-accumulate-lines (- nlines) t))))
 					 (list out-line)
-					 (add-prefix (cdr (occur-accumulate-lines nlines))))))))
+					 (add-prefix (cdr (occur-accumulate-lines nlines t))))))))
 			  ;; Actually insert the match display data
 			  (with-current-buffer out-buf
 			    (let ((beg (point))