annotate lisp/cedet/ede/custom.el @ 112408:04c350138c72

* man.el (Man-highlight-references0): Use make-button (Bug#7881).
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 21 Jan 2011 22:53:06 -0500
parents 376148b31b5e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
110526
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 ;;; ede.el --- customization of EDE projects.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 110526
diff changeset
3 ;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
110526
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 ;; Author: Eric M. Ludlam <zappo@gnu.org>
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; the Free Software Foundation, either version 3 of the License, or
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; (at your option) any later version.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;;; Commentary:
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;; Customization commands/hooks for EDE.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; EIEIO supports customizing objects, and EDE uses this to allow
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 ;; users to change basic settings in their projects.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;;; Code:
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 ;;; Customization
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 ;; Routines for customizing projects and targets.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 (require 'ede)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 (eval-when-compile (require 'eieio-custom))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 (defvar eieio-ede-old-variables nil
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 "The old variables for a project.")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41 ;;; Customization Commands
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 ;; These commands initialize custoization of EDE control objects.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 ;;;###autoload
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 (defun ede-customize-project ()
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 "Edit fields of the current project through EIEIO & Custom."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 (interactive)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 (require 'eieio-custom)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (let* ((ov (oref (ede-current-project) local-variables))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 (cp (ede-current-project)))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 (ede-customize cp)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53 (make-local-variable 'eieio-ede-old-variables)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 (setq eieio-ede-old-variables ov)))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 ;;;###autoload
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 (defalias 'customize-project 'ede-customize-project)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 ;;;###autoload
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 (defun ede-customize-current-target()
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61 "Edit fields of the current target through EIEIO & Custom."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62 (interactive)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 (require 'eieio-custom)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 (if (not (obj-of-class-p ede-object ede-target))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65 (error "Current file is not part of a target"))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 (ede-customize-target ede-object))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 ;;;###autoload
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 (defalias 'customize-target 'ede-customize-current-target)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 (defun ede-customize-target (obj)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 "Edit fields of the current target through EIEIO & Custom.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 OBJ is the target object to customize."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 (require 'eieio-custom)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 (if (and obj (not (obj-of-class-p obj ede-target)))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 (error "No logical target to customize"))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 (ede-customize obj))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79 (defmethod ede-customize ((proj ede-project))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 "Customize the EDE project PROJ."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81 (eieio-customize-object proj 'default))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 (defmethod ede-customize ((target ede-target))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 "Customize the EDE TARGET."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 (eieio-customize-object target 'default))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 ;;; Target Sorting
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 ;; Target order can be important, but custom doesn't support a way
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 ;; to resort items in a list. This function by David Engster allows
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 ;; targets to be re-arranged.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 (defvar ede-project-sort-targets-order nil
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 "Variable for tracking target order in `ede-project-sort-targets'.")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 ;;;###autoload
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97 (defun ede-project-sort-targets ()
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 "Create a custom-like buffer for sorting targets of current project."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 (interactive)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 (let ((proj (ede-current-project))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 (count 1)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 current order)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 (switch-to-buffer (get-buffer-create "*EDE sort targets*"))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 (erase-buffer)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 (setq ede-object-project proj)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 (widget-create 'push-button
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 :notify (lambda (&rest ignore)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 (let ((targets (oref ede-object-project targets))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 cur newtargets)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 (while (setq cur (pop ede-project-sort-targets-order))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111 (setq newtargets (append newtargets
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 (list (nth cur targets)))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113 (oset ede-object-project targets newtargets))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 (ede-commit-project ede-object-project)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 (kill-buffer))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 " Accept ")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 (widget-insert " ")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118 (widget-create 'push-button
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 :notify (lambda (&rest ignore)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 (kill-buffer))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
121 " Cancel ")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 (widget-insert "\n\n")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 (setq ede-project-sort-targets-order nil)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124 (mapc (lambda (x)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125 (add-to-ordered-list
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 'ede-project-sort-targets-order
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 x x))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 (number-sequence 0 (1- (length (oref proj targets)))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 (ede-project-sort-targets-list)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130 (use-local-map widget-keymap)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 (widget-setup)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132 (goto-char (point-min))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 (defun ede-project-sort-targets-list ()
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135 "Sort the target list while using `ede-project-sort-targets'."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 (save-excursion
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 (let ((count 0)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 (targets (oref ede-object-project targets))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 (inhibit-read-only t)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 (inhibit-modification-hooks t))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 (goto-char (point-min))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 (forward-line 2)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143 (delete-region (point) (point-max))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 (while (< count (length targets))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 (if (> count 0)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146 (widget-create 'push-button
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 :notify `(lambda (&rest ignore)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 (let ((cur ede-project-sort-targets-order))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 (add-to-ordered-list
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150 'ede-project-sort-targets-order
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (nth ,count cur)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 (1- ,count))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 (add-to-ordered-list
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 'ede-project-sort-targets-order
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 (nth (1- ,count) cur) ,count))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 (ede-project-sort-targets-list))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 " Up ")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158 (widget-insert " "))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 (if (< count (1- (length targets)))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 (widget-create 'push-button
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 :notify `(lambda (&rest ignore)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 (let ((cur ede-project-sort-targets-order))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 (add-to-ordered-list
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 'ede-project-sort-targets-order
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 (nth ,count cur) (1+ ,count))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166 (add-to-ordered-list
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 'ede-project-sort-targets-order
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 (nth (1+ ,count) cur) ,count))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 (ede-project-sort-targets-list))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170 " Down ")
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 (widget-insert " "))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172 (widget-insert (concat " " (number-to-string (1+ count)) ".: "
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173 (oref (nth (nth count ede-project-sort-targets-order)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174 targets) name) "\n"))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 (setq count (1+ count))))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177 ;;; Customization hooks
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178 ;;
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 ;; These hooks are used when finishing up a customization.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 (defmethod eieio-done-customizing ((proj ede-project))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 "Call this when a user finishes customizing PROJ."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182 (let ((ov eieio-ede-old-variables)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183 (nv (oref proj local-variables)))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184 (setq eieio-ede-old-variables nil)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
185 (while ov
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186 (if (not (assoc (car (car ov)) nv))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187 (save-excursion
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188 (mapc (lambda (b)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 (set-buffer b)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190 (kill-local-variable (car (car ov))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (ede-project-buffers proj))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192 (setq ov (cdr ov)))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193 (mapc (lambda (b) (ede-set-project-variables proj b))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194 (ede-project-buffers proj))))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 ;; These two methods should be implemented by subclasses of
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
197 ;; project and targets in order to account for user specified
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198 ;; changes.
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199 (defmethod eieio-done-customizing ((target ede-target))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 "Call this when a user finishes customizing TARGET."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 nil)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 (defmethod ede-commit-project ((proj ede-project))
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 "Commit any change to PROJ to its file."
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 nil
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206 )
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 (provide 'ede/custom)
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210 ;; Local variables:
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 ;; generated-autoload-file: "loaddefs.el"
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 ;; generated-autoload-load-name: "ede/custom"
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 ;; End:
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214
b150a06c6999 Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 ;;; ede/custom.el ends here