summaryrefslogtreecommitdiff
path: root/lisp/progmodes/compile.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-08-03 05:58:06 +0000
committerMiles Bader <miles@gnu.org>2007-08-03 05:58:06 +0000
commit2ca773ca40d2c1896757e6382aefff6d9de1c5cc (patch)
tree846419ece5e5d8bc8f11e9786598678af9c78f00 /lisp/progmodes/compile.el
parent49b23c2a404cf31fb1aeecc7932a7304aaf16a67 (diff)
parent0896d93184a719bc994a3e699de27190aac0acb1 (diff)
downloademacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.tar.gz
emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.tar.bz2
emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 843-845) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 84-87) - Update from CVS - Change capitalization of VC backend names for new backends Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-30
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r--lisp/progmodes/compile.el31
1 files changed, 20 insertions, 11 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 2710066c2cd..caf0e94b927 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -917,11 +917,13 @@ non-nil; otherwise uses `compile-command'. With prefix arg, always prompts.
Additionally, with universal prefix arg, compilation buffer will be in
comint mode, i.e. interactive.
-To run more than one compilation at once, start one and rename
+To run more than one compilation at once, start one then rename
the \`*compilation*' buffer to some other name with
-\\[rename-buffer]. Then start the next one. On most systems,
-termination of the main compilation process kills its
-subprocesses.
+\\[rename-buffer]. Then _switch buffers_ and start the new compilation.
+It will create a new \`*compilation*' buffer.
+
+On most systems, termination of the main compilation process
+kills its subprocesses.
The name used for the buffer is actually whatever is returned by
the function in `compilation-buffer-name-function', so you can set that
@@ -970,7 +972,7 @@ visible rather than the beginning."
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 the mode MODE-COMMAND,
+If current buffer has the major 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
@@ -1009,8 +1011,11 @@ The rest of the arguments are optional; for them, nil means use the default.
MODE is the major mode to set in the compilation buffer. Mode
may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'.
+
If NAME-FUNCTION is non-nil, call it with one argument (the mode name)
-to determine the buffer name.
+to determine the buffer name. Otherwise, the default is to
+reuses the current buffer if it has the proper major mode,
+else use or create a buffer with name based on the major mode.
If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight
the matching section of the visited source line; the default is to use the
@@ -1617,12 +1622,16 @@ Use this command in a compilation log buffer. Sets the mark at point there."
(setq compilation-current-error (point))
(next-error-internal)))
-;; Return a compilation buffer.
-;; If the current buffer is a compilation buffer, return it.
-;; Otherwise, look for a compilation buffer and signal an error
-;; if there are none.
(defun compilation-find-buffer (&optional avoid-current)
- (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))
+ "Return a compilation buffer.
+If AVOID-CURRENT is nil, and
+the current buffer is a compilation buffer, return it.
+If AVOID-CURRENT is non-nil, return the current buffer
+only as a last resort."
+ (if (and (compilation-buffer-internal-p (current-buffer))
+ (not avoid-current))
+ (current-buffer)
+ (next-error-find-buffer avoid-current 'compilation-buffer-internal-p)))
;;;###autoload
(defun compilation-next-error-function (n &optional reset)