# HG changeset patch # User Sam Steingold # Date 1247250229 0 # Node ID bb5ce7283e84486f9cb78c348188ad1727bb7799 # Parent a9bb4a9d0ebd984cebaed12a65690e9e7a25ff0a (compilation-mode-font-lock-keywords): Omake sometimes indents the errors it prints, so allow all regexps to start with spaces. diff -r a9bb4a9d0ebd -r bb5ce7283e84 lisp/ChangeLog --- a/lisp/ChangeLog Fri Jul 10 17:07:36 2009 +0000 +++ b/lisp/ChangeLog Fri Jul 10 18:23:49 2009 +0000 @@ -1,3 +1,9 @@ +2009-07-10 Sam Steingold + + * progmodes/compile.el (compilation-mode-font-lock-keywords): + Omake sometimes indents the errors it prints, so allow all + regexps to start with spaces. + 2009-07-10 Eli Zaretskii * cus-edit.el (customize-changed-options-previous-release): Bump diff -r a9bb4a9d0ebd -r bb5ce7283e84 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Fri Jul 10 17:07:36 2009 +0000 +++ b/lisp/progmodes/compile.el Fri Jul 10 18:23:49 2009 +0000 @@ -975,7 +975,17 @@ (line (nth 2 item)) (col (nth 3 item)) (type (nth 4 item)) + (pat (car item)) end-line end-col fmt) + ;; omake reports some error indented, so skip the indentation. + ;; another solution is to modify (some?) regexps in + ;; `compilation-error-regexp-alist'. + ;; note that omake usage is not limited to ocaml and C (for stubs). + (unless (string-match (concat "^" (regexp-quote "^ *")) pat) + (setq pat (concat "^ *" + (if (= ?^ (aref pat 0)) + (substring pat 1) + pat)))) (if (consp file) (setq fmt (cdr file) file (car file))) (if (consp line) (setq end-line (cdr line) line (car line))) (if (consp col) (setq end-col (cdr col) col (car col))) @@ -984,7 +994,7 @@ ;; The old compile.el had here an undocumented hook that ;; allowed `line' to be a function that computed the actual ;; error location. Let's do our best. - `(,(car item) + `(,pat (0 (save-match-data (compilation-compat-error-properties (funcall ',line (cons (match-string ,file) @@ -996,7 +1006,7 @@ (unless (or (null (nth 5 item)) (integerp (nth 5 item))) (error "HYPERLINK should be an integer: %s" (nth 5 item))) - `(,(nth 0 item) + `(,pat ,@(when (integerp file) `((,file ,(if (consp type)