- (when (bolp)
- (while (not (eobp))
- ;; We don't want 'next-error' to always go to secondary
- ;; references, so we _don't_ set 'compilation-message text
- ;; property. Instead, we set 'ada-secondary-error, so
- ;; `ada-goto-secondary-error' will handle it. We also set
- ;; fonts, so the user can see the reference.
-
- ;; typical secondary references look like:
- ;;
- ;; trivial_productions_test.adb:57:77: ==> in call to "Get" at \
- ;; opentoken-token-enumerated-analyzer.ads:88, instance at line 41
- ;;
- ;; c:/foo/bar/lookahead_test.adb:379:14: found type access to "Standard.String" defined at line 379
- ;;
- ;; lookahead_test.ads:23:09: "Name" has been inherited from subprogram at aunit-simple_test_cases.ads:47
- ;;
- ;; lalr.adb:668:37: non-visible declaration at analyzer.ads:60, instance at parser.ads:38
- ;;
- ;; save the file from the primary reference, look for "*.ad?:nn", "at line nnn"
-
- (let (file)
- (when (looking-at "^\\(\\(.:\\)?[^ :\n]+\\):")
- (setq file (match-string-no-properties 1)))
-
- (skip-syntax-forward "^-"); space following primary reference
-
- (while (search-forward-regexp "\\s-\\(\\([^[:blank:]]+\\.[[:alpha:]]+\\):\\([0-9]+\\)\\)"
- (line-end-position) t)
-
- (goto-char (match-end 0))
- (with-silent-modifications
- (compilation--put-prop 2 'font-lock-face compilation-info-face); file
- (compilation--put-prop 3 'font-lock-face compilation-line-face); line
- (put-text-property
- (match-beginning 0) (match-end 0)
- 'ada-secondary-error
- (list
- (match-string-no-properties 2); file
- (string-to-number (match-string-no-properties 3)); line
- 1)); column
- ))
-
- (when (search-forward-regexp "\\(at line \\)\\([0-9]+\\)" (line-end-position) t)
- (with-silent-modifications
- (compilation--put-prop 1 'font-lock-face compilation-info-face); "at line" instead of file
- (compilation--put-prop 2 'font-lock-face compilation-line-face); line
- (put-text-property
- (match-beginning 1) (match-end 1)
- 'ada-secondary-error
- (list
- file
- (string-to-number (match-string-no-properties 2)); line
- 1)); column
- ))
- (forward-line 1))
- ))
+ (goto-char (line-beginning-position))
+ (while (not (eobp))
+ ;; We don't want 'next-error' to always go to secondary
+ ;; references, so we _don't_ set 'compilation-message text
+ ;; property. Instead, we set 'ada-secondary-error, so
+ ;; `ada-goto-secondary-error' will handle it. We also set
+ ;; fonts, so the user can see the reference.
+
+ ;; typical secondary references look like:
+ ;;
+ ;; trivial_productions_test.adb:57:77: ==> in call to "Get" at \
+ ;; opentoken-token-enumerated-analyzer.ads:88, instance at line 41
+ ;;
+ ;; c:/foo/bar/lookahead_test.adb:379:14: found type access to "Standard.String" defined at line 379
+ ;;
+ ;; lookahead_test.ads:23:09: "Name" has been inherited from subprogram at aunit-simple_test_cases.ads:47
+ ;;
+ ;; lalr.adb:668:37: non-visible declaration at analyzer.ads:60, instance at parser.ads:38
+ ;;
+ ;; save the file from the primary reference, look for "*.ad?:nn", "at line nnn"
+
+ (let (file)
+ (when (looking-at "^\\(\\(.:\\)?[^ :\n]+\\):")
+ (setq file (match-string-no-properties 1)))
+
+ (skip-syntax-forward "^-"); space following primary reference
+
+ (while (search-forward-regexp "\\s-\\(\\([^[:blank:]]+\\.[[:alpha:]]+\\):\\([0-9]+\\)\\)"
+ (line-end-position) t)
+
+ (goto-char (match-end 0))
+ (with-silent-modifications
+ (compilation--put-prop 2 'font-lock-face compilation-info-face); file
+ (compilation--put-prop 3 'font-lock-face compilation-line-face); line
+ (put-text-property
+ (match-beginning 0) (match-end 0)
+ 'ada-secondary-error
+ (list
+ (match-string-no-properties 2); file
+ (string-to-number (match-string-no-properties 3)); line
+ 1)); column
+ ))
+
+ (when (search-forward-regexp "\\(at line \\)\\([0-9]+\\)" (line-end-position) t)
+ (with-silent-modifications
+ (compilation--put-prop 1 'font-lock-face compilation-info-face); "at line" instead of file
+ (compilation--put-prop 2 'font-lock-face compilation-line-face); line
+ (put-text-property
+ (match-beginning 1) (match-end 1)
+ 'ada-secondary-error
+ (list
+ file
+ (string-to-number (match-string-no-properties 2)); line
+ 1)); column
+ ))
+ (forward-line 1))
+ )