Skip to content

Instantly share code, notes, and snippets.

@garaemon
Last active February 10, 2019 05:37
Show Gist options
  • Save garaemon/0d63894b8f450ccd00791ed6c24bc147 to your computer and use it in GitHub Desktop.
Save garaemon/0d63894b8f450ccd00791ed6c24bc147 to your computer and use it in GitHub Desktop.
catkin packages helm source
(let ((cmake-prefix-path (getenv "CMAKE_PREFIX_PATH")))
(when cmake-prefix-path
(setq helm-source-catkin-root
(format "%s/../src" (car (split-string cmake-prefix-path ":"))))))
(defun helm-catkin-packages-list ()
(let ((string-output (shell-command-to-string (format "find %s -name package.xml -exec dirname {} \\\;" helm-source-catkin-root))))
(let ((dirs (split-string string-output "\n")))
dirs)))
(defvar helm-source-catkin-packages
`((name . "catkin packages")
(init . (lambda () (setq helm-catkin-packages-list (helm-catkin-packages-list))))
(candidates . helm-catkin-packages-list)
(action . find-file)
(type . file)))
(defun helm-mini-with-ros ()
"Preconfigured `helm' lightweight version \(buffer -> recentf\)."
(interactive)
(require 'helm-files)
(let ((helm-ff-transformer-show-only-basename nil))
(helm-other-buffer '(helm-source-buffers-list
helm-source-recentf
helm-source-catkin-packages
helm-source-buffer-not-found)
"*helm mini*")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment