# HG changeset patch # User Roland McGrath # Date 715475736 0 # Node ID 8e0a8faed93a12560b39b720dd3406f840ffc999 # Parent 53ad9fa87f716339130de9906ad85207734cec05 *** empty log message *** diff -r 53ad9fa87f71 -r 8e0a8faed93a lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Wed Sep 02 21:41:14 1992 +0000 +++ b/lisp/progmodes/compile.el Wed Sep 02 23:15:36 1992 +0000 @@ -90,6 +90,7 @@ (defvar compilation-error-regexp-alist '( + ;; NOTE! This first one is repeated in grep-regexp-alist, below. ;; 4.3BSD grep, cc, lint pass 1: ;; /usr/src/foo/foo.c(8): warning: w may be used before set ;; or GNU utilities @@ -122,6 +123,10 @@ compilation. If REGEXP matches, the FILE-IDX'th subexpression gives the file name, and the LINE-IDX'th subexpression gives the line number.") +(defvar grep-regexp-alist + '(("^\\([^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2)) + "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") + ;;;###autoload (defvar compilation-search-path '(nil) "*List of directories to search for source files named in error messages. @@ -205,7 +210,9 @@ (list (read-from-minibuffer "Run grep (like this): " "grep -n " nil nil 'grep-history))) (compile-internal (concat command-args " /dev/null") - "No more grep hits" "grep")) + "No more grep hits" "grep" + ;; Give it a simpler regexp to match. + nil grep-regexp-alist)) (defun compile-internal (command error-message &optional name-of-mode parser regexp-alist @@ -545,6 +552,9 @@ (setq compilation-last-buffer (current-buffer)) (compile-reinitialize-errors argp (point)) + ;; Move to bol; the marker for the error on this line will point there. + (beginning-of-line) + ;; Move compilation-error-list to the elt of compilation-old-error-list ;; we want. (setq compilation-error-list compilation-old-error-list)