diff options
| author | Richard M. Stallman | 1995-09-24 23:25:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-09-24 23:25:06 +0000 |
| commit | 91c6bdc0d1a2dbaf5ca6a8dfac8ce86934fb52df (patch) | |
| tree | 9b97da24fd23012c99085e4f836f0f2ad16a45ef /lisp/replace.el | |
| parent | a3d6bb976dc4459d5f305758ecc5ebdb861e9e2d (diff) | |
| download | emacs-91c6bdc0d1a2dbaf5ca6a8dfac8ce86934fb52df.tar.gz emacs-91c6bdc0d1a2dbaf5ca6a8dfac8ce86934fb52df.zip | |
(occur): Indent better for matches that contain newlines.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 9638fab2df7..219fab01162 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -400,6 +400,8 @@ It serves as a menu to find any of the occurrences in this buffer. | |||
| 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) |
| @@ -407,8 +409,6 @@ It serves as a menu to find any of the occurrences in this buffer. | |||
| 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))) |
| @@ -420,13 +420,18 @@ It serves as a menu to find any of the occurrences in this buffer. | |||
| 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. |