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