comparison lisp/progmodes/compile.el @ 91005:424b655804ca

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 846-851) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 88-92) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 242-244) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-246
author Miles Bader <miles@gnu.org>
date Mon, 13 Aug 2007 13:48:35 +0000
parents cd5e99697764 e5a68f18fcb9
children aaccdab0ee26
comparison
equal deleted inserted replaced
91004:f72cf5b2ab11 91005:424b655804ca
168 \\( warning\\)?" 1 2 3 (4)) 168 \\( warning\\)?" 1 2 3 (4))
169 169
170 (maven 170 (maven
171 ;; Maven is a popular build tool for Java. Maven is Free Software. 171 ;; Maven is a popular build tool for Java. Maven is Free Software.
172 "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) 172 "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3)
173 173
174 (bash 174 (bash
175 "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) 175 "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
176 176
177 (borland 177 (borland
178 "^\\(?:Error\\|Warnin\\(g\\)\\) \\(?:[FEW][0-9]+ \\)?\ 178 "^\\(?:Error\\|Warnin\\(g\\)\\) \\(?:[FEW][0-9]+ \\)?\
977 Otherwise, construct a buffer name from MODE-NAME." 977 Otherwise, construct a buffer name from MODE-NAME."
978 (cond (name-function 978 (cond (name-function
979 (funcall name-function mode-name)) 979 (funcall name-function mode-name))
980 (compilation-buffer-name-function 980 (compilation-buffer-name-function
981 (funcall compilation-buffer-name-function mode-name)) 981 (funcall compilation-buffer-name-function mode-name))
982 ((and (eq mode-command major-mode) 982 ((eq mode-command major-mode)
983 (eq major-mode (nth 1 compilation-arguments)))
984 (buffer-name)) 983 (buffer-name))
985 (t 984 (t
986 (concat "*" (downcase mode-name) "*")))) 985 (concat "*" (downcase mode-name) "*"))))
987 986
988 ;; This is a rough emulation of the old hack, until the transition to new 987 ;; This is a rough emulation of the old hack, until the transition to new
1030 (thisdir default-directory) 1029 (thisdir default-directory)
1031 outwin outbuf) 1030 outwin outbuf)
1032 (with-current-buffer 1031 (with-current-buffer
1033 (setq outbuf 1032 (setq outbuf
1034 (get-buffer-create 1033 (get-buffer-create
1035 (compilation-buffer-name name-of-mode mode name-function))) 1034 (compilation-buffer-name name-of-mode mode name-function)))
1036 (let ((comp-proc (get-buffer-process (current-buffer)))) 1035 (let ((comp-proc (get-buffer-process (current-buffer))))
1037 (if comp-proc 1036 (if comp-proc
1038 (if (or (not (eq (process-status comp-proc) 'run)) 1037 (if (or (not (eq (process-status comp-proc) 'run))
1039 (yes-or-no-p 1038 (yes-or-no-p
1040 (format "A %s process is running; kill it? " 1039 (format "A %s process is running; kill it? "
1134 (comint-exec 1133 (comint-exec
1135 outbuf (downcase mode-name) 1134 outbuf (downcase mode-name)
1136 (if (file-remote-p default-directory) 1135 (if (file-remote-p default-directory)
1137 "/bin/sh" 1136 "/bin/sh"
1138 shell-file-name) 1137 shell-file-name)
1139 `("-c" ,command)))) 1138 nil `("-c" ,command))))
1140 (start-file-process-shell-command (downcase mode-name) 1139 (start-file-process-shell-command (downcase mode-name)
1141 outbuf command)))) 1140 outbuf command))))
1142 ;; Make the buffer's mode line show process state. 1141 ;; Make the buffer's mode line show process state.
1143 (setq mode-line-process '(":%s")) 1142 (setq mode-line-process '(":%s"))
1144 (set-process-sentinel proc 'compilation-sentinel) 1143 (set-process-sentinel proc 'compilation-sentinel)
1162 1161
1163 (defun compilation-set-window-height (window) 1162 (defun compilation-set-window-height (window)
1164 "Set the height of WINDOW according to `compilation-window-height'." 1163 "Set the height of WINDOW according to `compilation-window-height'."
1165 (let ((height (buffer-local-value 'compilation-window-height (window-buffer window)))) 1164 (let ((height (buffer-local-value 'compilation-window-height (window-buffer window))))
1166 (and height 1165 (and height
1167 (= (window-width window) (frame-width (window-frame window))) 1166 (window-full-width-p window)
1168 ;; If window is alone in its frame, aside from a minibuffer, 1167 ;; If window is alone in its frame, aside from a minibuffer,
1169 ;; don't change its height. 1168 ;; don't change its height.
1170 (not (eq window (frame-root-window (window-frame window)))) 1169 (not (eq window (frame-root-window (window-frame window))))
1171 ;; Stef said that doing the saves in this order is safer: 1170 ;; Stef said that doing the saves in this order is safer:
1172 (save-excursion 1171 (save-excursion
1622 (setq compilation-current-error (point)) 1621 (setq compilation-current-error (point))
1623 (next-error-internal))) 1622 (next-error-internal)))
1624 1623
1625 (defun compilation-find-buffer (&optional avoid-current) 1624 (defun compilation-find-buffer (&optional avoid-current)
1626 "Return a compilation buffer. 1625 "Return a compilation buffer.
1627 If AVOID-CURRENT is nil, and 1626 If AVOID-CURRENT is nil, and the current buffer is a compilation buffer,
1628 the current buffer is a compilation buffer, return it. 1627 return it. If AVOID-CURRENT is non-nil, return the current buffer only
1629 If AVOID-CURRENT is non-nil, return the current buffer 1628 as a last resort."
1630 only as a last resort." 1629 (if (and (compilation-buffer-internal-p) (not avoid-current))
1631 (if (and (compilation-buffer-internal-p (current-buffer))
1632 (not avoid-current))
1633 (current-buffer) 1630 (current-buffer)
1634 (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) 1631 (next-error-find-buffer avoid-current 'compilation-buffer-internal-p)))
1635 1632
1636 ;;;###autoload 1633 ;;;###autoload
1637 (defun compilation-next-error-function (n &optional reset) 1634 (defun compilation-next-error-function (n &optional reset)