diff options
| author | Karl Heuer | 1994-04-02 05:07:50 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-04-02 05:07:50 +0000 |
| commit | e78e10caf2126abf1860342d56de5b251e8ea8c2 (patch) | |
| tree | 87920df06b75707bd7cf04714881510dc7a559b7 | |
| parent | 823316aaf204e9fc93cb8033dd37dee261543a0e (diff) | |
| download | emacs-e78e10caf2126abf1860342d56de5b251e8ea8c2.tar.gz emacs-e78e10caf2126abf1860342d56de5b251e8ea8c2.zip | |
(compile-mouse-goto-error): Simplify.
(compilation-parse-errors-function): Doc fix.
| -rw-r--r-- | lisp/progmodes/compile.el | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 4ddc2bd5742..618e68d55f0 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -61,7 +61,7 @@ it at all.") | |||
| 61 | It takes args LIMIT-SEARCH and FIND-AT-LEAST. | 61 | It takes args LIMIT-SEARCH and FIND-AT-LEAST. |
| 62 | If LIMIT-SEARCH is non-nil, don't bother parsing past that location. | 62 | If LIMIT-SEARCH is non-nil, don't bother parsing past that location. |
| 63 | If FIND-AT-LEAST is non-nil, don't bother parsing after finding that | 63 | If FIND-AT-LEAST is non-nil, don't bother parsing after finding that |
| 64 | many new erros. | 64 | many new errors. |
| 65 | It should read in the source files which have errors and set | 65 | It should read in the source files which have errors and set |
| 66 | `compilation-error-list' to a list with an element for each error message | 66 | `compilation-error-list' to a list with an element for each error message |
| 67 | found. See that variable for more info.") | 67 | found. See that variable for more info.") |
| @@ -684,39 +684,38 @@ Does NOT find the source line like \\[next-error]." | |||
| 684 | 684 | ||
| 685 | (defun compile-mouse-goto-error (event) | 685 | (defun compile-mouse-goto-error (event) |
| 686 | (interactive "e") | 686 | (interactive "e") |
| 687 | (let (file) | 687 | (save-excursion |
| 688 | (save-excursion | 688 | (set-buffer (window-buffer (posn-window (event-end event)))) |
| 689 | (set-buffer (window-buffer (posn-window (event-end event)))) | 689 | (goto-char (posn-point (event-end event))) |
| 690 | (save-excursion | 690 | |
| 691 | (goto-char (posn-point (event-end event))) | 691 | (or (compilation-buffer-p (current-buffer)) |
| 692 | (or (compilation-buffer-p (current-buffer)) | 692 | (error "Not in a compilation buffer.")) |
| 693 | (error "Not in a compilation buffer.")) | 693 | (setq compilation-last-buffer (current-buffer)) |
| 694 | (setq compilation-last-buffer (current-buffer)) | 694 | (compile-reinitialize-errors nil (point)) |
| 695 | (compile-reinitialize-errors nil (point)) | ||
| 696 | |||
| 697 | ;; Move to bol; the marker for the error on this line will point there. | ||
| 698 | (beginning-of-line) | ||
| 699 | |||
| 700 | ;; Move compilation-error-list to the elt of compilation-old-error-list | ||
| 701 | ;; we want. | ||
| 702 | (setq compilation-error-list compilation-old-error-list) | ||
| 703 | (while (and compilation-error-list | ||
| 704 | (> (point) (car (car compilation-error-list)))) | ||
| 705 | (setq compilation-error-list (cdr compilation-error-list))) | ||
| 706 | (or compilation-error-list | ||
| 707 | (error "No error to go to")))) | ||
| 708 | (select-window (posn-window (event-end event))) | ||
| 709 | ;; Move to another window, so that next-error's window changes | ||
| 710 | ;; result in the desired setup. | ||
| 711 | (or (one-window-p) | ||
| 712 | (progn | ||
| 713 | (other-window -1) | ||
| 714 | ;; other-window changed the selected buffer, | ||
| 715 | ;; but we didn't want to do that. | ||
| 716 | (set-buffer compilation-last-buffer))) | ||
| 717 | 695 | ||
| 718 | (push-mark) | 696 | ;; Move to bol; the marker for the error on this line will point there. |
| 719 | (next-error 1))) | 697 | (beginning-of-line) |
| 698 | |||
| 699 | ;; Move compilation-error-list to the elt of compilation-old-error-list | ||
| 700 | ;; we want. | ||
| 701 | (setq compilation-error-list compilation-old-error-list) | ||
| 702 | (while (and compilation-error-list | ||
| 703 | (> (point) (car (car compilation-error-list)))) | ||
| 704 | (setq compilation-error-list (cdr compilation-error-list))) | ||
| 705 | (or compilation-error-list | ||
| 706 | (error "No error to go to"))) | ||
| 707 | (select-window (posn-window (event-end event))) | ||
| 708 | ;; Move to another window, so that next-error's window changes | ||
| 709 | ;; result in the desired setup. | ||
| 710 | (or (one-window-p) | ||
| 711 | (progn | ||
| 712 | (other-window -1) | ||
| 713 | ;; other-window changed the selected buffer, | ||
| 714 | ;; but we didn't want to do that. | ||
| 715 | (set-buffer compilation-last-buffer))) | ||
| 716 | |||
| 717 | (push-mark) | ||
| 718 | (next-error 1)) | ||
| 720 | 719 | ||
| 721 | (defun compile-goto-error (&optional argp) | 720 | (defun compile-goto-error (&optional argp) |
| 722 | "Visit the source for the error message point is on. | 721 | "Visit the source for the error message point is on. |