New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for prefix to ignore for app finding #59

justinabrahms opened this Issue Sep 4, 2012 · 2 comments


None yet
2 participants

justinabrahms commented Sep 4, 2012

In my company's django project, we have all of our apps in an "apps" directory. The pony-get-app function always returns apps rather than "integration" or what-have-you. This was my solution for it.

;; should probably be customization field?
(setq pony-app-dir-prefix "apps")

(defun pony-get-app ()
  "Return the name of the current app, or nil if no app
found. Corrects for excluded prefix."
  (let* ((root (pony-project-root))
     (excluded-prefix (if (nil-blank-string pony-app-dir-prefix)
                  (concat root pony-app-dir-prefix "/")
         (re (concat "^" (regexp-quote excluded-prefix) "\\([A-Za-z_]+\\)/"))
         (path (or buffer-file-name (expand-file-name default-directory))))
    (when (string-match re path)
      (match-string 1 path)))))

This comment has been minimized.


davidmiller commented Sep 14, 2012

Most likely to turn this into a .dir-locals setting...
At which point you'd set it at the directory above all your company's Django source & this would work for your case IIUC


This comment has been minimized.

justinabrahms commented Sep 14, 2012

This would work for my usecase. I'm just using the hacked up version I pasted above, but that will be better. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment