annotate lisp/progmodes/ada-prj.el @ 33853:eb4affa4abc6

(lface_from_face_name): Function comment fix.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 24 Nov 2000 13:17:42 +0000
parents 01ac16657214
children dd613770eb0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; @(#) ada-prj.el --- Easy editing of project files for the ada-mode
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
3 ;; Copyright (C) 1998-1999 Free Software Foundation, Inc.
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5 ;; Author: Emmanuel Briot <briot@gnat.com>
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
6 ;; Ada Core Technologies's version: $Revision: 1.44 $
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 ;; Keywords: languages, ada, project file
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 ;; This file is not part of GNU Emacs.
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11 ;; This program is free software; you can redistribute it and/or modify
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; any later version.
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 ;; This program is distributed in the hope that it will be useful,
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25 ;;; This package provides a set of functions to easily edit the project
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26 ;;; files used by the ada-mode.
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
27 ;;; The only function publicly available here is `ada-customize'.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
28 ;;; See the documentation of the Ada mode for more information on the project
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
29 ;;; files.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
30 ;;; Internally, a project file is represented as a property list, with each
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
31 ;;; field of the project file matching one property of the list.
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 ;; Code:
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 ;; ----- Requirements -----------------------------------------------------
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 (require 'cus-edit)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
40 ;; ----- Buffer local variables -------------------------------------------
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
42 (defvar ada-prj-current-values nil
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
43 "Hold the current value of the fields, This is a property list.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
44 (make-variable-buffer-local 'ada-prj-current-values)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
46 (defvar ada-prj-default-values nil
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
47 "Hold the default value for the fields, This is a property list.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
48 (make-variable-buffer-local 'ada-prj-default-values)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
49
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
50 (defvar ada-prj-ada-buffer nil
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
51 "Indicates what Ada source file was being edited.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
52
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
53
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
54 ;; ----- Functions --------------------------------------------------------
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
56 (defun ada-prj-new ()
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
57 "Open a new project file"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
58 (interactive)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
59 (let* ((prj
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
60 (if (my-local-variable-if-set-p 'ada-prj-prj-file (current-buffer))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
61 ada-prj-prj-file
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
62 "default.adp"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
63 (filename (read-file-name "Project file: "
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
64 (if prj "" nil)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
65 nil
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
66 nil
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
67 prj)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
68 (if (not (string= (file-name-extension filename t) ".adp"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
69 (error "File name extension for project files must be .adp"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
70
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
71 (ada-customize nil filename)))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
73 (defun ada-prj-edit ()
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
74 "Editing the project file associated with the current Ada buffer.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
75 If there is none, opens a new project file"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
76 (interactive)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
77 (let ((file (ada-prj-find-prj-file)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
78 (if file
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
79 (progn
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
80 (ada-reread-prj-file file)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
81 (ada-customize))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
82 (ada-prj-new))))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 (defun ada-prj-add-ada-menu ()
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
85 "Add a new submenu to the Ada menu.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
86 The items are added to the menu NAME in map MAP. NAME should be the same
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
87 name as was passed to `ada-create-menu'."
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88 (if ada-xemacs
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
89 (progn
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
90 (funcall (symbol-function 'add-menu-button)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
91 '("Ada" "Project")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
92 ["Edit" ada-prj-edit t] "Associate")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
93 (funcall (symbol-function 'add-menu-button)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
94 '("Ada" "Project")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
95 ["New..." ada-prj-new t] "Associate"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
96 (define-key (lookup-key ada-mode-map [menu-bar Ada Project])
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
97 [Edit] '("Edit current" . ada-prj-edit))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
98 (define-key (lookup-key ada-mode-map [menu-bar Ada Project])
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
99 [New] '("New" . ada-prj-new))))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 (defun ada-prj-add-keymap ()
26227
1be4a89d81d3 Doc-string fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 25901
diff changeset
102 "Add new keybindings for ada-prj."
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
103 (define-key ada-mode-map "\C-cu" 'ada-prj-edit))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
104
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
105 (defun ada-prj-initialize-values (symbol ada-buffer &optional filename)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
106 "Set SYMBOL to the property list of the project file FILENAME.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
107 If FILENAME is null, read the file associated with ADA-BUFFER. If no
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
108 project file is found, returns the default values."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
109
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
110 (let ((prj filename))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
111
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
112 (if filename
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
113 ;; If filename is given, reread if first if needed
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
114 (if (file-exists-p filename)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
115 (ada-reread-prj-file))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
116
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
117 ;; Else use the one from the current buffer
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
118 (save-excursion
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
119 (set-buffer ada-buffer)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
120 (set 'prj ada-prj-prj-file)))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
122
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
123 (if (and prj
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
124 (not (string= prj ""))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
125 (assoc prj ada-xref-project-files))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
126 (set symbol (copy-sequence (cdr (assoc prj ada-xref-project-files))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
127
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
128 ;; Set default values (except for the file name if this was given
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
129 ;; in the buffer
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
130 (ada-xref-set-default-prj-values symbol ada-buffer)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
131 (if (and prj (not (string= prj "")))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
132 (set symbol (plist-put (eval symbol) 'filename prj)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
133 )))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
134
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
135
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
136 (defun ada-prj-save-specific-option (field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
137 "Returns the string to print in the project file to save FIELD.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
138 If the current value of FIELD is the default value, returns an empty string."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
139 (if (string= (plist-get ada-prj-current-values field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
140 (plist-get ada-prj-default-values field))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
141 ""
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
142 (concat (symbol-name field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
143 "=" (plist-get ada-prj-current-values field) "\n")))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
144
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 (defun ada-prj-save ()
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
146 "Save the edited project file."
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 (interactive)
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
148 (let ((file-name (plist-get ada-prj-current-values 'filename))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
149 output)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
150 (set 'output
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
151 (concat
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
152
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
153 ;; Save the fields that do not depend on the current buffer
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
154 ;; only if they are different from the default value
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
155
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
156 (ada-prj-save-specific-option 'comp_opt)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
157 (ada-prj-save-specific-option 'bind_opt)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
158 (ada-prj-save-specific-option 'link_opt)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
159 (ada-prj-save-specific-option 'gnatmake_opt)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
160 (ada-prj-save-specific-option 'cross_prefix)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
161 (ada-prj-save-specific-option 'remote_machine)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
162 (ada-prj-save-specific-option 'comp_cmd)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
163 (ada-prj-save-specific-option 'check_cmd)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
164 (ada-prj-save-specific-option 'make_cmd)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
165 (ada-prj-save-specific-option 'run_cmd)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
166 (ada-prj-save-specific-option 'debug_cmd)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
167
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
168 ;; Always save the fields that depend on the current buffer
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
169 (concat "main=" (plist-get ada-prj-current-values 'main) "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
170 (concat "main_unit=" (plist-get ada-prj-current-values 'main_unit) "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
171 (concat "build_dir=" (plist-get ada-prj-current-values 'build_dir) "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
172
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
173 (ada-prj-set-list "casing"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
174 (plist-get ada-prj-current-values 'casing)) "\n"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
175 (ada-prj-set-list "src_dir"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
176 (plist-get ada-prj-current-values 'src_dir)) "\n"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
177 (ada-prj-set-list "obj_dir"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
178 (plist-get ada-prj-current-values 'obj_dir)) "\n"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
179 ))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
180
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
181 (find-file file-name)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182 (erase-buffer)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 (insert output)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
184 (save-buffer)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
185 ;; kill the project buffer
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
186 (kill-buffer nil)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
187
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
188 ;; kill the editor buffer
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
189 (kill-buffer "*Customize Ada Mode*")
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
190
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191 ;; automatically associates the current buffer with the
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
192 ;; new project file
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
193 (set (make-local-variable 'ada-prj-prj-file) file-name)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
194
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
195 ;; force Emacs to reread the project files
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
196 (ada-reread-prj-file file-name)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
197 )
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
198 )
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
200 (defun ada-prj-load-from-file (symbol)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
201 "Load SYMBOL value from file. One item per line should be found in the file."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
202 (save-excursion
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
203 (let ((file (read-file-name "File name: " nil nil t))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
204 (buffer (current-buffer))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
205 line
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
206 list)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
207 (find-file file)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
208 (widen)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
209 (goto-char (point-min))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
210 (while (not (eobp))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
211 (set 'line (buffer-substring-no-properties
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
212 (point) (save-excursion (end-of-line) (point))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
213 (add-to-list 'list line)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
214 (forward-line 1)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
215 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
216 (kill-buffer nil)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
217 (set-buffer buffer)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
218 (set 'ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
219 (plist-put ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
220 symbol
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
221 (append (plist-get ada-prj-current-values symbol)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
222 (reverse list))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
223 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
224 (ada-prj-display-page 2)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
225 ))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
226
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
227 (defun ada-prj-subdirs-of (dir)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
228 "Returns a list of all the subdirectories of dir, recursively."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
229 (let ((subdirs (directory-files dir t "^[^.].*"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
230 (dirlist (list dir)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
231 (while subdirs
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
232 (if (file-directory-p (car subdirs))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
233 (let ((sub (ada-prj-subdirs-of (car subdirs))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
234 (if sub
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
235 (set 'dirlist (append sub dirlist)))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
236 (set 'subdirs (cdr subdirs)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
237 dirlist))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
238
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
239 (defun ada-prj-load-directory (field &optional file-name)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
240 "Append the content of FILE-NAME to FIELD in the current project file.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
241 If FILE-NAME is nil, ask the user for the name."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
242 (unless file-name
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
243 (set 'file-name (read-file-name "Root directory: " nil nil t)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
244
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
245 (set 'ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
246 (plist-put ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
247 field
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
248 (append (plist-get ada-prj-current-values field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
249 (reverse (ada-prj-subdirs-of
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
250 (expand-file-name file-name))))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
251 (ada-prj-display-page 2))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
252
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
253 (defun ada-prj-display-page (tab-num)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
254 "Display one of the pages available in the notebook. TAB-NUM should have
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
255 a value between 1 and the maximum number of pages.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
256 The current buffer must be the project editing buffer."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
257
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
258 (let ((inhibit-read-only t))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
259 (erase-buffer))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
260
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
261 ;; Display the tabs
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
262
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
263 (widget-insert "\n Project and Editor configuration.\n
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
264 ___________ ____________ ____________ ____________\n / ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
265 (widget-create 'push-button :notify
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
266 (lambda (&rest dummy) (ada-prj-display-page 1)) "General")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
267 (widget-insert " \\ / ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
268 (widget-create 'push-button :notify
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
269 (lambda (&rest dummy) (ada-prj-display-page 2)) "Paths")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
270 (widget-insert " \\ / ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
271 (widget-create 'push-button :notify
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
272 (lambda (&rest dummy) (ada-prj-display-page 3)) "Switches")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
273 (widget-insert " \\ / ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
274 (widget-create 'push-button :notify
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
275 (lambda (&rest dummy) (ada-prj-display-page 4)) "Ada Menu")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
276 (widget-insert " \\\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
277
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
278 ;; Display the currently selected page
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
279
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
280 (cond
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
281
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
282 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
283 ;; First page (General)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
284 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
285 ((= tab-num 1)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
286 (widget-insert "_/ \\/______________\\/______________\\/______________\\_____\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
287
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
288 (widget-insert "Project file name:\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
289 (widget-insert (plist-get ada-prj-current-values 'filename))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
290 (widget-insert "\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
291 ; (ada-prj-field 'filename "Project file name"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
292 ; "Enter the name and directory of the project
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
293 ; file. The name of the file should be the
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
294 ; name of the project itself. The extension
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
295 ; must be .adp")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
296 ; (ada-prj-field 'casing "Casing Exceptions Dictionnaries"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
297 ; "List of files that contain casing exception
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
298 ; dictionnaries. All these files contain one
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
299 ; identifier per line, with a special casing.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
300 ; The first file has the highest priority."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
301 ; t)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
302 (ada-prj-field 'main "Executable file name"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
303 "Name of the executable generated when you
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
304 compile your application. This should include
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
305 the full directory name, using ${build_dir} if
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
306 you wish.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
307 (ada-prj-field 'main_unit "File name of the main unit"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
308 "Name of the file to pass to the gnatmake command,
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
309 and that will create the executable.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
310 This should not include any directory specification.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
311 (ada-prj-field 'build_dir "Build directory"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
312 "Reference directory for relative paths in
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
313 src_dir and obj_dir below. This is also the directory
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
314 where the compilation is done.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
315 (ada-prj-field 'remote_machine "Name of the remote machine (if any)"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
316 "If you want to remotely compile, debug and
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
317 run your application, specify the name of a
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
318 remote machine here. This capability requires
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
319 the 'rsh' protocol on the remote machine.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
320 (ada-prj-field 'cross_prefix "Prefix used in for the cross tool chain"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
321 "When working on multiple cross targets, it is
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
322 most convenient to specify the prefix of the
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
323 tool chain here. For instance, on PowerPc
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
324 vxworks, you would enter 'powerpc-wrs-vxworks-'.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
325 To use JGNAT, enter 'j'.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
326 )
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
327
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
328
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
329 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
330 ;; Second page (Paths)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
331 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
332 ((= tab-num 2)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
333 (widget-insert "_/_____________\\/ \\/______________\\/______________\\_____\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
334 (ada-prj-field 'src_dir "Source directories"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
335 "Enter the list of directories where your Ada
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
336 sources can be found. These directories will be
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
337 used for the cross-references and for the default
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
338 compilation commands.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
339 Note that src_dir includes both the build directory
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
340 and the standard runtime."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
341 t t
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
342 (mapconcat (lambda(x)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
343 (concat " " x))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
344 ada-xref-runtime-library-specs-path
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
345 "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
346 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
347 (widget-insert "\n\n")
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
348
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
349 (ada-prj-field 'obj_dir "Object directories"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
350 "Enter the list of directories where the GNAT
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
351 library files (ALI files) can be found. These
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
352 files are used for cross-references and by the
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
353 gnatmake command.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
354 Note that obj_dir includes both the build directory
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
355 and the standard runtime."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
356 t t
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
357 (mapconcat (lambda(x)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
358 (concat " " x))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
359 ada-xref-runtime-library-ali-path
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
360 "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
361 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
362 (widget-insert "\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
363 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
364
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
365 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
366 ;; Third page (Switches)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
367 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
368 ((= tab-num 3)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
369 (widget-insert "_/_____________\\/______________\\/ \\/______________\\_____\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
370 (ada-prj-field 'comp_opt "Switches for the compiler"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
371 "These switches are used in the default
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
372 compilation commands, both for compiling a
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
373 single file and rebuilding the whole project")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
374 (ada-prj-field 'bind_opt "Switches for the binder"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
375 "These switches are used in the default build
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
376 command and are passed to the binder")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
377 (ada-prj-field 'link_opt "Switches for the linker"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
378 "These switches are used in the default build
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
379 command and are passed to the linker")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
380 (ada-prj-field 'gnatmake_opt "Switches for gnatmake"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
381 "These switches are used in the default gnatmake
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
382 command.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
383 )
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
384
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
385 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
386 ;; Fourth page
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
387 ;;
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
388 ((= tab-num 4)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
389 (widget-insert "_/_____________\\/______________\\/______________\\/ \\_____\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
390 (widget-insert "All the fields below can use variable substitution\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
391 (widget-insert "The syntax is ${name}, where name is the name that\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
392 (widget-insert "appears after the Help buttons in this buffer.\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
393 (widget-insert "As a special case, ${current} is replaced with the name\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
394 (widget-insert "of the file currently edited, with directory name but\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
395 (widget-insert "no extension.\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
396 (widget-insert
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
397 "The environment variables ADA_INCLUDE_PATH and ADA_OBJECTS_PATH\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
398 (widget-insert
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
399 "are set to ${src_dir} and ${obj_dir} before running the compilation\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
400 (widget-insert
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
401 "commands, so that you don't need to specify the -aI and -aO\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
402 (widget-insert
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
403 "switches on the command line\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
404
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
405 (ada-prj-field 'check_cmd
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
406 "Check syntax of a single file (menu Ada->Check File)"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
407 "This command is run to check the syntax and semantics of a file.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
408 The file name is added at the end of this command.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
409 (ada-prj-field 'comp_cmd
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
410 "Compiling a single file (menu Ada->Compile File)"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
411 "This command is run when the recompilation
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
412 of a single file is needed. The file name is
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
413 added at the end of this command.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
414 (ada-prj-field 'make_cmd "Rebuilding the whole project (menu Ada->Build)"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
415 "This command is run when you want to rebuild
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
416 your whole application. It is never issues
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
417 automatically and you will need to ask for it.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
418 If remote_machine has been set, this command
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
419 will be executed on the remote machine.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
420 (ada-prj-field 'run_cmd "Running the application (menu Ada->Run)"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
421 "This command specifies how to run the
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
422 application, including any switch you need to
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
423 specify. If remote_machine has been set, this
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
424 command will be executed on the remote host.")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
425 (ada-prj-field 'debug_cmd "Debugging the application"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
426 "Specifies how to debug the application, possibly
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
427 remotely if remote_machine has been set. We
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
428 recommend the following debuggers:
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
429 > gdb
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
430 > gdbtk
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
431 > ddd --tty -fullname -toolbar")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
432 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
433 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
434
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
435
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
436 (widget-insert "______________________________________________________________________\n\n ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
437 (widget-create 'push-button
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
438 :notify (lambda (&rest ignore)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
439 (ada-xref-set-default-prj-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
440 'ada-prj-current-values ada-prj-ada-buffer)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
441 (ada-prj-display-page 1))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
442 "Reset to Default Values")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
443 (widget-insert " ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
444 (widget-create 'push-button :notify (lambda (&rest ignore) (kill-buffer nil))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
445 "Cancel")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
446 (widget-insert " ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
447 (widget-create 'push-button :notify (lambda (&rest ignore) (ada-prj-save))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
448 "Save")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
449 (widget-insert "\n\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
450
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
451 (widget-setup)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
452 (beginning-of-buffer)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
453 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
454
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
455
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
456 (defun ada-customize (&optional new-file filename)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
457 "Edit the project file associated with the current buffer.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
458 If there is none or NEW-FILE is non-nil, make a new one.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
459 If FILENAME is given, edit that file."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
460 (interactive)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
461
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
462 (let ((ada-buffer (current-buffer))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
463 (inhibit-read-only t))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
464
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
465 (ada-require-project-file)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
466
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
467 (switch-to-buffer "*Customize Ada Mode*")
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
468 (kill-all-local-variables)
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
469
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
470 (ada-xref-set-default-prj-values 'ada-prj-default-values ada-buffer)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
471 (ada-prj-initialize-values 'ada-prj-current-values ada-buffer filename)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
472
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
473 (set (make-local-variable 'ada-prj-ada-buffer) ada-buffer)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
474
26227
1be4a89d81d3 Doc-string fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 25901
diff changeset
475 (use-local-map (copy-keymap custom-mode-map))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
476 (local-set-key "\C-x\C-s" 'ada-prj-save)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
477
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
478 (make-local-variable 'widget-keymap)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
479 (define-key widget-keymap "\C-x\C-s" 'ada-prj-save)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
480
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
481 (ada-prj-display-page 1)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
482 ))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
483
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
484 ;; ---------------- Utilities --------------------------------
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
485
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
486 (defun ada-prj-set-list (string ada-dir-list)
26227
1be4a89d81d3 Doc-string fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 25901
diff changeset
487 "Join the strings in ADA-DIR-LIST into a single string. Each name is put
1be4a89d81d3 Doc-string fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 25901
diff changeset
488 on a separate line that begins with STRING."
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
489 (mapconcat (lambda (x) (concat string "=" (file-name-as-directory x)))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
490 ada-dir-list "\n"))
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
491
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
492
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
493 (defun ada-prj-get-prj-dir (&optional ada-file)
26227
1be4a89d81d3 Doc-string fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 25901
diff changeset
494 "Returns the directory/name of the project file for ADA-FILE.
1be4a89d81d3 Doc-string fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 25901
diff changeset
495 If ADA-FILE is nil, returns the project file for the current buffer."
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
496 (unless ada-file
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
497 (setq ada-file (buffer-file-name)))
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
498
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
499 (save-excursion
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
500 (set-buffer (get-file-buffer ada-file))
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
501
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
502 (let ((prj-file (ada-prj-find-prj-file t)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
503 (if (or (not prj-file)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
504 (not (file-exists-p prj-file))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
505 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
506 (setq prj-file
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
507 (concat (file-name-sans-extension ada-file)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
508 ada-project-file-extension)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
509 prj-file)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
510 ))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
511
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
512 (defun ada-prj-field-modified (widget &rest dummy)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
513 "Callback called each time the value of WIDGET is modified. Save the
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
514 change in ada-prj-current-values so that selecting another page and coming
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
515 back keeps the new value."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
516 (set 'ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
517 (plist-put ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
518 (widget-get widget 'prj-field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
519 (widget-value widget))))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
520
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
521 (defun ada-prj-display-help (widget widget-modified event)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
522 "An help button in WIDGET was clicked on. The parameters are so that
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
523 this function can be used as :notify for the widget."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
524 (let ((text (widget-get widget 'prj-help)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
525 (if event
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
526 ;; If we have a mouse-event, popup a menu
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
527 (widget-choose "Help"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
528 (mapcar (lambda (a) (cons a t))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
529 (split-string text "\n"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
530 event)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
531 ;; Else display the help string just before the next group of
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
532 ;; variables
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
533 (momentary-string-display
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
534 (concat "*****Help*****\n" text "\n**************\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
535 (save-excursion (forward-line) (beginning-of-line) (point)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
536 )))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
537
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
538 (defun ada-prj-show-value (widget widget-modified event)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
539 (let ((value (plist-get ada-prj-current-values
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
540 (widget-get widget 'prj-field)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
541 (inhibit-read-only t))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
542
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
543 ;; If the other widget is already visible, delete it
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
544 (if (widget-get widget 'prj-other-widget)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
545 (progn
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
546 (widget-delete (widget-get widget 'prj-other-widget))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
547 (widget-put widget 'prj-other-widget nil)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
548 (widget-default-value-set widget "Show Value")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
549 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
550
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
551 ;; Else create it
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
552 (save-excursion
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
553 (mouse-set-point event)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
554 (forward-line 1)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
555 (beginning-of-line)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
556 (widget-put widget 'prj-other-widget
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
557 (widget-create 'editable-list
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
558 :entry-format "%i%d %v"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
559 :notify 'ada-prj-field-modified
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
560 :help-echo (widget-get widget 'prj-help)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
561 :value value
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
562 (list 'editable-field
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
563 :keymap widget-keymap)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
564 (widget-default-value-set widget "Hide Value")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
565 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
566 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
567 (widget-setup)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
568 ))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
569
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
570 (defun ada-prj-field (field text help-text &optional is-list is-paths after-text)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
571 "Create a widget to edit FIELD in the current buffer.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
572 TEXT is a short explanation of what the field means, whereas HELP-TEXT
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
573 is the text displayed when the user pressed the help button.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
574 If IS-LIST is non-nil, the field contains a list. Otherwise, it contains
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
575 a single string.
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
576 if IS-PATHS is true, some special buttons are added to load paths,...
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
577 AFTER-TEXT is inserted just after the widget."
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
578 (let ((value (plist-get ada-prj-current-values field))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
579 (inhibit-read-only t)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
580 widget)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
581 (unless value
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
582 (set 'value
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
583 (if is-list '() "")))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
584 (widget-insert text)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
585 (widget-insert ":")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
586 (move-to-column 54 t)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
587 (widget-put (widget-create 'push-button
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
588 :notify 'ada-prj-display-help
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
589 "Help")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
590 'prj-help
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
591 help-text)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
592 (widget-insert (concat " (" (symbol-name field) ")\n"))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
593 (if is-paths
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
594 (progn
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
595 (widget-create 'push-button
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
596 :notify
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
597 (list 'lambda '(&rest dummy) '(interactive)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
598 (list 'ada-prj-load-from-file
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
599 (list 'quote field)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
600 "Load From File")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
601 (widget-insert " ")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
602 (widget-create 'push-button
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
603 :notify
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
604 (list 'lambda '(&rest dummy) '(interactive)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
605 (list 'ada-prj-load-directory
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
606 (list 'quote field)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
607 "Load Recursive Directory")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
608 (widget-insert "\n ${build_dir}\n")))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
609 (set 'widget
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
610 (if is-list
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
611 (if (< (length value) 15)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
612 (widget-create 'editable-list
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
613 :entry-format "%i%d %v"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
614 :notify 'ada-prj-field-modified
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
615 :help-echo help-text
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
616 :value value
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
617 (list 'editable-field :keymap widget-keymap))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
618 (let ((w (widget-create 'push-button
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
619 :notify 'ada-prj-show-value
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
620 "Show value")))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
621 (widget-insert "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
622 (widget-put w 'prj-field field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
623 (widget-put w 'prj-help help-text)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
624 (widget-put w 'prj-other-widget nil)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
625 w)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
626 )
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
627 (widget-create 'editable-field
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
628 :format "%v"
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
629 :notify 'ada-prj-field-modified
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
630 :help-echo help-text
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
631 :keymap widget-keymap
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
632 value)))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
633 (widget-put widget 'prj-field field)
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
634 (if after-text
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
635 (widget-insert after-text))
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
636 (widget-insert "\n")
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
637 ))
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
638
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
639
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
640 ;; Set the keymap once and for all, so that the keys set by the user in his
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
641 ;; config file are not overwritten every time we open a new file.
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
642 (ada-prj-add-keymap)
30410
01ac16657214 Rewritten to show a tabbed-dialog.
Gerd Moellmann <gerd@gnu.org>
parents: 26227
diff changeset
643 (ada-prj-add-ada-menu)
25901
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
644
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
645 (provide 'ada-prj)
9f327fa7ac10 New file.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
646 ;;; package ada-prj.el ends here