From: Jim Weirich Date: 2002-08-18T14:12:32+09:00 Subject: Re: IDE vs. editor >>>>> "Massimiliano" == Massimiliano Mirra writes: Massimiliano> Again, I did not ask how you jump to a line, I asked Massimiliano> how do you jump to the line of a failed test, which Massimiliano> you said can be done. Several ways. The easiest is to run the tests from the M-x compile command and use the find next error command. If you run them from within a shell in emacs (rather than M-x compile), then you can use the following two functions and keybinding to search for errors in the immediately preceeding command output in the shell. Note that find-errors searches backwards for a shell prompt. If you have an unusual shell prompt, this may require tweeking. ---------------------------------------------------------------------- (defun find-errors () "Find the Errors in the current shell buffer." (interactive) (save-excursion (re-search-backward "^[a-zA-Z0-9]+\\$") (set-mark (point)) (re-search-backward "^[a-zA-Z0-9]+\\$") (find-errors-in-region) (next-error '(4))) ) (defun find-errors-in-region () "Use highlighted errors as compile errors." (interactive) (copy-region-as-kill (region-beginning) (region-end)) (goto-char (point-max)) (let ((oldbuf (get-buffer "*shell errors*"))) (if oldbuf (kill-buffer oldbuf))) (let ((outbuf (get-buffer-create "*shell errors*")) ) (switch-to-buffer outbuf) (insert-string "\n\n\n\n") (yank) (setq compilation-last-buffer outbuf) (compilation-mode) )) (global-set-key "\C-ce" 'find-errors) ---------------------------------------------------------------------- Emacs uses regular expressions to find and parse the "compile" output. If it cannot find the test case errors, jsut add the appropriate REs to the error list. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)