diff options
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 48b5ee99736..1fb6124ab56 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -173,6 +173,7 @@ and a string describing how the process finished.") ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit (defvar compilation-error-regexp-alist-alist + (eval-when-compile `((absoft "^\\(?:[Ee]rror on \\|[Ww]arning on\\( \\)\\)?[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) @@ -615,7 +616,7 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?" ;; we do not know what lines will follow. (guile-file "^In \\(.+\\..+\\):\n" 1 nil nil 0) (guile-line "^ *\\([0-9]+\\): *\\([0-9]+\\)" nil 1 2) - ) + )) "Alist of values for `compilation-error-regexp-alist'.") (defcustom compilation-error-regexp-alist @@ -1248,11 +1249,14 @@ POS and RES.") (setq col (match-string-no-properties col)) (string-to-number col)))) (setq end-col - (or (if (functionp end-col) (funcall end-col) - (and end-col - (setq end-col (match-string-no-properties end-col)) - (- (string-to-number end-col) -1))) - (and end-line -1))) + (let ((ec (if (functionp end-col) + (funcall end-col) + (and end-col (match-beginning end-col) + (string-to-number + (match-string-no-properties end-col)))))) + (if ec + (1+ ec) ; Add one to get an exclusive upper bound. + (and end-line -1)))) (if (consp type) ; not a static type, check what it is. (setq type (or (and (car type) (match-end (car type)) 1) (and (cdr type) (match-end (cdr type)) 0) @@ -1540,7 +1544,7 @@ to `compilation-error-regexp-alist' if RULES is nil." file line end-line col end-col (or type 2) fmt rule)) - (when (integerp file) + (when file (let ((this-type (if (consp type) (compilation-type type) (or type 2)))) @@ -2844,8 +2848,9 @@ and overlay is highlighted between MK and END-MK." (when (and (not pre-existing) w) (compilation-set-window-height w)) - (if from-compilation-buffer - ;; If the compilation buffer window was selected, + (if (or from-compilation-buffer + (eq w (selected-window))) + ;; If the compilation buffer window is selected, ;; keep the compilation buffer in this window; ;; display the source in another window. (let ((pop-up-windows t)) @@ -3040,12 +3045,7 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given." ;; Get the specified directory from FILE. (spec-directory (if (cdr file) - ;; This function is active in `compilation-filter'. - ;; There could be problems to call `file-truename' - ;; for remote compilation processes. - (if (file-remote-p default-directory) - (concat comint-file-name-prefix (cdr file)) - (file-truename (concat comint-file-name-prefix (cdr file))))))) + (file-truename (concat comint-file-name-prefix (cdr file)))))) ;; Check for a comint-file-name-prefix and prepend it if appropriate. ;; (This is very useful for compilation-minor-mode in an rlogin-mode |