Skip to content

Instantly share code, notes, and snippets.

@garaemon
Created February 9, 2019 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garaemon/c95175c0b5bc8b7e9857b7b7ae0cc0b3 to your computer and use it in GitHub Desktop.
Save garaemon/c95175c0b5bc8b7e9857b7b7ae0cc0b3 to your computer and use it in GitHub Desktop.
Run catkin build in emacs
;; Based on https://www.seas.upenn.edu/~chaoliu/2018/03/12/ros-programming-in-emacs/#org8817889
(require 'ansi-color)
(defun endless/colorize-compilation ()
"Colorize from `compilation-filter-start' to `point'."
(let ((inhibit-read-only t))
(ansi-color-apply-on-region
compilation-filter-start (point))))
(add-hook 'compilation-filter-hook
#'endless/colorize-compilation)
(defun ros-catkin-make (dir)
"Run catkin_make command in DIR."
(interactive (list (file-name-directory (buffer-file-name))))
(let* ((default-directory dir)
(compilation-buffer-name-function (lambda (major-mode-name) "*catkin_make*")))
(compile "catkin bt --no-status"))
;; (switch-to-buffer (get-buffer "*catkin_make*"))
(switch-to-buffer-other-window (get-buffer-create "*catkin_make*"))
)
(global-set-key [f5] 'ros-catkin-make)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment