# HG changeset patch # User Richard M. Stallman # Date 811985106 0 # Node ID 8197923b82ae5d18245cfd26d0dfb35baa5d1171 # Parent 9cc4392719e3c49b225357081784f1d3c8e585f4 (occur): Indent better for matches that contain newlines. diff -r 9cc4392719e3 -r 8197923b82ae lisp/replace.el --- a/lisp/replace.el Sun Sep 24 23:20:39 1995 +0000 +++ b/lisp/replace.el Sun Sep 24 23:25:06 1995 +0000 @@ -400,6 +400,8 @@ (insert "--------\n")) (setq first nil) (insert-buffer-substring buffer start end) + (set-marker final-context-start + (- (point) (- end (match-end 0)))) (backward-char (- end start)) (setq tem nlines) (while (> tem 0) @@ -407,8 +409,6 @@ (forward-line 1) (setq tem (1- tem))) (let ((this-linenum linenum)) - (set-marker final-context-start - (+ (point) (- (match-end 0) (match-beginning 0)))) (while (< (point) final-context-start) (if (null tag) (setq tag (format "%5d" this-linenum))) @@ -420,13 +420,18 @@ (end-of-line) (point)) 'mouse-face 'highlight) + (forward-line 1) (setq tag nil) + (setq this-linenum (1+ this-linenum))) + (while (<= (point) final-context-start) + (insert empty ?:) (forward-line 1) (setq this-linenum (1+ this-linenum)))) (while (< tem nlines) (insert empty ?:) (forward-line 1) - (setq tem (1+ tem)))) + (setq tem (1+ tem))) + (goto-char (point-max))) (forward-line 1))) (set-buffer standard-output) ;; Put positions in increasing order to go with buffer.