| Anonymous | Login | Signup for a new account | 2013-05-23 11:02 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005044 | OCaml | OCaml general | public | 2010-05-04 16:02 | 2012-09-18 13:09 | ||||||
| Reporter | bluestorm | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | tweak | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| Target Version | 4.00.2+dev | Fixed in Version | |||||||||
| Summary | 0005044: Emacs doesn't recognize the backtrace error location format | ||||||||||
| Description | Backtrace error locations are not printed in the standard format recognized by emacs. The backtrace format is the following : Raised at file "gUnify.ml", line 191, characters 24-64 Called from file "list.ml", line 69, characters 12-15 ... The compiler usually produces an error message formatted like this : File "gUnify.ml", line 147, characters 2-9: ... | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Relationships |
|||||||||||
|
|||||||||||
Notes |
|
|
(0005446) dbuenzli (reporter) 2010-05-04 17:46 |
Which version are you using ? This should be fixed in 3.11 see http://caml.inria.fr/mantis/view.php?id=4628 [^] Daniel |
|
(0005447) bluestorm (reporter) 2010-05-05 12:16 |
You are right, it is fixed under 3.11. Thanks for your patch, and sorry for not searching mantis before reporting. It's strange that we can't access the character positions of the error message. I don't understand the precise use of the error regexps internal to the Caml mode, but I had a look at emacs compilation-error-regexp-alist documentation, and I came with the following fix, wich works fine in my .emacs : (defun caml-change-error-alist-for-backtraces () "Hook to change the compilation-error-regexp-alist variable, to search the ocaml backtraces for error locations" (interactive) (progn (setq compilation-error-regexp-alist-alist (append '((caml-backtrace "^ *\\(?:Raised at\\|Called from\\) file \\(\"?\\)\\([^,\" \n\t<>]+\\)\\1,\ lines? \\([0-9]+\\)-?\\([0-9]+\\)?\\(?:$\\|,\ \\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:?\\)?\\)" 2 (3 . 4) (5 . 6))) compilation-error-regexp-alist-alist)) (setq compilation-error-regexp-alist (append compilation-error-regexp-alist '(caml-backtrace))))) (add-hook 'caml-mode-hook 'caml-change-error-alist-for-backtraces) (The regexp is mainly an adaptation of the 'caml' regexp preset in emacs compile.el) I also have the following, to spot error positions in assert failures (Assert_failure("test.ml", 1, 11)) : (defun caml-change-error-alist-for-assert-failure () "Hook to change the compilation-error-regexp-alist variable, to search the assert failure messages for error locations" (interactive) (progn (setq compilation-error-regexp-alist-alist (append '((caml-assert-failure "Assert_failure(\"\\([^,\" \n\t<>]+\\)\", \\([0-9]+\\), \\([0-9]+\\))" 1 2 3)) compilation-error-regexp-alist-alist)) (setq compilation-error-regexp-alist (append compilation-error-regexp-alist '(caml-assert-failure))))) (add-hook 'caml-mode-hook 'caml-change-error-alist-for-assert-failure) Would it be possible to integrate something similar in caml.el ? |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2010-05-04 16:02 | bluestorm | New Issue | |
| 2010-05-04 17:46 | dbuenzli | Note Added: 0005446 | |
| 2010-05-05 12:16 | bluestorm | Note Added: 0005447 | |
| 2011-06-01 22:52 | doligez | Relationship added | related to 0004628 |
| 2011-06-01 22:52 | doligez | Status | new => acknowledged |
| 2012-02-14 10:16 | gasche | Relationship added | related to 0005070 |
| 2012-09-06 16:43 | doligez | Target Version | => 4.00.1+dev |
| 2012-09-18 13:09 | doligez | Target Version | 4.00.1+dev => 4.00.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |