summaryrefslogtreecommitdiff
path: root/lisp/progmodes/compile.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-10-02 03:33:18 +0000
committerRichard M. Stallman <rms@gnu.org>2005-10-02 03:33:18 +0000
commitae0cc840ad163760a644717236b03328a9c4650b (patch)
treec3b8ed40061102bbff2295c048a334a91a93ebb4 /lisp/progmodes/compile.el
parent56ab610b006ae0e586ee7750abc174c5ada74348 (diff)
downloademacs-ae0cc840ad163760a644717236b03328a9c4650b.tar.gz
(compilation-buffer-name): New arg MODE-COMMAND.
(compilation-start): Pass new arg to compilation-buffer-name. (compile-goto-error): Use next-error-internal.
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r--lisp/progmodes/compile.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 1655aa33dcb..632adb0ca07 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -899,19 +899,20 @@ visible rather than the beginning."
:group 'compilation)
-(defun compilation-buffer-name (mode-name name-function)
+(defun compilation-buffer-name (mode-name mode-command name-function)
"Return the name of a compilation buffer to use.
If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME
to determine the buffer name.
Likewise if `compilation-buffer-name-function' is non-nil.
-If current buffer is in Compilation mode for the same mode name
+If current buffer is the mode MODE-COMMAND,
return the name of the current buffer, so that it gets reused.
Otherwise, construct a buffer name from MODE-NAME."
(cond (name-function
(funcall name-function mode-name))
(compilation-buffer-name-function
(funcall compilation-buffer-name-function mode-name))
- ((eq major-mode (nth 1 compilation-arguments))
+ ((and (eq mode-command major-mode)
+ (eq major-mode (nth 1 compilation-arguments)))
(buffer-name))
(t
(concat "*" (downcase mode-name) "*"))))
@@ -960,7 +961,7 @@ Returns the compilation buffer created."
(with-current-buffer
(setq outbuf
(get-buffer-create
- (compilation-buffer-name name-of-mode name-function)))
+ (compilation-buffer-name name-of-mode mode name-function)))
(let ((comp-proc (get-buffer-process (current-buffer))))
(if comp-proc
(if (or (not (eq (process-status comp-proc) 'run))
@@ -1552,7 +1553,7 @@ Use this command in a compilation log buffer. Sets the mark at point there."
(dired-other-window (car (get-text-property (point) 'directory)))
(push-mark)
(setq compilation-current-error (point))
- (next-error 0)))
+ (next-error-internal))))
;; Return a compilation buffer.
;; If the current buffer is a compilation buffer, return it.