Open shakthimaan opened 9 years ago
Is there a way to run 'npm run tests' defined in a project package.json from coffee-mode.
no way. You can write such command as below.
;; for displaying ANSI escape sequences correctly
(eval-after-load 'compile
'(add-hook 'compilation-filter-hook
(lambda () (ansi-color-process-output nil))))
(defun npm-test ()
(interactive)
(let ((root (locate-dominating-file default-directory "package.json")))
(unless root
(error "Here is not npm package"))
(let ((default-directory root))
(compile "npm run test"))))
If there are errors in the npm output, the errored files are not clickable in the Emacs buffer. Is there a way to change the format of npm output such that the files are clickable inside Emacs buffers?
It may be possible if you set compilation-error-regexp-alist-alist properly.
However I think it is difficult because output of npm run test
vary among test framework.
(Sorry I don't understand npm well)
Thanks for the code snippet. I tried the above and I am able to now see a clickable pointer to the lines containing files, although I still need to look into setting compilation-error-regexp-alist. But, I still see the control characters in the compilation output. For example:
^[[2K^[[0G 2) "after all" hook
^[[2K^[[0G a\234\223 should return the expected output
What could I be missing?
Do you evaluate following expression ?
(eval-after-load 'compile
'(add-hook 'compilation-filter-hook
(lambda () (ansi-color-process-output nil))))
If you evaluate it, then you get output like following screenshot.
I tried evaluating the above, but, I still see the control characters in the output.
^[[2K^[[0G 2) "after all" hook
^[[2K^[[0G a\234\223 should return the expected output
Could it be because of my custom settings?
https://github.com/shakthimaan/cask-dot-emacs/tree/master/etc
I tried starting emacs with "-Q" option, and after evaluating the above S-expressions I still see the control characters. I also tried your dot_files, and after evaluating the above S-expressions, I still see the control characters.
What was the configuration that you used to get the above screenshot?
Hi,
Firstly, thanks for writing and maintaining coffee-mode.
1 Is there a way to run 'npm run tests' defined in a project package.json from coffee-mode. I currently use:
and run "npm run test" manually in M-x shell. But, I would like to be able to do it with a short-cut. Is there a way to enable this mode automatically when opening *.coffee files?
2 If there are errors in the npm output, the errored files are not clickable in the Emacs buffer. Is there a way to change the format of npm output such that the files are clickable inside Emacs buffers?
I was not able to use the following for *.coffee files: https://github.com/startup-class/dotfiles/blob/master/.emacs.d/js-config.el
Appreciate your help in this regard.
Thanks!