Function: ede

ede is an interactive and byte-compiled function defined in ede.el.gz.

Signature

(ede DIR)

Documentation

Start up EDE for directory DIR.

If DIR has an existing project file, load it. Otherwise, create a new project for DIR.

Probably introduced at or before Emacs version 23.4.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/ede.el.gz
;;; Interactive method invocations
;;
(defun ede (dir)
  "Start up EDE for directory DIR.
If DIR has an existing project file, load it.
Otherwise, create a new project for DIR."
  (interactive
   ;; When choosing a directory to turn on, and we see some directory here,
   ;; provide that as the default.
   (let* ((top (ede-toplevel-project default-directory))
	  (promptdflt (or top default-directory)))
     (list (read-directory-name "Project directory: "
				promptdflt promptdflt t))))
  (unless (file-directory-p dir)
    (error "%s is not a directory" dir))
  (when (ede-directory-get-open-project dir)
    (error "%s already has an open project associated with it" dir))

  ;; Check if the directory has been added to the list of safe
  ;; directories.  It can also add the directory to the safe list if
  ;; the user chooses.
  (if (ede-check-project-directory dir)
      (progn
	;; Load the project in DIR, or make one.
	;; @TODO - IS THIS REAL?
	(ede-load-project-file dir)

	;; Check if we loaded anything on the previous line.
	(if (ede-current-project dir)

	    ;; We successfully opened an existing project.  Some open
	    ;; buffers may also be referring to this project.
	    ;; Resetting all the buffers will get them to also point
	    ;; at this new open project.
	    (ede-reset-all-buffers)

	  ;; ELSE
	  ;; There was no project, so switch to `ede-new' which is how
	  ;; a user can select a new kind of project to create.
	  (let ((default-directory (expand-file-name dir)))
	    (call-interactively 'ede-new))))

    ;; If the proposed directory isn't safe, then say so.
    (error "%s is not an allowed project directory in `ede-project-directories'"
	   dir)))