comparison lisp/replace.el @ 13069:8197923b82ae

(occur): Indent better for matches that contain newlines.
author Richard M. Stallman <rms@gnu.org>
date Sun, 24 Sep 1995 23:25:06 +0000
parents 6be53feb3323
children 83f275dcd93a
comparison
equal deleted inserted replaced
13068:9cc4392719e3 13069:8197923b82ae
398 (setq occur-pos-list (cons tem occur-pos-list)) 398 (setq occur-pos-list (cons tem occur-pos-list))
399 (or first (zerop nlines) 399 (or first (zerop nlines)
400 (insert "--------\n")) 400 (insert "--------\n"))
401 (setq first nil) 401 (setq first nil)
402 (insert-buffer-substring buffer start end) 402 (insert-buffer-substring buffer start end)
403 (set-marker final-context-start
404 (- (point) (- end (match-end 0))))
403 (backward-char (- end start)) 405 (backward-char (- end start))
404 (setq tem nlines) 406 (setq tem nlines)
405 (while (> tem 0) 407 (while (> tem 0)
406 (insert empty ?:) 408 (insert empty ?:)
407 (forward-line 1) 409 (forward-line 1)
408 (setq tem (1- tem))) 410 (setq tem (1- tem)))
409 (let ((this-linenum linenum)) 411 (let ((this-linenum linenum))
410 (set-marker final-context-start
411 (+ (point) (- (match-end 0) (match-beginning 0))))
412 (while (< (point) final-context-start) 412 (while (< (point) final-context-start)
413 (if (null tag) 413 (if (null tag)
414 (setq tag (format "%5d" this-linenum))) 414 (setq tag (format "%5d" this-linenum)))
415 (insert tag ?:) 415 (insert tag ?:)
416 (put-text-property (save-excursion 416 (put-text-property (save-excursion
418 (point)) 418 (point))
419 (save-excursion 419 (save-excursion
420 (end-of-line) 420 (end-of-line)
421 (point)) 421 (point))
422 'mouse-face 'highlight) 422 'mouse-face 'highlight)
423 (forward-line 1)
423 (setq tag nil) 424 (setq tag nil)
425 (setq this-linenum (1+ this-linenum)))
426 (while (<= (point) final-context-start)
427 (insert empty ?:)
424 (forward-line 1) 428 (forward-line 1)
425 (setq this-linenum (1+ this-linenum)))) 429 (setq this-linenum (1+ this-linenum))))
426 (while (< tem nlines) 430 (while (< tem nlines)
427 (insert empty ?:) 431 (insert empty ?:)
428 (forward-line 1) 432 (forward-line 1)
429 (setq tem (1+ tem)))) 433 (setq tem (1+ tem)))
434 (goto-char (point-max)))
430 (forward-line 1))) 435 (forward-line 1)))
431 (set-buffer standard-output) 436 (set-buffer standard-output)
432 ;; Put positions in increasing order to go with buffer. 437 ;; Put positions in increasing order to go with buffer.
433 (setq occur-pos-list (nreverse occur-pos-list)) 438 (setq occur-pos-list (nreverse occur-pos-list))
434 (goto-char (point-min)) 439 (goto-char (point-min))