899 |
:group 'compilation) |
:group 'compilation) |
900 |
|
|
901 |
|
|
902 |
(defun compilation-buffer-name (mode-name name-function) |
(defun compilation-buffer-name (mode-name mode-command name-function) |
903 |
"Return the name of a compilation buffer to use. |
"Return the name of a compilation buffer to use. |
904 |
If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME |
If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME |
905 |
to determine the buffer name. |
to determine the buffer name. |
906 |
Likewise if `compilation-buffer-name-function' is non-nil. |
Likewise if `compilation-buffer-name-function' is non-nil. |
907 |
If current buffer is in Compilation mode for the same mode name |
If current buffer is the mode MODE-COMMAND, |
908 |
return the name of the current buffer, so that it gets reused. |
return the name of the current buffer, so that it gets reused. |
909 |
Otherwise, construct a buffer name from MODE-NAME." |
Otherwise, construct a buffer name from MODE-NAME." |
910 |
(cond (name-function |
(cond (name-function |
911 |
(funcall name-function mode-name)) |
(funcall name-function mode-name)) |
912 |
(compilation-buffer-name-function |
(compilation-buffer-name-function |
913 |
(funcall compilation-buffer-name-function mode-name)) |
(funcall compilation-buffer-name-function mode-name)) |
914 |
((eq major-mode (nth 1 compilation-arguments)) |
((and (eq mode-command major-mode) |
915 |
|
(eq major-mode (nth 1 compilation-arguments))) |
916 |
(buffer-name)) |
(buffer-name)) |
917 |
(t |
(t |
918 |
(concat "*" (downcase mode-name) "*")))) |
(concat "*" (downcase mode-name) "*")))) |
961 |
(with-current-buffer |
(with-current-buffer |
962 |
(setq outbuf |
(setq outbuf |
963 |
(get-buffer-create |
(get-buffer-create |
964 |
(compilation-buffer-name name-of-mode name-function))) |
(compilation-buffer-name name-of-mode mode name-function))) |
965 |
(let ((comp-proc (get-buffer-process (current-buffer)))) |
(let ((comp-proc (get-buffer-process (current-buffer)))) |
966 |
(if comp-proc |
(if comp-proc |
967 |
(if (or (not (eq (process-status comp-proc) 'run)) |
(if (or (not (eq (process-status comp-proc) 'run)) |
1553 |
(dired-other-window (car (get-text-property (point) 'directory))) |
(dired-other-window (car (get-text-property (point) 'directory))) |
1554 |
(push-mark) |
(push-mark) |
1555 |
(setq compilation-current-error (point)) |
(setq compilation-current-error (point)) |
1556 |
(next-error 0))) |
(next-error-internal)))) |
1557 |
|
|
1558 |
;; Return a compilation buffer. |
;; Return a compilation buffer. |
1559 |
;; If the current buffer is a compilation buffer, return it. |
;; If the current buffer is a compilation buffer, return it. |