Mercurial > emacs
annotate lisp/cedet/ede.el @ 107256:122dff72a8ee
* net/tramp.el (tramp-handle-write-region): START can be a string.
Take care in the checks.
author | Michael Albinus <albinus@detlef> |
---|---|
date | Sun, 28 Feb 2010 12:36:39 +0100 |
parents | f6b8c73548b3 |
children | a3e1f7134e6e b150a06c6999 |
rev | line source |
---|---|
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; ede.el --- Emacs Development Environment gloss |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
105325 | 3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
106815 | 4 ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; Keywords: project, make |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; (at your option) any later version. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;;; Commentary: |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; EDE is the top level Lisp interface to a project management scheme |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; for Emacs. Emacs does many things well, including editing, |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 ;; building, and debugging. Folks migrating from other IDEs don't |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;; seem to think this qualifies, however, because they still have to |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;; write the makefiles, and specify parameters to programs. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;; This EDE mode will attempt to link these diverse programs together |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 ;; into a comprehensive single interface, instead of a bunch of |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 ;; different ones. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 ;;; Install |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 ;; This command enables project mode on all files. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 ;; (global-ede-mode t) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
42 (require 'cedet) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 (require 'eieio) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (require 'eieio-speedbar) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (require 'ede/source) |
105842
83dde921cc1b
* emacs-lisp/autoload.el (generated-autoload-feature): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105815
diff
changeset
|
46 (load "ede/loaddefs" nil 'nomessage) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 (declare-function ede-convert-path "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 (declare-function ede-directory-get-open-project "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 (declare-function ede-directory-get-toplevel-open-project "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 (declare-function ede-directory-project-p "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 (declare-function ede-find-subproject-for-directory "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 (declare-function ede-project-directory-remove-hash "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 (declare-function ede-project-root "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 (declare-function ede-project-root-directory "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 (declare-function ede-toplevel "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 (declare-function ede-toplevel-project "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 (declare-function ede-up-directory "ede/files") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (declare-function data-debug-new-buffer "data-debug") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (declare-function data-debug-insert-object-slots "eieio-datadebug") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (declare-function semantic-lex-make-spp-table "semantic/lex-spp") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (defconst ede-version "1.0pre7" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 "Current version of the Emacs EDE.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 ;;; Code: |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (defun ede-version () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 "Display the current running version of EDE." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 (interactive) (message "EDE %s" ede-version)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (defgroup ede nil |
107167
f6b8c73548b3
Minor tweaks to custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107146
diff
changeset
|
72 "Emacs Development Environment." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 :group 'tools |
107167
f6b8c73548b3
Minor tweaks to custom groups.
Chong Yidong <cyd@stupidchicken.com>
parents:
107146
diff
changeset
|
74 :group 'extensions) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 (defcustom ede-auto-add-method 'ask |
105325 | 77 "Whether a new source file should be automatically added to a target. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 Whenever a new file is encountered in a directory controlled by a |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 project file, all targets are queried to see if it should be added. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 If the value is 'always, then the new file is added to the first |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 target encountered. If the value is 'multi-ask, then if more than one |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 target wants the file, the user is asked. If only one target wants |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 the file, then then it is automatically added to that target. If the |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 value is 'ask, then the user is always asked, unless there is no |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 target willing to take the file. 'never means never perform the check." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 :group 'ede |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 :type '(choice (const always) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 (const multi-ask) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (const ask) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 (const never))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 (defcustom ede-debug-program-function 'gdb |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 "Default Emacs command used to debug a target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 :group 'ede |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 :type 'sexp) ; make this be a list of options some day |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 ;;; Top level classes for projects and targets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (defclass ede-project-autoload () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 ((name :initarg :name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 :documentation "Name of this project type") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (file :initarg :file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 :documentation "The lisp file belonging to this class.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 (proj-file :initarg :proj-file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 :documentation "Name of a project file of this type.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (proj-root :initarg :proj-root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 :type function |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 :documentation "A function symbol to call for the project root. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 This function takes no arguments, and returns the current directories |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 root, if available. Leave blank to use the EDE directory walking |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 routine instead.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 (initializers :initarg :initializers |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 "Initializers passed to the project object. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 These are used so there can be multiple types of projects |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 associated with a single object class, based on the initilizeres used.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 (load-type :initarg :load-type |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 :documentation "Fn symbol used to load this project file.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 (class-sym :initarg :class-sym |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 :documentation "Symbol representing the project class to use.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 (new-p :initarg :new-p |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 :initform t |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 "Non-nil if this is an option when a user creates a project.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 "Class representing minimal knowledge set to run preliminary EDE functions. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 When more advanced functionality is needed from a project type, that projects |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 type is required and the load function used.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 (defvar ede-project-class-files |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 (list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 (ede-project-autoload "edeproject-makefile" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 :name "Make" :file 'ede/proj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 :proj-file "Project.ede" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 :load-type 'ede-proj-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 :class-sym 'ede-proj-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 (ede-project-autoload "edeproject-automake" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 :name "Automake" :file 'ede/proj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 :proj-file "Project.ede" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 :initializers '(:makefile-type Makefile.am) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 :load-type 'ede-proj-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 :class-sym 'ede-proj-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 (ede-project-autoload "automake" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 :name "automake" :file 'ede/project-am |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 :proj-file "Makefile.am" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 :load-type 'project-am-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 :class-sym 'project-am-makefile |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 :new-p nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
151 (ede-project-autoload "cpp-root" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
152 :name "CPP ROOT" :file 'ede/cpp-root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
153 :proj-file 'ede-cpp-root-project-file-for-dir |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
154 :proj-root 'ede-cpp-root-project-root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
155 :load-type 'ede-cpp-root-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
156 :class-sym 'ede-cpp-root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
157 :new-p nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 (ede-project-autoload "emacs" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 :name "EMACS ROOT" :file 'ede/emacs |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 :proj-file "src/emacs.c" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
161 :proj-root 'ede-emacs-project-root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
162 :load-type 'ede-emacs-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
163 :class-sym 'ede-emacs-project |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
164 :new-p nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
165 (ede-project-autoload "linux" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 :name "LINUX ROOT" :file 'ede/linux |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 :proj-file "scripts/ver_linux" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
168 :proj-root 'ede-linux-project-root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
169 :load-type 'ede-linux-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 :class-sym 'ede-linux-project |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 :new-p nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 (ede-project-autoload "simple-overlay" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
173 :name "Simple" :file 'ede/simple |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
174 :proj-file 'ede-simple-projectfile-for-dir |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
175 :load-type 'ede-simple-load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
176 :class-sym 'ede-simple-project)) |
105325 | 177 "List of vectors defining how to determine what type of projects exist.") |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
178 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
179 ;;; Generic project information manager objects |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 (defclass ede-target (eieio-speedbar-directory-button) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 ((buttonface :initform speedbar-file-face) ;override for superclass |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 (name :initarg :name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
184 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 :label "Name" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 :group (default name) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
188 :documentation "Name of this target.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
189 ;; @todo - I think this should be "dir", and not "path". |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 (path :initarg :path |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 ;:custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 ;:label "Path to target" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
194 ;:group (default name) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
195 :documentation "The path to the sources of this target. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 Relative to the path of the project it belongs to.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
197 (source :initarg :source |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
199 ;; I'd prefer a list of strings. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 :type list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 :custom (repeat (string :tag "File")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 :label "Source Files" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
203 :group (default source) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 :documentation "Source files in this target.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
205 (versionsource :initarg :versionsource |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
207 :type list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 :custom (repeat (string :tag "File")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 :label "Source Files with Version String" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
210 :group (source) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
211 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
212 "Source files with a version string in them. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
213 These files are checked for a version string whenever the EDE version |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
214 of the master project is changed. When strings are found, the version |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
215 previously there is updated.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
216 ;; Class level slots |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
217 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
218 ; (takes-compile-command :allocation :class |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
219 ; :initarg :takes-compile-command |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 ; :type boolean |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 ; :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 ; :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 ; "Non-nil if this target requires a user approved command.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 (sourcetype :allocation :class |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 :type list ;; list of symbols |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
226 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
227 "A list of `ede-sourcecode' objects this class will handle. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 This is used to match target objects with the compilers they can use, and |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
229 which files this object is interested in." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 :accessor ede-object-sourcecode) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 (keybindings :allocation :class |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 :initform (("D" . ede-debug-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
233 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
234 "Keybindings specialized to this type of target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
235 :accessor ede-object-keybindings) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
236 (menu :allocation :class |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 :initform ( [ "Debug target" ede-debug-target |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 (and ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 (obj-of-class-p ede-object ede-target)) ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
240 ) |
105652
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
241 [ "Run target" ede-run-target |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
242 (and ede-object |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
243 (obj-of-class-p ede-object ede-target)) ] |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
244 :documentation "Menu specialized to this type of target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 :accessor ede-object-menu) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
246 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
247 "A top level target to build.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
248 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 (defclass ede-project-placeholder (eieio-speedbar-directory-button) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 ((name :initarg :name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 :initform "Untitled" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 :label "Name" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
255 :group (default name) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 :documentation "The name used when generating distribution files.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 (version :initarg :version |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
258 :initform "1.0" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 :label "Version" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 :group (default name) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
263 :documentation "The version number used when distributing files.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 (directory :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
265 :initarg :directory |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 :documentation "Directory this project is associated with.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 (dirinode :documentation "The inode id for :directory.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
268 (file :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
269 :initarg :file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
270 :documentation "File name where this project is stored.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
271 (rootproject ; :initarg - no initarg, don't save this slot! |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
272 :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
273 :type (or null ede-project-placeholder-child) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
274 :documentation "Pointer to our root project.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
275 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
276 "Placeholder object for projects not loaded into memory. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
277 Projects placeholders will be stored in a user specific location |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
278 and querying them will cause the actual project to get loaded.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
279 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
280 (defclass ede-project (ede-project-placeholder) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
281 ((subproj :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
282 :type list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
283 :documentation "Sub projects controlled by this project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
284 For Automake based projects, each directory is treated as a project.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
285 (targets :initarg :targets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
286 :type list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
287 :custom (repeat (object :objectcreatefcn ede-new-target-custom)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
288 :label "Local Targets" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
289 :group (targets) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
290 :documentation "List of top level targets in this project.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
291 (locate-obj :type (or null ede-locate-base-child) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
292 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
293 "A locate object to use as a backup to `ede-expand-filename'.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
294 (tool-cache :initarg :tool-cache |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 :type list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
296 :custom (repeat object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
297 :label "Tool: " |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
298 :group tools |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 :documentation "List of tool cache configurations in this project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
300 This allows any tool to create, manage, and persist project-specific settings.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
301 (mailinglist :initarg :mailinglist |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
302 :initform "" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
303 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 :label "Mailing List Address" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
306 :group name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
307 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
308 "An email address where users might send email for help.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
309 (web-site-url :initarg :web-site-url |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
310 :initform "" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
311 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
312 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 :label "Web Site URL" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
314 :group name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 :documentation "URL to this projects web site. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 This is a URL to be sent to a web site for documentation.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
317 (web-site-directory :initarg :web-site-directory |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 :initform "" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
319 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 :label "Web Page Directory" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 :group name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
323 "A directory where web pages can be found by Emacs. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 For remote locations use a path compatible with ange-ftp or EFS. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
325 You can also use TRAMP for use with rcp & scp.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 (web-site-file :initarg :web-site-file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 :initform "" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
329 :label "Web Page File" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
330 :group name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
332 "A file which contains the home page for this project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
333 This file can be relative to slot `web-site-directory'. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
334 This can be a local file, use ange-ftp, EFS, or TRAMP.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
335 (ftp-site :initarg :ftp-site |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
336 :initform "" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
338 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
339 :label "FTP site" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
340 :group name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
341 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 "FTP site where this project's distribution can be found. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 This FTP site should be in Emacs form, as needed by `ange-ftp', but can |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
344 also be of a form used by TRAMP for use with scp, or rcp.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (ftp-upload-site :initarg :ftp-upload-site |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 :initform "" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 :type string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
349 :label "FTP Upload site" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 :group name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 :documentation |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
352 "FTP Site to upload new distributions to. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 This FTP site should be in Emacs form as needed by `ange-ftp'. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 If this slot is nil, then use `ftp-site' instead.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
355 (configurations :initarg :configurations |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
356 :initform ("debug" "release") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 :type list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
358 :custom (repeat string) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 :label "Configuration Options" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
360 :group (settings) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 :documentation "List of available configuration types. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 Individual target/project types can form associations between a configuration, |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 and target specific elements such as build variables.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 (configuration-default :initarg :configuration-default |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
365 :initform "debug" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
366 :custom string |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
367 :label "Current Configuration" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
368 :group (settings) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
369 :documentation "The default configuration.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
370 (local-variables :initarg :local-variables |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
371 :initform nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
372 :custom (repeat (cons (sexp :tag "Variable") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
373 (sexp :tag "Value"))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
374 :label "Project Local Variables" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
375 :group (settings) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
376 :documentation "Project local variables") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
377 (keybindings :allocation :class |
105652
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
378 :initform (("D" . ede-debug-target) |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
379 ("R" . ede-run-target)) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
380 :documentation "Keybindings specialized to this type of target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
381 :accessor ede-object-keybindings) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
382 (menu :allocation :class |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
383 :initform |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
384 ( |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
385 [ "Update Version" ede-update-version ede-object ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
386 [ "Version Control Status" ede-vc-project-directory ede-object ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
387 [ "Edit Project Homepage" ede-edit-web-page |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
388 (and ede-object (oref (ede-toplevel) web-site-file)) ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
389 [ "Browse Project URL" ede-web-browse-home |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
390 (and ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
391 (not (string= "" (oref (ede-toplevel) web-site-url)))) ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
392 "--" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
393 [ "Rescan Project Files" ede-rescan-toplevel t ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
394 [ "Edit Projectfile" ede-edit-file-target |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
395 (and ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
396 (or (listp ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
397 (not (obj-of-class-p ede-object ede-project)))) ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
398 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
399 :documentation "Menu specialized to this type of target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
400 :accessor ede-object-menu) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
401 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
402 "Top level EDE project specification. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
403 All specific project types must derive from this project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
404 :method-invocation-order :depth-first) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
405 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
406 ;;; Management variables |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
407 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
408 (defvar ede-projects nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
409 "A list of all active projects currently loaded in Emacs.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
410 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
411 (defvar ede-object-root-project nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
412 "The current buffer's current root project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
413 If a file is under a project, this specifies the project that is at |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
414 the root of a project tree.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
415 (make-variable-buffer-local 'ede-object-root-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
416 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
417 (defvar ede-object-project nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
418 "The current buffer's current project at that level. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
419 If a file is under a project, this specifies the project that contains the |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
420 current target.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
421 (make-variable-buffer-local 'ede-object-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
422 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
423 (defvar ede-object nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
424 "The current buffer's target object. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
425 This object's class determines how to compile and debug from a buffer.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
426 (make-variable-buffer-local 'ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
427 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
428 (defvar ede-selected-object nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
429 "The currently user-selected project or target. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
430 If `ede-object' is nil, then commands will operate on this object.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
431 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
432 (defvar ede-constructing nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
433 "Non nil when constructing a project hierarchy.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
434 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
435 (defvar ede-deep-rescan nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
436 "Non nil means scan down a tree, otherwise rescans are top level only. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
437 Do not set this to non-nil globally. It is used internally.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
438 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
439 ;;; The EDE persistent cache. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
440 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
441 (defcustom ede-project-placeholder-cache-file |
105418
0f5992576338
* cedet/semantic/db-file.el (semanticdb-default-save-directory):
Chong Yidong <cyd@stupidchicken.com>
parents:
105412
diff
changeset
|
442 (locate-user-emacs-file "ede-projects.el" ".projects.ede") |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
443 "File containing the list of projects EDE has viewed." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
444 :group 'ede |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
445 :type 'file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
446 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
447 (defvar ede-project-cache-files nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
448 "List of project files EDE has seen before.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
449 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
450 (defun ede-save-cache () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
451 "Save a cache of EDE objects that Emacs has seen before." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
452 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
453 (let ((p ede-projects) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
454 (c ede-project-cache-files) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
455 (recentf-exclude '(ignore)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
456 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
457 (condition-case nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
458 (progn |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
459 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
460 (erase-buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
461 (insert ";; EDE project cache file. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
462 ;; This contains a list of projects you have visited.\n(") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
463 (while p |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
464 (when (and (car p) (ede-project-p p)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
465 (let ((f (oref (car p) file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
466 (when (file-exists-p f) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
467 (insert "\n \"" f "\"")))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
468 (setq p (cdr p))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
469 (while c |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
470 (insert "\n \"" (car c) "\"") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
471 (setq c (cdr c))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
472 (insert "\n)\n") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
473 (condition-case nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
474 (save-buffer 0) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
475 (error |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
476 (message "File %s could not be saved." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
477 ede-project-placeholder-cache-file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
478 (kill-buffer (current-buffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
479 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
480 (error |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
481 (message "File %s could not be read." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
482 ede-project-placeholder-cache-file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
483 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
484 ))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
485 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
486 (defun ede-load-cache () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
487 "Load the cache of EDE projects." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
488 (save-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
489 (let ((cachebuffer nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
490 (condition-case nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
491 (progn |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
492 (setq cachebuffer |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
493 (find-file-noselect ede-project-placeholder-cache-file t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
494 (set-buffer cachebuffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
495 (goto-char (point-min)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
496 (let ((c (read (current-buffer))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
497 (new nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
498 (p ede-projects)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
499 ;; Remove loaded projects from the cache. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
500 (while p |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
501 (setq c (delete (oref (car p) file) c)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
502 (setq p (cdr p))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
503 ;; Remove projects that aren't on the filesystem |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
504 ;; anymore. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
505 (while c |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
506 (when (file-exists-p (car c)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
507 (setq new (cons (car c) new))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
508 (setq c (cdr c))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
509 ;; Save it |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
510 (setq ede-project-cache-files (nreverse new)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
511 (error nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
512 (when cachebuffer (kill-buffer cachebuffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
513 ))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
514 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
515 ;;; Important macros for doing commands. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
516 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
517 (defmacro ede-with-projectfile (obj &rest forms) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
518 "For the project in which OBJ resides, execute FORMS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
519 (list 'save-window-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
520 (list 'let* (list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
521 (list 'pf |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
522 (list 'if (list 'obj-of-class-p |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
523 obj 'ede-target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
524 ;; @todo -I think I can change |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
525 ;; this to not need ede-load-project-file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
526 ;; but I'm not sure how to test well. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
527 (list 'ede-load-project-file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
528 (list 'oref obj 'path)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
529 obj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
530 '(dbka (get-file-buffer (oref pf file)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
531 '(if (not dbka) (find-file (oref pf file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
532 (switch-to-buffer dbka)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
533 (cons 'progn forms) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
534 '(if (not dbka) (kill-buffer (current-buffer)))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
535 (put 'ede-with-projectfile 'lisp-indent-function 1) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
536 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
537 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
538 ;;; Prompting |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
539 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
540 (defun ede-singular-object (prompt) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
541 "Using PROMPT, choose a single object from the current buffer." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
542 (if (listp ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
543 (ede-choose-object prompt ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
544 ede-object)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
545 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
546 (defun ede-choose-object (prompt list-o-o) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
547 "Using PROMPT, ask the user which OBJECT to use based on the name field. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
548 Argument LIST-O-O is the list of objects to choose from." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
549 (let* ((al (object-assoc-list 'name list-o-o)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
550 (ans (completing-read prompt al nil t))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
551 (setq ans (assoc ans al)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
552 (cdr ans))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
553 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
554 ;;; Menu and Keymap |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
555 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
556 (defvar ede-minor-mode-map |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
557 (let ((map (make-sparse-keymap)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
558 (pmap (make-sparse-keymap))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
559 (define-key pmap "e" 'ede-edit-file-target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
560 (define-key pmap "a" 'ede-add-file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
561 (define-key pmap "d" 'ede-remove-file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
562 (define-key pmap "t" 'ede-new-target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
563 (define-key pmap "g" 'ede-rescan-toplevel) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
564 (define-key pmap "s" 'ede-speedbar) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
565 (define-key pmap "l" 'ede-load-project-file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
566 (define-key pmap "f" 'ede-find-file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
567 (define-key pmap "C" 'ede-compile-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
568 (define-key pmap "c" 'ede-compile-target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
569 (define-key pmap "\C-c" 'ede-compile-selected) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
570 (define-key pmap "D" 'ede-debug-target) |
105652
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
571 (define-key pmap "R" 'ede-run-target) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
572 ;; bind our submap into map |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
573 (define-key map "\C-c." pmap) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
574 map) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
575 "Keymap used in project minor mode.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
576 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
577 (defvar global-ede-mode-map |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
578 (let ((map (make-sparse-keymap))) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
579 (define-key map [menu-bar cedet-menu] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
580 (cons "Development" cedet-menu-map)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
581 map) |
105325 | 582 "Keymap used in `global-ede-mode'.") |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
583 |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
584 ;; Activate the EDE items in cedet-menu-map |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
585 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
586 (define-key cedet-menu-map [ede-find-file] |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
587 '(menu-item "Find File in Project..." ede-find-file :enable ede-object |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
588 :visible global-ede-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
589 (define-key cedet-menu-map [ede-speedbar] |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
590 '(menu-item "View Project Tree" ede-speedbar :enable ede-object |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
591 :visible global-ede-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
592 (define-key cedet-menu-map [ede] |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
593 '(menu-item "Load Project" ede |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
594 :visible global-ede-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
595 (define-key cedet-menu-map [ede-new] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
596 '(menu-item "Create Project" ede-new |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
597 :enable (not ede-object) |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
598 :visible global-ede-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
599 (define-key cedet-menu-map [ede-target-options] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
600 '(menu-item "Target Options" ede-target-options |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
601 :filter ede-target-forms-menu |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
602 :visible global-ede-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
603 (define-key cedet-menu-map [ede-project-options] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
604 '(menu-item "Project Options" ede-project-options |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
605 :filter ede-project-forms-menu |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
606 :visible global-ede-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
607 (define-key cedet-menu-map [ede-build-forms-menu] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
608 '(menu-item "Build Project" ede-build-forms-menu |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
609 :filter ede-build-forms-menu |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
610 :enable ede-object |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
611 :visible global-ede-mode)) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
612 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
613 (defun ede-menu-obj-of-class-p (class) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
614 "Return non-nil if some member of `ede-object' is a child of CLASS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
615 (if (listp ede-object) |
105260
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104524
diff
changeset
|
616 (eval (cons 'or (mapcar (lambda (o) (obj-of-class-p o class)) ede-object))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
617 (obj-of-class-p ede-object class))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
618 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
619 (defun ede-build-forms-menu (menu-def) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
620 "Create a sub menu for building different parts of an EDE system. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
621 Argument MENU-DEF is the menu definition to use." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
622 (easy-menu-filter-return |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
623 (easy-menu-create-menu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
624 "Build Forms" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
625 (let ((obj (ede-current-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
626 (newmenu nil) ;'([ "Build Selected..." ede-compile-selected t ])) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
627 targets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
628 targitems |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
629 ede-obj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
630 (tskip nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
631 (if (not obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
632 nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
633 (setq targets (when (slot-boundp obj 'targets) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
634 (oref obj targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
635 ede-obj (if (listp ede-object) ede-object (list ede-object))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
636 ;; First, collect the build items from the project |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
637 (setq newmenu (append newmenu (ede-menu-items-build obj t))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
638 ;; Second, Declare the current target menu items |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
639 (if (and ede-obj (ede-menu-obj-of-class-p ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
640 (while ede-obj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
641 (setq newmenu (append newmenu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
642 (ede-menu-items-build (car ede-obj) t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
643 tskip (car ede-obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
644 ede-obj (cdr ede-obj)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
645 ;; Third, by name, enable builds for other local targets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
646 (while targets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
647 (unless (eq tskip (car targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
648 (setq targitems (ede-menu-items-build (car targets) nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
649 (setq newmenu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
650 (append newmenu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
651 (if (= 1 (length targitems)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
652 targitems |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
653 (cons (ede-name (car targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
654 targitems)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
655 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
656 (setq targets (cdr targets))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
657 ;; Fourth, build sub projects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
658 ;; -- nerp |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
659 ;; Fifth, Add make distribution |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
660 (append newmenu (list [ "Make distribution" ede-make-dist t ])) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
661 ))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
662 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
663 (defun ede-target-forms-menu (menu-def) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
664 "Create a target MENU-DEF based on the object belonging to this buffer." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
665 (easy-menu-filter-return |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
666 (easy-menu-create-menu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
667 "Target Forms" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
668 (let ((obj (or ede-selected-object ede-object))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
669 (append |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
670 '([ "Add File" ede-add-file |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
671 (and (ede-current-project) |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
672 (oref (ede-current-project) targets)) ] |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
673 [ "Remove File" ede-remove-file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
674 (and ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
675 (or (listp ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
676 (not (obj-of-class-p ede-object ede-project)))) ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
677 "-") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
678 (if (not obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
679 nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
680 (if (and (not (listp obj)) (oref obj menu)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
681 (oref obj menu) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
682 (when (listp obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
683 ;; This is bad, but I'm not sure what else to do. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
684 (oref (car obj) menu))))))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
685 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
686 (defun ede-project-forms-menu (menu-def) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
687 "Create a target MENU-DEF based on the object belonging to this buffer." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
688 (easy-menu-filter-return |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
689 (easy-menu-create-menu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
690 "Project Forms" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
691 (let* ((obj (ede-current-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
692 (class (if obj (object-class obj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
693 (menu nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
694 (condition-case err |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
695 (progn |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
696 (while (and class (slot-exists-p class 'menu)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
697 ;;(message "Looking at class %S" class) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
698 (setq menu (append menu (oref class menu)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
699 class (class-parent class)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
700 (if (listp class) (setq class (car class)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
701 (append |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
702 '( [ "Add Target" ede-new-target (ede-current-project) ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
703 [ "Remove Target" ede-delete-target ede-object ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
704 "-") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
705 menu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
706 )) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
707 (error (message "Err found: %S" err) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
708 menu) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
709 ))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
710 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
711 (defun ede-customize-forms-menu (menu-def) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
712 "Create a menu of the project, and targets that can be customized. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
713 Argument MENU-DEF is the definition of the current menu." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
714 (easy-menu-filter-return |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
715 (easy-menu-create-menu |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
716 "Customize Project" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
717 (let* ((obj (ede-current-project)) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104503
diff
changeset
|
718 targ) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
719 (when obj |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104503
diff
changeset
|
720 (setq targ (when (slot-boundp obj 'targets) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104503
diff
changeset
|
721 (oref obj targets))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
722 ;; Make custom menus for everything here. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
723 (append (list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
724 (cons (concat "Project " (ede-name obj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
725 (eieio-customize-object-group obj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
726 [ "Reorder Targets" ede-project-sort-targets t ] |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
727 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
728 (mapcar (lambda (o) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
729 (cons (concat "Target " (ede-name o)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
730 (eieio-customize-object-group o))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
731 targ))))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
732 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
733 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
734 (defun ede-apply-object-keymap (&optional default) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
735 "Add target specific keybindings into the local map. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
736 Optional argument DEFAULT indicates if this should be set to the default |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
737 version of the keymap." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
738 (let ((object (or ede-object ede-selected-object))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
739 (condition-case nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
740 (let ((keys (ede-object-keybindings object))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
741 (while keys |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
742 (local-set-key (concat "\C-c." (car (car keys))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
743 (cdr (car keys))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
744 (setq keys (cdr keys)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
745 (error nil)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
746 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
747 ;;; Menu building methods for building |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
748 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
749 (defmethod ede-menu-items-build ((obj ede-project) &optional current) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
750 "Return a list of menu items for building project OBJ. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
751 If optional argument CURRENT is non-nil, return sub-menu code." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
752 (if current |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
753 (list [ "Build Current Project" ede-compile-project t ]) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
754 (list (vector |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
755 (list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
756 (concat "Build Project " (ede-name obj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
757 `(project-compile-project ,obj)))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
758 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
759 (defmethod ede-menu-items-build ((obj ede-target) &optional current) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
760 "Return a list of menu items for building target OBJ. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
761 If optional argument CURRENT is non-nil, return sub-menu code." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
762 (if current |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
763 (list [ "Build Current Target" ede-compile-target t ]) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
764 (list (vector |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
765 (concat "Build Target " (ede-name obj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
766 `(project-compile-target ,obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
767 t)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
768 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
769 ;;; Mode Declarations |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
770 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
771 (eval-and-compile |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104503
diff
changeset
|
772 (autoload 'ede-dired-minor-mode "ede/dired" "EDE commands for dired" t)) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
773 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
774 (defun ede-apply-target-options () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
775 "Apply options to the current buffer for the active project/target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
776 (if (ede-current-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
777 (ede-set-project-variables (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
778 (ede-apply-object-keymap) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
779 (ede-apply-preprocessor-map) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
780 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
781 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
782 (defun ede-turn-on-hook () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
783 "Turn on EDE minor mode in the current buffer if needed. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
784 To be used in hook functions." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
785 (if (or (and (stringp (buffer-file-name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
786 (stringp default-directory)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
787 ;; Emacs 21 has no buffer file name for directory edits. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
788 ;; so we need to add these hacks in. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
789 (eq major-mode 'dired-mode) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
790 (eq major-mode 'vc-dired-mode)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
791 (ede-minor-mode 1))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
792 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
793 (define-minor-mode ede-minor-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
794 "Toggle EDE (Emacs Development Environment) minor mode. |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
795 With non-nil argument ARG, enable EDE minor mode if ARG is |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
796 positive; otherwise, disable it. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
797 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
798 If this file is contained, or could be contained in an EDE |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
799 controlled project, then this mode is activated automatically |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
800 provided `global-ede-mode' is enabled." |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
801 :group 'ede |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
802 (cond ((or (eq major-mode 'dired-mode) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
803 (eq major-mode 'vc-dired-mode)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
804 (ede-dired-minor-mode (if ede-minor-mode 1 -1))) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
805 (ede-minor-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
806 (if (and (not ede-constructing) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
807 (ede-directory-project-p default-directory t)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
808 (let* ((ROOT nil) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
809 (proj (ede-directory-get-open-project default-directory |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
810 'ROOT))) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
811 (when (not proj) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
812 ;; @todo - this could be wasteful. |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
813 (setq proj (ede-load-project-file default-directory 'ROOT))) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
814 (setq ede-object-project proj) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
815 (setq ede-object-root-project |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
816 (or ROOT (ede-project-root proj))) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
817 (setq ede-object (ede-buffer-object)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
818 (if (and (not ede-object) ede-object-project) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
819 (ede-auto-add-to-target)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
820 (ede-apply-target-options)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
821 ;; If we fail to have a project here, turn it back off. |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
822 (ede-minor-mode -1))))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
823 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
824 (defun ede-reset-all-buffers (onoff) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
825 "Reset all the buffers due to change in EDE. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
826 ONOFF indicates enabling or disabling the mode." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
827 (let ((b (buffer-list))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
828 (while b |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
829 (when (buffer-file-name (car b)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
830 (ede-buffer-object (car b)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
831 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
832 (setq b (cdr b))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
833 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
834 ;;;###autoload |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
835 (define-minor-mode global-ede-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
836 "Toggle global EDE (Emacs Development Environment) mode. |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
837 With non-nil argument ARG, enable global EDE mode if ARG is |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
838 positive; otherwise, disable it. |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
839 |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
840 This global minor mode enables `ede-minor-mode' in all buffers in |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
841 an EDE controlled project." |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
842 :global t |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
843 :group 'ede |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
844 (if global-ede-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
845 ;; Turn on global-ede-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
846 (progn |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
847 (if semantic-mode |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
848 (define-key cedet-menu-map [cedet-menu-separator] '("--"))) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
849 (add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
850 (add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
851 (add-hook 'ecb-source-path-functions 'ede-ecb-project-paths) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
852 (add-hook 'find-file-hook 'ede-turn-on-hook) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
853 (add-hook 'dired-mode-hook 'ede-turn-on-hook) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
854 (add-hook 'kill-emacs-hook 'ede-save-cache) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
855 (ede-load-cache) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
856 (ede-reset-all-buffers 1)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
857 ;; Turn off global-ede-mode |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105799
diff
changeset
|
858 (define-key cedet-menu-map [cedet-menu-separator] nil) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
859 (remove-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
860 (remove-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
861 (remove-hook 'ecb-source-path-functions 'ede-ecb-project-paths) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
862 (remove-hook 'find-file-hook 'ede-turn-on-hook) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
863 (remove-hook 'dired-mode-hook 'ede-turn-on-hook) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
864 (remove-hook 'kill-emacs-hook 'ede-save-cache) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
865 (ede-save-cache) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
866 (ede-reset-all-buffers -1))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
867 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
868 (defvar ede-ignored-file-alist |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
869 '( "\\.cvsignore$" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
870 "\\.#" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
871 "~$" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
872 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
873 "List of file name patters that EDE will never ask about.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
874 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
875 (defun ede-ignore-file (filename) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
876 "Should we ignore FILENAME?" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
877 (let ((any nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
878 (F ede-ignored-file-alist)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
879 (while (and (not any) F) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
880 (when (string-match (car F) filename) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
881 (setq any t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
882 (setq F (cdr F))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
883 any)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
884 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
885 (defun ede-auto-add-to-target () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
886 "Look for a target that wants to own the current file. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
887 Follow the preference set with `ede-auto-add-method' and get the list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
888 of objects with the `ede-want-file-p' method." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
889 (if ede-object (error "Ede-object already defined for %s" (buffer-name))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
890 (if (or (eq ede-auto-add-method 'never) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
891 (ede-ignore-file (buffer-file-name))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
892 nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
893 (let (wants desires) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
894 ;; Find all the objects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
895 (setq wants (oref (ede-current-project) targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
896 (while wants |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
897 (if (ede-want-file-p (car wants) (buffer-file-name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
898 (setq desires (cons (car wants) desires))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
899 (setq wants (cdr wants))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
900 (if desires |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
901 (cond ((or (eq ede-auto-add-method 'ask) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
902 (and (eq ede-auto-add-method 'multi-ask) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
903 (< 1 (length desires)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
904 (let* ((al (append |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
905 ;; some defaults |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
906 '(("none" . nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
907 ("new target" . new)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
908 ;; If we are in an unparented subdir, |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
909 ;; offer new a subproject |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
910 (if (ede-directory-project-p default-directory) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
911 () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
912 '(("create subproject" . project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
913 ;; Here are the existing objects we want. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
914 (object-assoc-list 'name desires))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
915 (case-fold-search t) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
916 (ans (completing-read |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
917 (format "Add %s to target: " (buffer-file-name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
918 al nil t))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
919 (setq ans (assoc ans al)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
920 (cond ((eieio-object-p (cdr ans)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
921 (ede-add-file (cdr ans))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
922 ((eq (cdr ans) 'new) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
923 (ede-new-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
924 (t nil)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
925 ((or (eq ede-auto-add-method 'always) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
926 (and (eq ede-auto-add-method 'multi-ask) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
927 (= 1 (length desires)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
928 (ede-add-file (car desires))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
929 (t nil)))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
930 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
931 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
932 ;;; Interactive method invocations |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
933 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
934 (defun ede (file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
935 "Start up EDE on something. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
936 Argument FILE is the file or directory to load a project from." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
937 (interactive "fProject File: ") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
938 (if (not (file-exists-p file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
939 (ede-new file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
940 (ede-load-project-file (file-name-directory file)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
941 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
942 (defun ede-new (type &optional name) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
943 "Create a new project starting of project type TYPE. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
944 Optional argument NAME is the name to give this project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
945 (interactive |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
946 (list (completing-read "Project Type: " |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
947 (object-assoc-list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
948 'name |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
949 (let* ((l ede-project-class-files) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
950 (cp (ede-current-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
951 (cs (when cp (object-class cp))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
952 (r nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
953 (while l |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
954 (if cs |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
955 (if (eq (oref (car l) :class-sym) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
956 cs) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
957 (setq r (cons (car l) r))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
958 (if (oref (car l) new-p) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
959 (setq r (cons (car l) r)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
960 (setq l (cdr l))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
961 (when (not r) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
962 (if cs |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
963 (error "No valid interactive sub project types for %s" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
964 cs) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
965 (error "EDE error: Can't fin project types to create"))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
966 r) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
967 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
968 nil t))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
969 ;; Make sure we have a valid directory |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
970 (when (not (file-exists-p default-directory)) |
105325 | 971 (error "Cannot create project in non-existent directory %s" default-directory)) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
972 (when (not (file-writable-p default-directory)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
973 (error "No write permissions for %s" default-directory)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
974 ;; Create the project |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
975 (let* ((obj (object-assoc type 'name ede-project-class-files)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
976 (nobj (let ((f (oref obj file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
977 (pf (oref obj proj-file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
978 ;; We are about to make something new, changing the |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
979 ;; state of existing directories. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
980 (ede-project-directory-remove-hash default-directory) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
981 ;; Make sure this class gets loaded! |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
982 (require f) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
983 (make-instance (oref obj class-sym) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
984 :name (or name (read-string "Name: ")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
985 :directory default-directory |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
986 :file (cond ((stringp pf) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
987 (expand-file-name pf)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
988 ((fboundp pf) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
989 (funcall pf)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
990 (t |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
991 (error |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
992 "Unknown file name specifier %S" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
993 pf))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
994 :targets nil))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
995 (inits (oref obj initializers))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
996 ;; Force the name to match for new objects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
997 (object-set-name-string nobj (oref nobj :name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
998 ;; Handle init args. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
999 (while inits |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1000 (eieio-oset nobj (car inits) (car (cdr inits))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1001 (setq inits (cdr (cdr inits)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1002 (let ((pp (ede-parent-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1003 (when pp |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1004 (ede-add-subproject pp nobj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1005 (ede-commit-project pp))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1006 (ede-commit-project nobj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1007 ;; Have the menu appear |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1008 (setq ede-minor-mode t) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1009 ;; Allert the user |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1010 (message "Project created and saved. You may now create targets.")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1011 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1012 (defmethod ede-add-subproject ((proj-a ede-project) proj-b) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1013 "Add into PROJ-A, the subproject PROJ-B." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1014 (oset proj-a subproj (cons proj-b (oref proj-a subproj)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1015 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1016 (defmethod ede-subproject-relative-path ((proj ede-project) &optional parent-in) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1017 "Get a path name for PROJ which is relative to the parent project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1018 If PARENT is specified, then be relative to the PARENT project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1019 Specifying PARENT is useful for sub-sub projects relative to the root project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1020 (let* ((parent (or parent-in (ede-parent-project proj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1021 (dir (file-name-directory (oref proj file)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1022 (if (and parent (not (eq parent proj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1023 (file-relative-name dir (file-name-directory (oref parent file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1024 ""))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1025 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1026 (defmethod ede-subproject-p ((proj ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1027 "Return non-nil if PROJ is a sub project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1028 (ede-parent-project proj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1029 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1030 (defun ede-invoke-method (sym &rest args) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1031 "Invoke method SYM on the current buffer's project object. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1032 ARGS are additional arguments to pass to method sym." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1033 (if (not ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1034 (error "Cannot invoke %s for %s" (symbol-name sym) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1035 (buffer-name))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1036 ;; Always query a target. There should never be multiple |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1037 ;; projects in a single buffer. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1038 (apply sym (ede-singular-object "Target: ") args)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1039 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1040 (defun ede-rescan-toplevel () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1041 "Rescan all project files." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1042 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1043 (let ((toppath (ede-toplevel-project default-directory)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1044 (ede-deep-rescan t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1045 (project-rescan (ede-load-project-file toppath)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1046 (ede-reset-all-buffers 1) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1047 )) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1048 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1049 (defun ede-new-target (&rest args) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1050 "Create a new target specific to this type of project file. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1051 Different projects accept different arguments ARGS. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1052 Typically you can specify NAME, target TYPE, and AUTOADD, where AUTOADD is |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1053 a string \"y\" or \"n\", which answers the y/n question done interactively." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1054 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1055 (apply 'project-new-target (ede-current-project) args) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1056 (setq ede-object nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1057 (setq ede-object (ede-buffer-object (current-buffer))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1058 (ede-apply-target-options)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1059 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1060 (defun ede-new-target-custom () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1061 "Create a new target specific to this type of project file." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1062 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1063 (project-new-target-custom (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1064 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1065 (defun ede-delete-target (target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1066 "Delete TARGET from the current project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1067 (interactive (list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1068 (let ((ede-object (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1069 (ede-invoke-method 'project-interactive-select-target |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1070 "Target: ")))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1071 ;; Find all sources in buffers associated with the condemned buffer. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1072 (let ((condemned (ede-target-buffers target))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1073 (project-delete-target target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1074 ;; Loop over all project controlled buffers |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1075 (save-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1076 (while condemned |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1077 (set-buffer (car condemned)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1078 (setq ede-object nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1079 (setq ede-object (ede-buffer-object (current-buffer))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1080 (setq condemned (cdr condemned)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1081 (ede-apply-target-options))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1082 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1083 (defun ede-add-file (target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1084 "Add the current buffer to a TARGET in the current project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1085 (interactive (list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1086 (let ((ede-object (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1087 (ede-invoke-method 'project-interactive-select-target |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1088 "Target: ")))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1089 (when (stringp target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1090 (let* ((proj (ede-current-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1091 (ob (object-assoc-list 'name (oref proj targets)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1092 (setq target (cdr (assoc target ob))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1093 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1094 (when (not target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1095 (error "Could not find specified target %S" target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1096 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1097 (project-add-file target (buffer-file-name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1098 (setq ede-object nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1099 (setq ede-object (ede-buffer-object (current-buffer))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1100 (when (not ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1101 (error "Can't add %s to target %s: Wrong file type" |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1102 (file-name-nondirectory (buffer-file-name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1103 (object-name target))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1104 (ede-apply-target-options)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1105 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1106 (defun ede-remove-file (&optional force) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1107 "Remove the current file from targets. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1108 Optional argument FORCE forces the file to be removed without asking." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1109 (interactive "P") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1110 (if (not ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1111 (error "Cannot invoke remove-file for %s" (buffer-name))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1112 (let ((eo (if (listp ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1113 (prog1 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1114 ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1115 (setq force nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1116 (list ede-object)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1117 (while eo |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1118 (if (or force (y-or-n-p (format "Remove from %s? " (ede-name (car eo))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1119 (project-remove-file (car eo) (buffer-file-name))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1120 (setq eo (cdr eo))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1121 (setq ede-object nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1122 (setq ede-object (ede-buffer-object (current-buffer))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1123 (ede-apply-target-options))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1124 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1125 (defun ede-edit-file-target () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1126 "Enter the project file to hand edit the current buffer's target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1127 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1128 (ede-invoke-method 'project-edit-file-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1129 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1130 (defun ede-compile-project () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1131 "Compile the current project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1132 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1133 ;; @TODO - This just wants the root. There should be a better way. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1134 (let ((cp (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1135 (while (ede-parent-project cp) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1136 (setq cp (ede-parent-project cp))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1137 (let ((ede-object cp)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1138 (ede-invoke-method 'project-compile-project)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1139 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1140 (defun ede-compile-selected (target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1141 "Compile some TARGET from the current project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1142 (interactive (list (project-interactive-select-target (ede-current-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1143 "Target to Build: "))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1144 (project-compile-target target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1145 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1146 (defun ede-compile-target () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1147 "Compile the current buffer's associated target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1148 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1149 (ede-invoke-method 'project-compile-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1150 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1151 (defun ede-debug-target () |
105325 | 1152 "Debug the current buffer's associated target." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1153 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1154 (ede-invoke-method 'project-debug-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1155 |
105652
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1156 (defun ede-run-target () |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1157 "Run the current buffer's associated target." |
105652
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1158 (interactive) |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1159 (ede-invoke-method 'project-run-target)) |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1160 |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1161 (defun ede-make-dist () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1162 "Create a distribution from the current project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1163 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1164 (let ((ede-object (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1165 (ede-invoke-method 'project-make-dist))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1166 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1167 ;;; Customization |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1168 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1169 ;; Routines for customizing projects and targets. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1170 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1171 (defvar eieio-ede-old-variables nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1172 "The old variables for a project.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1173 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1174 (defalias 'customize-project 'ede-customize-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1175 (defun ede-customize-project (&optional group) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1176 "Edit fields of the current project through EIEIO & Custom. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1177 Optional GROUP specifies the subgroup of slots to customize." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1178 (interactive "P") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1179 (require 'eieio-custom) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1180 (let* ((ov (oref (ede-current-project) local-variables)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1181 (cp (ede-current-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1182 (group (if group (eieio-read-customization-group cp)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1183 (eieio-customize-object cp group) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1184 (make-local-variable 'eieio-ede-old-variables) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1185 (setq eieio-ede-old-variables ov))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1186 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1187 (defalias 'customize-target 'ede-customize-current-target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1188 (defun ede-customize-current-target(&optional group) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1189 "Edit fields of the current target through EIEIO & Custom. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1190 Optional argument OBJ is the target object to customize. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1191 Optional argument GROUP is the slot group to display." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1192 (interactive "P") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1193 (require 'eieio-custom) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1194 (if (not (obj-of-class-p ede-object ede-target)) |
105325 | 1195 (error "Current file is not part of a target")) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1196 (let ((group (if group (eieio-read-customization-group ede-object)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1197 (ede-customize-target ede-object group))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1198 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1199 (defun ede-customize-target (obj group) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1200 "Edit fields of the current target through EIEIO & Custom. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1201 Optional argument OBJ is the target object to customize. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1202 Optional argument GROUP is the slot group to display." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1203 (require 'eieio-custom) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1204 (if (and obj (not (obj-of-class-p obj ede-target))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1205 (error "No logical target to customize")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1206 (eieio-customize-object obj (or group 'default))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1207 ;;; Target Sorting |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1208 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1209 ;; Target order can be important, but custom doesn't support a way |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1210 ;; to resort items in a list. This function by David Engster allows |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1211 ;; targets to be re-arranged. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1212 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1213 (defvar ede-project-sort-targets-order nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1214 "Variable for tracking target order in `ede-project-sort-targets'.") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1215 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1216 (defun ede-project-sort-targets () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1217 "Create a custom-like buffer for sorting targets of current project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1218 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1219 (let ((proj (ede-current-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1220 (count 1) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1221 current order) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1222 (switch-to-buffer (get-buffer-create "*EDE sort targets*")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1223 (erase-buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1224 (setq ede-object-project proj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1225 (widget-create 'push-button |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1226 :notify (lambda (&rest ignore) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1227 (let ((targets (oref ede-object-project targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1228 cur newtargets) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1229 (while (setq cur (pop ede-project-sort-targets-order)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1230 (setq newtargets (append newtargets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1231 (list (nth cur targets))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1232 (oset ede-object-project targets newtargets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1233 (ede-commit-project ede-object-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1234 (kill-buffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1235 " Accept ") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1236 (widget-insert " ") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1237 (widget-create 'push-button |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1238 :notify (lambda (&rest ignore) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1239 (kill-buffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1240 " Cancel ") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1241 (widget-insert "\n\n") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1242 (setq ede-project-sort-targets-order nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1243 (mapc (lambda (x) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1244 (add-to-ordered-list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1245 'ede-project-sort-targets-order |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1246 x x)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1247 (number-sequence 0 (1- (length (oref proj targets))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1248 (ede-project-sort-targets-list) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1249 (use-local-map widget-keymap) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1250 (widget-setup) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1251 (goto-char (point-min)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1252 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1253 (defun ede-project-sort-targets-list () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1254 "Sort the target list while using `ede-project-sort-targets'." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1255 (save-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1256 (let ((count 0) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1257 (targets (oref ede-object-project targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1258 (inhibit-read-only t) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1259 (inhibit-modification-hooks t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1260 (goto-char (point-min)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1261 (forward-line 2) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1262 (delete-region (point) (point-max)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1263 (while (< count (length targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1264 (if (> count 0) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1265 (widget-create 'push-button |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1266 :notify `(lambda (&rest ignore) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1267 (let ((cur ede-project-sort-targets-order)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1268 (add-to-ordered-list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1269 'ede-project-sort-targets-order |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1270 (nth ,count cur) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1271 (1- ,count)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1272 (add-to-ordered-list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1273 'ede-project-sort-targets-order |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1274 (nth (1- ,count) cur) ,count)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1275 (ede-project-sort-targets-list)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1276 " Up ") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1277 (widget-insert " ")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1278 (if (< count (1- (length targets))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1279 (widget-create 'push-button |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1280 :notify `(lambda (&rest ignore) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1281 (let ((cur ede-project-sort-targets-order)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1282 (add-to-ordered-list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1283 'ede-project-sort-targets-order |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1284 (nth ,count cur) (1+ ,count)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1285 (add-to-ordered-list |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1286 'ede-project-sort-targets-order |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1287 (nth (1+ ,count) cur) ,count)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1288 (ede-project-sort-targets-list)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1289 " Down ") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1290 (widget-insert " ")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1291 (widget-insert (concat " " (number-to-string (1+ count)) ".: " |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1292 (oref (nth (nth count ede-project-sort-targets-order) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1293 targets) name) "\n")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1294 (setq count (1+ count)))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1295 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1296 ;;; Customization hooks |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1297 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1298 ;; These hooks are used when finishing up a customization. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1299 (defmethod eieio-done-customizing ((proj ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1300 "Call this when a user finishes customizing PROJ." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1301 (let ((ov eieio-ede-old-variables) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1302 (nv (oref proj local-variables))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1303 (setq eieio-ede-old-variables nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1304 (while ov |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1305 (if (not (assoc (car (car ov)) nv)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1306 (save-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1307 (mapc (lambda (b) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1308 (set-buffer b) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1309 (kill-local-variable (car (car ov)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1310 (ede-project-buffers proj)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1311 (setq ov (cdr ov))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1312 (mapc (lambda (b) (ede-set-project-variables proj b)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1313 (ede-project-buffers proj)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1314 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1315 (defmethod eieio-done-customizing ((target ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1316 "Call this when a user finishes customizing TARGET." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1317 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1318 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1319 (defmethod ede-commit-project ((proj ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1320 "Commit any change to PROJ to its file." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1321 nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1322 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1323 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1324 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1325 ;;; EDE project placeholder methods |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1326 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1327 (defmethod ede-project-force-load ((this ede-project-placeholder)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1328 "Make sure the placeholder THIS is replaced with the real thing. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1329 Return the new object created in its place." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1330 this |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1331 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1332 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1333 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1334 ;;; EDE project target baseline methods. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1335 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1336 ;; If you are developing a new project type, you need to implement |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1337 ;; all of these methods, unless, of course, they do not make sense |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1338 ;; for your particular project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1339 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1340 ;; Your targets should inherit from `ede-target', and your project |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1341 ;; files should inherit from `ede-project'. Create the appropriate |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1342 ;; methods based on those below. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1343 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1344 (defmethod project-interactive-select-target ((this ede-project-placeholder) prompt) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1345 ; checkdoc-params: (prompt) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1346 "Make sure placeholder THIS is replaced with the real thing, and pass through." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1347 (project-interactive-select-target (ede-project-force-load this) prompt)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1348 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1349 (defmethod project-interactive-select-target ((this ede-project) prompt) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1350 "Interactively query for a target that exists in project THIS. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1351 Argument PROMPT is the prompt to use when querying the user for a target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1352 (let ((ob (object-assoc-list 'name (oref this targets)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1353 (cdr (assoc (completing-read prompt ob nil t) ob)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1354 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1355 (defmethod project-add-file ((this ede-project-placeholder) file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1356 ; checkdoc-params: (file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1357 "Make sure placeholder THIS is replaced with the real thing, and pass through." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1358 (project-add-file (ede-project-force-load this) file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1359 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1360 (defmethod project-add-file ((ot ede-target) file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1361 "Add the current buffer into project project target OT. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1362 Argument FILE is the file to add." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1363 (error "add-file not supported by %s" (object-name ot))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1364 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1365 (defmethod project-remove-file ((ot ede-target) fnnd) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1366 "Remove the current buffer from project target OT. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1367 Argument FNND is an argument." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1368 (error "remove-file not supported by %s" (object-name ot))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1369 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1370 (defmethod project-edit-file-target ((ot ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1371 "Edit the target OT associated w/ this file." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1372 (find-file (oref (ede-current-project) file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1373 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1374 (defmethod project-new-target ((proj ede-project) &rest args) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1375 "Create a new target. It is up to the project PROJ to get the name." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1376 (error "new-target not supported by %s" (object-name proj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1377 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1378 (defmethod project-new-target-custom ((proj ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1379 "Create a new target. It is up to the project PROJ to get the name." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1380 (error "New-target-custom not supported by %s" (object-name proj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1381 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1382 (defmethod project-delete-target ((ot ede-target)) |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1383 "Delete the current target OT from its parent project." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1384 (error "add-file not supported by %s" (object-name ot))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1385 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1386 (defmethod project-compile-project ((obj ede-project) &optional command) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1387 "Compile the entire current project OBJ. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1388 Argument COMMAND is the command to use when compiling." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1389 (error "compile-project not supported by %s" (object-name obj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1390 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1391 (defmethod project-compile-target ((obj ede-target) &optional command) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1392 "Compile the current target OBJ. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1393 Argument COMMAND is the command to use for compiling the target." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1394 (error "compile-target not supported by %s" (object-name obj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1395 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1396 (defmethod project-debug-target ((obj ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1397 "Run the current project target OBJ in a debugger." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1398 (error "debug-target not supported by %s" (object-name obj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1399 |
105652
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1400 (defmethod project-run-target ((obj ede-target)) |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1401 "Run the current project target OBJ." |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1402 (error "run-target not supported by %s" (object-name obj))) |
51bc239bdc37
* cedet/srecode/srt.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
105418
diff
changeset
|
1403 |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1404 (defmethod project-make-dist ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1405 "Build a distribution for the project based on THIS project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1406 (error "Make-dist not supported by %s" (object-name this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1407 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1408 (defmethod project-dist-files ((this ede-project)) |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1409 "Return a list of files that constitute a distribution of THIS project." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1410 (error "Dist-files is not supported by %s" (object-name this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1411 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1412 (defmethod project-rescan ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1413 "Rescan the EDE proj project THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1414 (error "Rescanning a project is not supported by %s" (object-name this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1415 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1416 ;;; Default methods for EDE classes |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1417 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1418 ;; These are methods which you might want to override, but there is |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1419 ;; no need to in most situations because they are either a) simple, or |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1420 ;; b) cosmetic. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1421 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1422 (defmethod ede-name ((this ede-target)) |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1423 "Return the name of THIS target." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1424 (oref this name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1425 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1426 (defmethod ede-target-name ((this ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1427 "Return the name of THIS target, suitable for make or debug style commands." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1428 (oref this name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1429 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1430 (defmethod ede-name ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1431 "Return a short-name for THIS project file. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1432 Do this by extracting the lowest directory name." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1433 (oref this name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1434 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1435 (defmethod ede-description ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1436 "Return a description suitable for the minibuffer about THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1437 (format "Project %s: %d subprojects, %d targets." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1438 (ede-name this) (length (oref this subproj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1439 (length (oref this targets)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1440 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1441 (defmethod ede-description ((this ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1442 "Return a description suitable for the minibuffer about THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1443 (format "Target %s: with %d source files." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1444 (ede-name this) (length (oref this source)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1445 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1446 (defmethod ede-want-file-p ((this ede-target) file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1447 "Return non-nil if THIS target wants FILE." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1448 ;; By default, all targets reference the source object, and let it decide. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1449 (let ((src (ede-target-sourcecode this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1450 (while (and src (not (ede-want-file-p (car src) file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1451 (setq src (cdr src))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1452 src)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1453 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1454 (defmethod ede-want-file-source-p ((this ede-target) file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1455 "Return non-nil if THIS target wants FILE." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1456 ;; By default, all targets reference the source object, and let it decide. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1457 (let ((src (ede-target-sourcecode this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1458 (while (and src (not (ede-want-file-source-p (car src) file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1459 (setq src (cdr src))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1460 src)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1461 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1462 (defun ede-header-file () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1463 "Return the header file for the current buffer. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1464 Not all buffers need headers, so return nil if no applicable." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1465 (if ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1466 (ede-buffer-header-file ede-object (current-buffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1467 nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1468 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1469 (defmethod ede-buffer-header-file ((this ede-project) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1470 "Return nil, projects don't have header files." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1471 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1472 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1473 (defmethod ede-buffer-header-file ((this ede-target) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1474 "There are no default header files in EDE. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1475 Do a quick check to see if there is a Header tag in this buffer." |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1476 (with-current-buffer buffer |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1477 (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1478 (buffer-substring-no-properties (match-beginning 1) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1479 (match-end 1)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1480 (let ((src (ede-target-sourcecode this)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1481 (found nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1482 (while (and src (not found)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1483 (setq found (ede-buffer-header-file (car src) (buffer-file-name)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1484 src (cdr src))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1485 found)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1486 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1487 (defun ede-documentation-files () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1488 "Return the documentation files for the current buffer. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1489 Not all buffers need documentations, so return nil if no applicable. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1490 Some projects may have multiple documentation files, so return a list." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1491 (if ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1492 (ede-buffer-documentation-files ede-object (current-buffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1493 nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1494 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1495 (defmethod ede-buffer-documentation-files ((this ede-project) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1496 "Return all documentation in project THIS based on BUFFER." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1497 ;; Find the info node. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1498 (ede-documentation this)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1499 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1500 (defmethod ede-buffer-documentation-files ((this ede-target) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1501 "Check for some documentation files for THIS. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1502 Also do a quick check to see if there is a Documentation tag in this BUFFER." |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1503 (with-current-buffer buffer |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1504 (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1505 (buffer-substring-no-properties (match-beginning 1) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1506 (match-end 1)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1507 ;; Check the master project |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1508 (let ((cp (ede-toplevel))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1509 (ede-buffer-documentation-files cp (current-buffer)))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1510 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1511 (defmethod ede-documentation ((this ede-project)) |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1512 "Return a list of files that provide documentation. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1513 Documentation is not for object THIS, but is provided by THIS for other |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1514 files in the project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1515 (let ((targ (oref this targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1516 (proj (oref this subproj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1517 (found nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1518 (while targ |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1519 (setq found (append (ede-documentation (car targ)) found) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1520 targ (cdr targ))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1521 (while proj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1522 (setq found (append (ede-documentation (car proj)) found) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1523 proj (cdr proj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1524 found)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1525 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1526 (defmethod ede-documentation ((this ede-target)) |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1527 "Return a list of files that provide documentation. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1528 Documentation is not for object THIS, but is provided by THIS for other |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1529 files in the project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1530 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1531 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1532 (defun ede-html-documentation-files () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1533 "Return a list of HTML documentation files associated with this project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1534 (ede-html-documentation (ede-toplevel)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1535 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1536 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1537 (defmethod ede-html-documentation ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1538 "Return a list of HTML files provided by project THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1539 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1540 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1541 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1542 (defun ede-ecb-project-paths () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1543 "Return a list of all paths for all active EDE projects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1544 This functions is meant for use with ECB." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1545 (let ((p ede-projects) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1546 (d nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1547 (while p |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1548 (setq d (cons (file-name-directory (oref (car p) file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1549 d) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1550 p (cdr p))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1551 d)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1552 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1553 ;;; EDE project-autoload methods |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1554 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1555 (defmethod ede-dir-to-projectfile ((this ede-project-autoload) dir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1556 "Return a full file name of project THIS found in DIR. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1557 Return nil if the project file does not exist." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1558 (let* ((d (file-name-as-directory dir)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1559 (root (ede-project-root-directory this d)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1560 (pf (oref this proj-file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1561 (f (cond ((stringp pf) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1562 (expand-file-name pf (or root d))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1563 ((and (symbolp pf) (fboundp pf)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1564 (funcall pf (or root d))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1565 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1566 (when (and f (file-exists-p f)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1567 f))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1568 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1569 ;;; EDE basic functions |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1570 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1571 (defun ede-add-project-to-global-list (proj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1572 "Add the project PROJ to the master list of projects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1573 On success, return the added project." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1574 (when (not proj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1575 (error "No project created to add to master list")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1576 (when (not (eieio-object-p proj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1577 (error "Attempt to add Non-object to master project list")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1578 (when (not (obj-of-class-p proj ede-project-placeholder)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1579 (error "Attempt to add a non-project to the ede projects list")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1580 (add-to-list 'ede-projects proj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1581 proj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1582 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1583 (defun ede-load-project-file (dir &optional rootreturn) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1584 "Project file independent way to read a project in from DIR. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1585 Optional ROOTRETURN will return the root project for DIR." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1586 ;; Only load if something new is going on. Flush the dirhash. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1587 (ede-project-directory-remove-hash dir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1588 ;; Do the load |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1589 ;;(message "EDE LOAD : %S" file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1590 (let* ((file dir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1591 (path (expand-file-name (file-name-directory file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1592 (pfc (ede-directory-project-p path)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1593 (toppath nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1594 (o nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1595 (cond |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1596 ((not pfc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1597 ;; @TODO - Do we really need to scan? Is this a waste of time? |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1598 ;; Scan upward for a the next project file style. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1599 (let ((p path)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1600 (while (and p (not (ede-directory-project-p p))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1601 (setq p (ede-up-directory p))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1602 (if p (ede-load-project-file p) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1603 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1604 ;; recomment as we go |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1605 ;nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1606 )) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1607 ;; Do nothing if we are buiding an EDE project already |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1608 (ede-constructing |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1609 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1610 ;; Load in the project in question. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1611 (t |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1612 (setq toppath (ede-toplevel-project path)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1613 ;; We found the top-most directory. Check to see if we already |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1614 ;; have an object defining it's project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1615 (setq pfc (ede-directory-project-p toppath t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1616 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1617 ;; See if it's been loaded before |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1618 (setq o (object-assoc (ede-dir-to-projectfile pfc toppath) 'file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1619 ede-projects)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1620 (if (not o) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1621 ;; If not, get it now. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1622 (let ((ede-constructing t)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1623 (setq o (funcall (oref pfc load-type) toppath)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1624 (when (not o) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1625 (error "Project type error: :load-type failed to create a project")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1626 (ede-add-project-to-global-list o))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1627 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1628 ;; Return the found root project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1629 (when rootreturn (set rootreturn o)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1630 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1631 (let (tocheck found) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1632 ;; Now find the project file belonging to FILE! |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1633 (setq tocheck (list o)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1634 (setq file (ede-dir-to-projectfile pfc (expand-file-name path))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1635 (while (and tocheck (not found)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1636 (let ((newbits nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1637 (when (car tocheck) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1638 (if (string= file (oref (car tocheck) file)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1639 (setq found (car tocheck))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1640 (setq newbits (oref (car tocheck) subproj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1641 (setq tocheck |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1642 (append (cdr tocheck) newbits)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1643 (if (not found) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1644 (message "No project for %s, but passes project-p test" file) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1645 ;; Now that the file has been reset inside the project object, do |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1646 ;; the cache maintenance. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1647 (setq ede-project-cache-files |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1648 (delete (oref found file) ede-project-cache-files))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1649 found))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1650 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1651 (defun ede-parent-project (&optional obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1652 "Return the project belonging to the parent directory. |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1653 Returns nil if there is no previous directory. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1654 Optional argument OBJ is an object to find the parent of." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1655 (let* ((proj (or obj ede-object-project)) ;; Current project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1656 (root (if obj (ede-project-root obj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1657 ede-object-root-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1658 ;; This case is a SHORTCUT if the project has defined |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1659 ;; a way to calculate the project root. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1660 (if (and root proj (eq root proj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1661 nil ;; we are at the root. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1662 ;; Else, we may have a nil proj or root. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1663 (let* ((thisdir (if obj (oref obj directory) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1664 default-directory)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1665 (updir (ede-up-directory thisdir))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1666 (when updir |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1667 ;; If there was no root, perhaps we can derive it from |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1668 ;; updir now. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1669 (let ((root (or root (ede-directory-get-toplevel-open-project updir)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1670 (or |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1671 ;; This lets us find a subproject under root based on updir. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1672 (and root |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1673 (ede-find-subproject-for-directory root updir)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1674 ;; Try the all structure based search. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1675 (ede-directory-get-open-project updir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1676 ;; Load up the project file as a last resort. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1677 ;; Last resort since it uses file-truename, and other |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1678 ;; slow features. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1679 (and (ede-directory-project-p updir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1680 (ede-load-project-file |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1681 (file-name-as-directory updir)))))))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1682 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1683 (defun ede-current-project (&optional dir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1684 "Return the current project file. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1685 If optional DIR is provided, get the project for DIR instead." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1686 (let ((ans nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1687 ;; If it matches the current directory, do we have a pre-existing project? |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1688 (when (and (or (not dir) (string= dir default-directory)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1689 ede-object-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1690 (setq ans ede-object-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1691 ) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1692 ;; No current project. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1693 (when (not ans) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1694 (let* ((ldir (or dir default-directory))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1695 (setq ans (ede-directory-get-open-project ldir)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1696 (or ans |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1697 ;; No open project, if this dir pass project-p, then load. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1698 (when (ede-directory-project-p ldir) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1699 (setq ans (ede-load-project-file ldir)))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1700 ;; Return what we found. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1701 ans)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1702 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1703 (defun ede-buffer-object (&optional buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1704 "Return the target object for BUFFER. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1705 This function clears cached values and recalculates." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1706 (save-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1707 (if (not buffer) (setq buffer (current-buffer))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1708 (set-buffer buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1709 (setq ede-object nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1710 (let ((po (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1711 (if po (setq ede-object (ede-find-target po buffer)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1712 (if (= (length ede-object) 1) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1713 (setq ede-object (car ede-object))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1714 ede-object)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1715 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1716 (defmethod ede-target-in-project-p ((proj ede-project) target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1717 "Is PROJ the parent of TARGET? |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1718 If TARGET belongs to a subproject, return that project file." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1719 (if (and (slot-boundp proj 'targets) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1720 (memq target (oref proj targets))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1721 proj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1722 (let ((s (oref proj subproj)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1723 (ans nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1724 (while (and s (not ans)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1725 (setq ans (ede-target-in-project-p (car s) target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1726 (setq s (cdr s))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1727 ans))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1728 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1729 (defun ede-target-parent (target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1730 "Return the project which is the parent of TARGET. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1731 It is recommended you track the project a different way as this function |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1732 could become slow in time." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1733 ;; @todo - use ede-object-project as a starting point. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1734 (let ((ans nil) (projs ede-projects)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1735 (while (and (not ans) projs) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1736 (setq ans (ede-target-in-project-p (car projs) target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1737 projs (cdr projs))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1738 ans)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1739 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1740 (defun ede-maybe-checkout (&optional buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1741 "Check BUFFER out of VC if necessary." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1742 (save-excursion |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1743 (if buffer (set-buffer buffer)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1744 (if (and buffer-read-only vc-mode |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1745 (y-or-n-p "Checkout Makefile.am from VC? ")) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1746 (vc-toggle-read-only)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1747 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1748 (defmethod ede-find-target ((proj ede-project) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1749 "Fetch the target in PROJ belonging to BUFFER or nil." |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1750 (with-current-buffer buffer |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1751 (or ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1752 (if (ede-buffer-mine proj buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1753 proj |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1754 (let ((targets (oref proj targets)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1755 (f nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1756 (while targets |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1757 (if (ede-buffer-mine (car targets) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1758 (setq f (cons (car targets) f))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1759 (setq targets (cdr targets))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1760 f))))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1761 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1762 (defmethod ede-target-buffer-in-sourcelist ((this ede-target) buffer source) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1763 "Return non-nil if object THIS is in BUFFER to a SOURCE list. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1764 Handles complex path issues." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1765 (member (ede-convert-path this (buffer-file-name buffer)) source)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1766 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1767 (defmethod ede-buffer-mine ((this ede-project) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1768 "Return non-nil if object THIS lays claim to the file in BUFFER." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1769 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1770 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1771 (defmethod ede-buffer-mine ((this ede-target) buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1772 "Return non-nil if object THIS lays claim to the file in BUFFER." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1773 (condition-case nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1774 (ede-target-buffer-in-sourcelist this buffer (oref this source)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1775 ;; An error implies a bad match. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1776 (error nil))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1777 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1778 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1779 ;;; Project mapping |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1780 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1781 (defun ede-project-buffers (project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1782 "Return a list of all active buffers controlled by PROJECT. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1783 This includes buffers controlled by a specific target of PROJECT." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1784 (let ((bl (buffer-list)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1785 (pl nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1786 (while bl |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1787 (with-current-buffer (car bl) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1788 (if (and ede-object (eq (ede-current-project) project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1789 (setq pl (cons (car bl) pl)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1790 (setq bl (cdr bl))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1791 pl)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1792 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1793 (defun ede-target-buffers (target) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1794 "Return a list of buffers that are controlled by TARGET." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1795 (let ((bl (buffer-list)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1796 (pl nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1797 (while bl |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1798 (with-current-buffer (car bl) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1799 (if (if (listp ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1800 (memq target ede-object) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1801 (eq ede-object target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1802 (setq pl (cons (car bl) pl)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1803 (setq bl (cdr bl))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1804 pl)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1805 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1806 (defun ede-buffers () |
105325 | 1807 "Return a list of all buffers controlled by an EDE object." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1808 (let ((bl (buffer-list)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1809 (pl nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1810 (while bl |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1811 (with-current-buffer (car bl) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1812 (if ede-object |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1813 (setq pl (cons (car bl) pl)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1814 (setq bl (cdr bl))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1815 pl)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1816 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1817 (defun ede-map-buffers (proc) |
105325 | 1818 "Execute PROC on all buffers controlled by EDE." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1819 (mapcar proc (ede-buffers))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1820 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1821 (defmethod ede-map-project-buffers ((this ede-project) proc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1822 "For THIS, execute PROC on all buffers belonging to THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1823 (mapcar proc (ede-project-buffers this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1824 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1825 (defmethod ede-map-target-buffers ((this ede-target) proc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1826 "For THIS, execute PROC on all buffers belonging to THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1827 (mapcar proc (ede-target-buffers this))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1828 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1829 ;; other types of mapping |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1830 (defmethod ede-map-subprojects ((this ede-project) proc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1831 "For object THIS, execute PROC on all direct subprojects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1832 This function does not apply PROC to sub-sub projects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1833 See also `ede-map-all-subprojects'." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1834 (mapcar proc (oref this subproj))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1835 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1836 (defmethod ede-map-all-subprojects ((this ede-project) allproc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1837 "For object THIS, execute PROC on THIS and all subprojects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1838 This function also applies PROC to sub-sub projects. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1839 See also `ede-map-subprojects'." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1840 (apply 'append |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1841 (list (funcall allproc this)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1842 (ede-map-subprojects |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1843 this |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1844 (lambda (sp) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1845 (ede-map-all-subprojects sp allproc)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1846 ))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1847 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1848 ;; (ede-map-all-subprojects (ede-load-project-file "../semantic/") (lambda (sp) (oref sp file))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1849 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1850 (defmethod ede-map-targets ((this ede-project) proc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1851 "For object THIS, execute PROC on all targets." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1852 (mapcar proc (oref this targets))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1853 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1854 (defmethod ede-map-any-target-p ((this ede-project) proc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1855 "For project THIS, map PROC to all targets and return if any non-nil. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1856 Return the first non-nil value returned by PROC." |
105260
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104524
diff
changeset
|
1857 (eval (cons 'or (ede-map-targets this proc)))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1858 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1859 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1860 ;;; Some language specific methods. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1861 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1862 ;; These items are needed by ede-cpp-root to add better support for |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1863 ;; configuring items for Semantic. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1864 (defun ede-apply-preprocessor-map () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1865 "Apply preprocessor tables onto the current buffer." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1866 (when (and ede-object (boundp 'semantic-lex-spp-macro-symbol-obarray)) |
106431
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1867 (let* ((objs ede-object) |
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1868 (map (ede-preprocessor-map (if (consp objs) |
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1869 (car objs) |
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1870 objs)))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1871 (when map |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1872 ;; We can't do a require for the below symbol. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1873 (setq semantic-lex-spp-macro-symbol-obarray |
106431
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1874 (semantic-lex-make-spp-table map))) |
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1875 (when (consp objs) |
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1876 (message "Choosing preprocessor syms for project %s" |
4ffa662ec661
* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
Chong Yidong <cyd@stupidchicken.com>
parents:
105842
diff
changeset
|
1877 (object-name (car objs))))))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1878 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1879 (defmethod ede-system-include-path ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1880 "Get the system include path used by project THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1881 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1882 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1883 (defmethod ede-preprocessor-map ((this ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1884 "Get the pre-processor map for project THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1885 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1886 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1887 (defmethod ede-system-include-path ((this ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1888 "Get the system include path used by project THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1889 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1890 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1891 (defmethod ede-preprocessor-map ((this ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1892 "Get the pre-processor map for project THIS." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1893 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1894 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1895 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1896 ;;; Project-local variables |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1897 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1898 (defun ede-make-project-local-variable (variable &optional project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1899 "Make VARIABLE project-local to PROJECT." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1900 (if (not project) (setq project (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1901 (if (assoc variable (oref project local-variables)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1902 nil |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1903 (oset project local-variables (cons (list variable) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1904 (oref project local-variables))) |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1905 (dolist (b (ede-project-buffers project)) |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1906 (with-current-buffer b |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1907 (make-local-variable variable))))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1908 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1909 (defmethod ede-set-project-variables ((project ede-project) &optional buffer) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1910 "Set variables local to PROJECT in BUFFER." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1911 (if (not buffer) (setq buffer (current-buffer))) |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1912 (with-current-buffer buffer |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1913 (dolist (v (oref project local-variables)) |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1914 (make-local-variable (car v)) |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1915 ;; set it's value here? |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1916 (set (car v) (cdr v))))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1917 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1918 (defun ede-set (variable value &optional proj) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1919 "Set the project local VARIABLE to VALUE. |
105325 | 1920 If VARIABLE is not project local, just use set. Optional argument PROJ |
1921 is the project to use, instead of `ede-current-project'." | |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1922 (let ((p (or proj (ede-current-project))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1923 a) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1924 (if (and p (setq a (assoc variable (oref p local-variables)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1925 (progn |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1926 (setcdr a value) |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1927 (dolist (b (ede-project-buffers p)) |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1928 (with-current-buffer b |
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105652
diff
changeset
|
1929 (set variable value)))) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1930 (set variable value)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1931 (ede-commit-local-variables p)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1932 value) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1933 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1934 (defmethod ede-commit-local-variables ((proj ede-project)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1935 "Commit change to local variables in PROJ." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1936 nil) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1937 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1938 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1939 ;;; Accessors for more complex types where oref is inappropriate. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1940 ;; |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1941 (defmethod ede-target-sourcecode ((this ede-target)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1942 "Return the sourcecode objects which THIS permits." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1943 (let ((sc (oref this sourcetype)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1944 (rs nil)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1945 (while (and (listp sc) sc) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1946 (setq rs (cons (symbol-value (car sc)) rs) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1947 sc (cdr sc))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1948 rs)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1949 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1950 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1951 ;;; Debugging. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1952 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1953 (defun ede-adebug-project () |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1954 "Run adebug against the current EDE project. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1955 Display the results as a debug list." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1956 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1957 (require 'data-debug) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1958 (when (ede-current-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1959 (data-debug-new-buffer "*Analyzer ADEBUG*") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1960 (data-debug-insert-object-slots (ede-current-project) "") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1961 )) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1962 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1963 (defun ede-adebug-project-parent () |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1964 "Run adebug against the current EDE parent project. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1965 Display the results as a debug list." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1966 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1967 (require 'data-debug) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1968 (when (ede-parent-project) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1969 (data-debug-new-buffer "*Analyzer ADEBUG*") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1970 (data-debug-insert-object-slots (ede-parent-project) "") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1971 )) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1972 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1973 (defun ede-adebug-project-root () |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1974 "Run adebug against the current EDE parent project. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1975 Display the results as a debug list." |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1976 (interactive) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1977 (require 'data-debug) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1978 (when (ede-toplevel) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1979 (data-debug-new-buffer "*Analyzer ADEBUG*") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1980 (data-debug-insert-object-slots (ede-toplevel) "") |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1981 )) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1982 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1983 ;;; Hooks & Autoloads |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1984 ;; |
107146
149c0b848923
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1985 ;; These let us watch various activities, and respond appropriately. |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1986 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1987 ;; (add-hook 'edebug-setup-hook |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1988 ;; (lambda () |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1989 ;; (def-edebug-spec ede-with-projectfile |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1990 ;; (form def-body)))) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1991 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1992 (provide 'ede) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1993 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1994 ;; Include this last because it depends on ede. |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1995 (require 'ede/files) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1996 |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1997 ;; If this does not occur after the provide, we can get a recursive |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1998 ;; load. Yuck! |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1999 (if (featurep 'speedbar) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2000 (ede-speedbar-file-setup) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2001 (add-hook 'speedbar-load-hook 'ede-speedbar-file-setup)) |
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2002 |
105377 | 2003 ;; arch-tag: 0e1e0eba-484f-4119-abdb-30951f725705 |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2004 ;;; ede.el ends here |