Function: ede-parent-project
ede-parent-project is a byte-compiled function defined in ede.el.gz.
Signature
(ede-parent-project &optional OBJ)
Documentation
Return the project belonging to the parent directory.
Return nil if there is no previous directory. Optional argument OBJ is an object to find the parent of.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/ede.el.gz
;;; PROJECT ASSOCIATIONS
;;
;; Moving between relative projects. Associating between buffers and
;; projects.
(defun ede-parent-project (&optional obj)
"Return the project belonging to the parent directory.
Return nil if there is no previous directory.
Optional argument OBJ is an object to find the parent of."
(let* ((proj (or obj ede-object-project)) ;; Current project.
(root (if obj (ede-project-root obj)
ede-object-root-project)))
;; This case is a SHORTCUT if the project has defined
;; a way to calculate the project root.
(if (and root proj (eq root proj))
nil ;; we are at the root.
;; Else, we may have a nil proj or root.
(let* ((thisdir (if obj (oref obj directory)
default-directory))
(updir (ede-up-directory thisdir)))
(when updir
;; If there was no root, perhaps we can derive it from
;; updir now.
(let ((root (or root (ede-directory-get-toplevel-open-project updir))))
(or
;; This lets us find a subproject under root based on updir.
(and root
(ede-find-subproject-for-directory root updir))
;; Try the all structure based search.
(ede-directory-get-open-project updir))))))))