Skip to content

Instantly share code, notes, and snippets.

@johnfredcee
Created January 2, 2013 20:37
Show Gist options
  • Select an option

  • Save johnfredcee/4437748 to your computer and use it in GitHub Desktop.

Select an option

Save johnfredcee/4437748 to your computer and use it in GitHub Desktop.
;; a convienence function that lets us switch between source/header files in a project
(defun buffer-other-eproject-files ()
(interactive)
(let*
((buffer-file (file-name-nondirectory (buffer-file-name)))
(other-buffer-files
(delq nil
(mapcar (lambda (x) (and
(equal (file-name-nondirectory (file-name-sans-extension x)) (file-name-sans-extension buffer-file))
(not (equal (file-name-nondirectory x) buffer-file))
x)) (eproject-list-project-files)))))
(when (> (length other-buffer-files) 0)
;; TO DO : Possibly prompt if there is more than one..
(find-file (car other-buffer-files)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment