Function: ede-add-project-autoload

ede-add-project-autoload is a byte-compiled function defined in auto.el.gz.

Signature

(ede-add-project-autoload PROJAUTO &optional FLAG)

Documentation

Add PROJAUTO, an EDE autoload definition to ede-project-class-files.

Optional argument FLAG indicates how this autoload should be added. Possible values are:
  generic - A generic project type. Keep this at the very end.
  unique - A unique project type for a specific project. Keep at the very
             front of the list so more generic projects don't get priority.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/ede/auto.el.gz
(defun ede-add-project-autoload (projauto &optional flag)
  "Add PROJAUTO, an EDE autoload definition to `ede-project-class-files'.
Optional argument FLAG indicates how this autoload should be
added.  Possible values are:
  `generic' - A generic project type.  Keep this at the very end.
  `unique' - A unique project type for a specific project.  Keep at the very
             front of the list so more generic projects don't get priority."
  ;; First, can we identify PROJAUTO as already in the list?  If so, replace.
  (let ((projlist ede-project-class-files)
	(projname (oref projauto name)))
    (while (and projlist (not (string= (oref (car projlist) name) projname)))
      (setq projlist (cdr projlist)))

    (if projlist
	;; Stick the new one into the old slot.
	(setcar projlist projauto)

      ;; Else, see where to insert it.
      (cond ((and flag (eq flag 'unique))
	     ;; Unique items get stuck right onto the front.
	     (setq ede-project-class-files
		   (cons projauto ede-project-class-files)))

	    ;; Generic Projects go at the very end of the list.
	    ((and flag (eq flag 'generic))
	     (oset projauto generic-p t)
	     (setq ede-project-class-files
		   (append ede-project-class-files
			   (list projauto))))

	    ;; Normal projects go at the end of the list, but
	    ;; before the generic projects.
	    (t
	     (let ((prev nil)
		   (next ede-project-class-files))
	       (while (and next (not (oref (car next) generic-p)))
		 (setq prev next
		       next (cdr next)))
	       (when (not prev)
		 (error "ede-project-class-files not initialized"))
	       ;; Splice into the list.
	       (setcdr prev (cons projauto next))))))))