Function: srecode-semantic-handle-:project

srecode-semantic-handle-:project is a byte-compiled function defined in args.el.gz.

Signature

(srecode-semantic-handle-:project DICT)

Documentation

Add macros into the dictionary DICT based on the current ede project.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/args.el.gz
;;; :project ARGUMENT HANDLING
;;
;; When the :project argument is required, fill the dictionary with
;; information that the current project (from EDE) might know
(defun srecode-semantic-handle-:project (dict)
  "Add macros into the dictionary DICT based on the current ede project."
  (let* ((bfn (buffer-file-name))
	 (dir (file-name-directory bfn)))
    (if (ede-toplevel)
	(let* ((projecttop (ede-toplevel-project default-directory))
	       (relfname (file-relative-name bfn projecttop))
	       (reldir (file-relative-name dir projecttop))
	       )
	  (srecode-dictionary-set-value dict "PROJECT_FILENAME" relfname)
	  (srecode-dictionary-set-value dict "PROJECT_DIRECTORY" reldir)
	  (srecode-dictionary-set-value dict "PROJECT_NAME" (ede-name (ede-toplevel)))
	  (srecode-dictionary-set-value dict "PROJECT_VERSION"
                                        (oref (ede-toplevel) version)))
      ;; If there is no EDE project, then put in some base values.
      (srecode-dictionary-set-value dict "PROJECT_FILENAME" bfn)
      (srecode-dictionary-set-value dict "PROJECT_DIRECTORY" dir)
      (srecode-dictionary-set-value dict "PROJECT_NAME" "N/A")
      (srecode-dictionary-set-value dict "PROJECT_VERSION" "1.0"))))