• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/progmodes/

Lines Matching defs:ada

0 ;;; ada-prj.el --- GUI editing of project files for the ada-mode
8 ;; Keywords: languages, ada, project file
30 ;;; files used by the ada-mode.
31 ;;; The only function publicly available here is `ada-customize'.
47 (require 'ada-xref)
50 (require 'ada-mode))
54 (defvar ada-prj-current-values nil
56 (make-variable-buffer-local 'ada-prj-current-values)
58 (defvar ada-prj-default-values nil
60 (make-variable-buffer-local 'ada-prj-default-values)
62 (defvar ada-prj-ada-buffer nil
65 (defvar ada-old-cross-prefix nil
71 (defun ada-prj-new ()
75 (if (and ada-prj-default-project-file
76 (not (string= ada-prj-default-project-file "")))
77 ada-prj-default-project-file
87 (ada-customize nil filename)))
89 (defun ada-prj-edit ()
93 (if ada-prj-default-project-file
94 (ada-customize)
95 (ada-prj-new)))
97 (defun ada-prj-initialize-values (symbol ada-buffer filename)
101 ;; FIXME: rationalize arguments; make ada-buffer optional?
104 (assoc filename ada-xref-project-files))
105 (set symbol (copy-sequence (cdr (assoc filename ada-xref-project-files))))
109 (ada-xref-set-default-prj-values symbol ada-buffer)
115 (defun ada-prj-save-specific-option (field)
118 (if (string= (plist-get ada-prj-current-values field)
119 (plist-get ada-prj-default-values field))
122 "=" (plist-get ada-prj-current-values field) "\n")))
124 (defun ada-prj-save ()
127 (let ((file-name (plist-get ada-prj-current-values 'filename))
135 (ada-prj-save-specific-option 'comp_opt)
136 (ada-prj-save-specific-option 'bind_opt)
137 (ada-prj-save-specific-option 'link_opt)
138 (ada-prj-save-specific-option 'gnatmake_opt)
139 (ada-prj-save-specific-option 'gnatfind_opt)
140 (ada-prj-save-specific-option 'cross_prefix)
141 (ada-prj-save-specific-option 'remote_machine)
142 (ada-prj-save-specific-option 'debug_cmd)
145 "main=" (plist-get ada-prj-current-values 'main) "\n"
146 "main_unit=" (plist-get ada-prj-current-values 'main_unit) "\n"
147 "build_dir=" (plist-get ada-prj-current-values 'build_dir) "\n"
148 (ada-prj-set-list "check_cmd"
149 (plist-get ada-prj-current-values 'check_cmd)) "\n"
150 (ada-prj-set-list "make_cmd"
151 (plist-get ada-prj-current-values 'make_cmd)) "\n"
152 (ada-prj-set-list "comp_cmd"
153 (plist-get ada-prj-current-values 'comp_cmd)) "\n"
154 (ada-prj-set-list "run_cmd"
155 (plist-get ada-prj-current-values 'run_cmd)) "\n"
156 (ada-prj-set-list "src_dir"
157 (plist-get ada-prj-current-values 'src_dir)
159 (ada-prj-set-list "obj_dir"
160 (plist-get ada-prj-current-values 'obj_dir)
162 (ada-prj-set-list "debug_pre_cmd"
163 (plist-get ada-prj-current-values 'debug_pre_cmd))
165 (ada-prj-set-list "debug_post_cmd"
166 (plist-get ada-prj-current-values 'debug_post_cmd))
181 (set 'ada-prj-default-project-file file-name)
184 (ada-reread-prj-file file-name)
188 (defun ada-prj-load-from-file (symbol)
206 (set 'ada-prj-current-values
207 (plist-put ada-prj-current-values
209 (append (plist-get ada-prj-current-values symbol)
212 (ada-prj-display-page 2)
215 (defun ada-prj-subdirs-of (dir)
221 (let ((sub (ada-prj-subdirs-of (car subdirs))))
227 (defun ada-prj-load-directory (field &optional file-name)
237 (set 'ada-prj-current-values
238 (plist-put ada-prj-current-values
240 (append (plist-get ada-prj-current-values field)
241 (reverse (ada-prj-subdirs-of
243 (ada-prj-display-page 2))
245 (defun ada-prj-display-page (tab-num)
265 (lambda (&rest dummy) (ada-prj-display-page 1)) "General")
268 (lambda (&rest dummy) (ada-prj-display-page 2)) "Paths")
271 (lambda (&rest dummy) (ada-prj-display-page 3)) "Switches")
274 (lambda (&rest dummy) (ada-prj-display-page 4)) "Ada Menu")
277 (lambda (&rest dummy) (ada-prj-display-page 5)) "Debugger")
291 (widget-insert (plist-get ada-prj-current-values 'filename))
293 ; (ada-prj-field 'filename "Project file name"
298 ; (ada-prj-field 'casing "Casing Exceptions Dictionnaries"
304 (ada-prj-field 'main "Executable file name"
309 (ada-prj-field 'main_unit "File name of the main unit"
313 (ada-prj-field 'build_dir "Build directory"
317 (ada-prj-field 'remote_machine "Name of the remote machine (if any)"
322 (ada-prj-field 'cross_prefix "Prefix used in for the cross tool chain"
335 (if (not (equal (plist-get ada-prj-current-values 'cross_prefix)
336 ada-old-cross-prefix))
338 (setq ada-old-cross-prefix
339 (plist-get ada-prj-current-values 'cross_prefix))
340 (ada-initialize-runtime-library ada-old-cross-prefix)))
344 (ada-prj-field 'src_dir "Source directories"
354 ada-xref-runtime-library-specs-path
359 (ada-prj-field 'obj_dir "Object directories"
369 ada-xref-runtime-library-ali-path
380 (ada-prj-field 'comp_opt "Switches for the compiler"
384 (ada-prj-field 'bind_opt "Switches for the binder"
387 (ada-prj-field 'link_opt "Switches for the linker"
390 (ada-prj-field 'gnatmake_opt "Switches for gnatmake"
393 (ada-prj-field 'gnatfind_opt "Switches for gnatfind"
419 (ada-prj-field 'check_cmd
423 (ada-prj-field 'comp_cmd
428 (ada-prj-field 'make_cmd "Rebuilding the whole project (menu Ada->Build)"
434 (ada-prj-field 'run_cmd "Running the application (menu Ada->Run)"
446 (ada-prj-field 'debug_pre_cmd "Commands to execute before launching the
451 (ada-prj-field 'debug_cmd "Debugging the application"
459 (ada-prj-field 'debug_post_cmd "Commands to execute in the debugger"
471 (ada-xref-set-default-prj-values
472 'ada-prj-current-values ada-prj-ada-buffer)
473 (ada-prj-display-page 1))
479 (widget-create 'push-button :notify (lambda (&rest ignore) (ada-prj-save))
489 (defun ada-customize (&optional new-file filename)
495 (let ((ada-buffer (current-buffer))
498 ;; We can only edit interactively the standard ada-mode project files. If
500 ;; `ada-load-project-hook', we simply edit the file
503 (or ada-prj-default-project-file filename)
505 (or filename ada-prj-default-project-file))
508 (find-file ada-prj-default-project-file)
509 (add-hook 'after-save-hook 'ada-reread-prj-file t t)
513 (ada-reread-prj-file filename)
514 (if (not (string= ada-prj-default-project-file ""))
515 (ada-reread-prj-file ada-prj-default-project-file)
516 (ada-reread-prj-file)))
521 (ada-xref-set-default-prj-values 'ada-prj-default-values ada-buffer)
522 (ada-prj-initialize-values 'ada-prj-current-values
523 ada-buffer
524 ada-prj-default-project-file)
526 (set (make-local-variable 'ada-prj-ada-buffer) ada-buffer)
529 (local-set-key "\C-x\C-s" 'ada-prj-save)
532 (define-key widget-keymap "\C-x\C-s" 'ada-prj-save)
534 (set (make-local-variable 'ada-old-cross-prefix)
535 (ada-xref-get-project-field 'cross-prefix))
537 (ada-prj-display-page 1)
542 (defun ada-prj-set-list (string ada-list &optional is-directory)
551 ada-list "\n"))
554 (defun ada-prj-field-modified (widget &rest dummy)
557 Save the change in `ada-prj-current-values' so that selecting
559 (set 'ada-prj-current-values
560 (plist-put ada-prj-current-values
564 (defun ada-prj-display-help (widget widget-modified event)
581 (defun ada-prj-show-value (widget widget-modified event)
585 (value (plist-get ada-prj-current-values field))
605 :notify 'ada-prj-field-modified
618 (defun ada-prj-field (field text help-text &optional is-list is-paths after-text)
626 (let ((value (plist-get ada-prj-current-values field))
636 :notify 'ada-prj-display-help
646 (list 'ada-prj-load-from-file
653 (list 'ada-prj-load-directory
663 :notify 'ada-prj-field-modified
669 :notify 'ada-prj-show-value
678 :notify 'ada-prj-field-modified
689 (provide 'ada-prj)
692 ;;; ada-prj.el ends here