Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Created July 8, 2009 07:30
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 eklitzke/142658 to your computer and use it in GitHub Desktop.
Save eklitzke/142658 to your computer and use it in GitHub Desktop.
(require 'yelp)
(defun find-after (target xs)
(defun find-c (p ys)
(if p
(cons (car ys) nil)
(if (string-equal target (car ys))
(cons target (find-c t (cdr ys)))
(cons (car ys) (find-c nil (cdr ys))))))
(find-c nil xs))
(defun find-file-root (root-sep &optional filename)
(let ((fname (if (null filename)
buffer-file-name
filename)))
(mapconcat 'identity (find-after "evan" (split-string fname "/")) "/")))
(defun yelp-branch-path () (find-file-root "pg"))
(defun yelp-find-tag ()
"This is a wrapper around find-tag that ensures that it uses
the correct etags database. It does this by ensuring that the
TAGS file used is the one in the current branch."
(let ((cb (yelp-branch-path)))
(if (stringp cb)
(setq tags-file-name (concat cb "/TAGS")))
(call-interactively 'find-tag)))
(provide 'eck-yelp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment