Permalink
Browse files

Improve compilation mode, and add a regexp for NodeJS stacktraces.

  • Loading branch information...
bhollis committed Dec 18, 2015
1 parent 1fe7038 commit 72d02688ffa0999dc37bf061016367012eb6166a
Showing with 35 additions and 12 deletions.
  1. +35 −12 emacs.d/init.el
View
@@ -237,10 +237,9 @@
;; Turn annoying windows like *help* into popup windows that can be
;; closed with q or C-g!
(use-package popwin
:init
:config
;; Hey, I like full side-by-side compile buffers, so leave 'em alone
(delete '(compilation-mode :noselect t) popwin:special-display-config)
:config
(popwin-mode 1))
;; Simple REST client / HTTP explorer
@@ -274,10 +273,10 @@
(add-hook 'prog-mode-hook 'eldoc-mode))
;; Enable semantic parsing where applicable
(use-package semantic
:commands semantic-mode
:init
(add-hook 'prog-mode-hook 'semantic-mode))
;; (use-package semantic
;; :commands semantic-mode
;; :init
;; (add-hook 'prog-mode-hook 'semantic-mode))
;; Highlight and auto-clean bad whitespace
(use-package whitespace
@@ -341,6 +340,36 @@
:config
(global-yascroll-bar-mode 1))
(use-package compile
:init
;; Shut up compile saves
(setq compilation-ask-about-save nil)
;; Don't save *anything*
(setq compilation-save-buffers-predicate '(lambda () nil))
:config
;; Add NodeJS error format
(setq compilation-error-regexp-alist-alist
;; Tip: M-x re-builder to test this out
(cons '(node "^[ ]+at \\(?:[^\(\n]+ \(\\)?\\([a-zA-Z\.0-9_/-]+\\):\\([0-9]+\\):\\([0-9]+\\)\)?$"
1 ;; file
2 ;; line
3 ;; column
)
compilation-error-regexp-alist-alist))
(setq compilation-error-regexp-alist
(cons 'node compilation-error-regexp-alist))
:bind
(("C-c C-c" . compile)
("C-c C-r" . recompile)))
;; TODO: look at Casey/work dotfiles to make compile better
;; TODO: re-run last command http://stackoverflow.com/questions/275842/is-there-a-repeat-last-command-in-emacs
;;(global-set-key (kbd "C-c C-c") 'compile)
;;(global-set-key "\C-B" 'recompile)
;;global-set-key "\C-x\C-c" 'switch-to-most-recent-compile-buffer)
;; TODO: https://github.com/nschum/highlight-symbol.el
@@ -812,12 +841,6 @@
(global-set-key (kbd "C-q") 'next-error)
(global-set-key (kbd "C-S-q") 'previous-error)
;; TODO: look at Casey/work dotfiles to make compile better
;; TODO: re-run last command http://stackoverflow.com/questions/275842/is-there-a-repeat-last-command-in-emacs
(global-set-key (kbd "C-c C-c") 'compile)
;;(global-set-key "\C-B" 'recompile)
;;global-set-key "\C-x\C-c" 'switch-to-most-recent-compile-buffer)
;; TODO: the keypad insert key is <help> (like F1)! Nice!
(global-set-key "\C-v" 'yank)

0 comments on commit 72d0268

Please sign in to comment.