diff options
| author | Richard M. Stallman | 2007-08-02 17:40:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-08-02 17:40:54 +0000 |
| commit | 7d1dad0cbd3123f5eaf6088ec0a91335ac44f60c (patch) | |
| tree | 002ab74779af46143cd0da86d6d1c3b0ef49917d | |
| parent | 51f6595da78d04b49bd6602d60dbe65ad367ffa3 (diff) | |
| download | emacs-7d1dad0cbd3123f5eaf6088ec0a91335ac44f60c.tar.gz emacs-7d1dad0cbd3123f5eaf6088ec0a91335ac44f60c.zip | |
(compilation-find-buffer): Return current buffer immediately if suitable.
(compile, compilation-buffer-name, compilation-start): Doc fixes.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 31 |
2 files changed, 28 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66f1618be60..cdb89b36942 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-08-02 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/compile.el (compilation-find-buffer): Return current | ||
| 4 | buffer immediately if suitable. | ||
| 5 | (compile, compilation-buffer-name, compilation-start): Doc fixes. | ||
| 6 | |||
| 1 | 2007-08-02 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2007-08-02 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * vc-bzr.el (vc-bzr-admin-dirstate): Rename from `...-dirname'. | 9 | * vc-bzr.el (vc-bzr-admin-dirstate): Rename from `...-dirname'. |
| @@ -10,7 +16,7 @@ | |||
| 10 | 16 | ||
| 11 | * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. | 17 | * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. |
| 12 | 18 | ||
| 13 | 2007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change) | 19 | 2007-07-31 Drew Adams <drew.adams@oracle.com> |
| 14 | 20 | ||
| 15 | * cus-edit.el (custom-group-value-create, custom-goto-parent): | 21 | * cus-edit.el (custom-group-value-create, custom-goto-parent): |
| 16 | Fix parent groups link. | 22 | Fix parent groups link. |
| @@ -12319,7 +12325,7 @@ | |||
| 12319 | (name, size, mode) <define-ibuffer-column>: Add a header-mouse-map | 12325 | (name, size, mode) <define-ibuffer-column>: Add a header-mouse-map |
| 12320 | property. | 12326 | property. |
| 12321 | 12327 | ||
| 12322 | 2006-04-02 Drew Adams <drew.adams@oracle.com> (tiny change) | 12328 | 2006-04-02 Drew Adams <drew.adams@oracle.com> |
| 12323 | 12329 | ||
| 12324 | * speedbar.el (speedbar-after-create-hook): Doc fix. | 12330 | * speedbar.el (speedbar-after-create-hook): Doc fix. |
| 12325 | 12331 | ||
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 13e4e40044b..529194ffa7e 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -888,11 +888,13 @@ non-nil; otherwise uses `compile-command'. With prefix arg, always prompts. | |||
| 888 | Additionally, with universal prefix arg, compilation buffer will be in | 888 | Additionally, with universal prefix arg, compilation buffer will be in |
| 889 | comint mode, i.e. interactive. | 889 | comint mode, i.e. interactive. |
| 890 | 890 | ||
| 891 | To run more than one compilation at once, start one and rename | 891 | To run more than one compilation at once, start one then rename |
| 892 | the \`*compilation*' buffer to some other name with | 892 | the \`*compilation*' buffer to some other name with |
| 893 | \\[rename-buffer]. Then start the next one. On most systems, | 893 | \\[rename-buffer]. Then _switch buffers_ and start the new compilation. |
| 894 | termination of the main compilation process kills its | 894 | It will create a new \`*compilation*' buffer. |
| 895 | subprocesses. | 895 | |
| 896 | On most systems, termination of the main compilation process | ||
| 897 | kills its subprocesses. | ||
| 896 | 898 | ||
| 897 | The name used for the buffer is actually whatever is returned by | 899 | The name used for the buffer is actually whatever is returned by |
| 898 | the function in `compilation-buffer-name-function', so you can set that | 900 | the function in `compilation-buffer-name-function', so you can set that |
| @@ -944,7 +946,7 @@ visible rather than the beginning." | |||
| 944 | If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME | 946 | If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME |
| 945 | to determine the buffer name. | 947 | to determine the buffer name. |
| 946 | Likewise if `compilation-buffer-name-function' is non-nil. | 948 | Likewise if `compilation-buffer-name-function' is non-nil. |
| 947 | If current buffer is the mode MODE-COMMAND, | 949 | If current buffer has the major mode MODE-COMMAND, |
| 948 | return the name of the current buffer, so that it gets reused. | 950 | return the name of the current buffer, so that it gets reused. |
| 949 | Otherwise, construct a buffer name from MODE-NAME." | 951 | Otherwise, construct a buffer name from MODE-NAME." |
| 950 | (cond (name-function | 952 | (cond (name-function |
| @@ -983,8 +985,11 @@ The rest of the arguments are optional; for them, nil means use the default. | |||
| 983 | 985 | ||
| 984 | MODE is the major mode to set in the compilation buffer. Mode | 986 | MODE is the major mode to set in the compilation buffer. Mode |
| 985 | may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'. | 987 | may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'. |
| 988 | |||
| 986 | If NAME-FUNCTION is non-nil, call it with one argument (the mode name) | 989 | If NAME-FUNCTION is non-nil, call it with one argument (the mode name) |
| 987 | to determine the buffer name. | 990 | to determine the buffer name. Otherwise, the default is to |
| 991 | reuses the current buffer if it has the proper major mode, | ||
| 992 | else use or create a buffer with name based on the major mode. | ||
| 988 | 993 | ||
| 989 | If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight | 994 | If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight |
| 990 | the matching section of the visited source line; the default is to use the | 995 | the matching section of the visited source line; the default is to use the |
| @@ -1604,12 +1609,16 @@ Use this command in a compilation log buffer. Sets the mark at point there." | |||
| 1604 | (setq compilation-current-error (point)) | 1609 | (setq compilation-current-error (point)) |
| 1605 | (next-error-internal))) | 1610 | (next-error-internal))) |
| 1606 | 1611 | ||
| 1607 | ;; Return a compilation buffer. | ||
| 1608 | ;; If the current buffer is a compilation buffer, return it. | ||
| 1609 | ;; Otherwise, look for a compilation buffer and signal an error | ||
| 1610 | ;; if there are none. | ||
| 1611 | (defun compilation-find-buffer (&optional avoid-current) | 1612 | (defun compilation-find-buffer (&optional avoid-current) |
| 1612 | (next-error-find-buffer avoid-current 'compilation-buffer-internal-p)) | 1613 | "Return a compilation buffer. |
| 1614 | If AVOID-CURRENT is nil, and | ||
| 1615 | the current buffer is a compilation buffer, return it. | ||
| 1616 | If AVOID-CURRENT is non-nil, return the current buffer | ||
| 1617 | only as a last resort." | ||
| 1618 | (if (and (compilation-buffer-internal-p (current-buffer)) | ||
| 1619 | (not avoid-current)) | ||
| 1620 | (current-buffer) | ||
| 1621 | (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) | ||
| 1613 | 1622 | ||
| 1614 | ;;;###autoload | 1623 | ;;;###autoload |
| 1615 | (defun compilation-next-error-function (n &optional reset) | 1624 | (defun compilation-next-error-function (n &optional reset) |