Commit b3253cd4 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

merge trunk

parents 4be9765d e5fa3899
......@@ -36,19 +36,19 @@
(declare-function inversion-find-version "inversion")
(defconst cedet-version "1.0pre7"
(defconst cedet-version "1.0"
"Current version of CEDET.")
(defconst cedet-packages
(cedet ,cedet-version)
(eieio "1.2")
(semantic "2.0pre7")
(srecode "1.0pre7")
(ede "1.0pre7")
(speedbar "1.0.3"))
"Table of CEDET packages to install.")
(eieio "1.3")
(semantic "2.0")
(srecode "1.0")
(ede "1.0")
(speedbar "1.0"))
"Table of CEDET packages installed.")
(defvar cedet-menu-map ;(make-sparse-keymap "CEDET menu")
(let ((map (make-sparse-keymap "CEDET menu")))
This diff is collapsed.
;;; ede/auto.el --- Autoload features for EDE
;; Copyright (C) 2010 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <>.
;;; Commentary:
;; EDE Autoloads are a way to refer to different project types without
;; loading those projects into Emacs.
;; These routines are used to detect a project in a filesystem before
;; handing over control to the usual EDE project system.
;;; Code:
(require 'eieio)
(defclass ede-project-autoload ()
((name :initarg :name
:documentation "Name of this project type")
(file :initarg :file
:documentation "The lisp file belonging to this class.")
(proj-file :initarg :proj-file
:documentation "Name of a project file of this type.")
(proj-root :initarg :proj-root
:type function
:documentation "A function symbol to call for the project root.
This function takes no arguments, and returns the current directories
root, if available. Leave blank to use the EDE directory walking
routine instead.")
(initializers :initarg :initializers
:initform nil
"Initializers passed to the project object.
These are used so there can be multiple types of projects
associated with a single object class, based on the initilizeres used.")
(load-type :initarg :load-type
:documentation "Fn symbol used to load this project file.")
(class-sym :initarg :class-sym
:documentation "Symbol representing the project class to use.")
(new-p :initarg :new-p
:initform t
"Non-nil if this is an option when a user creates a project.")
"Class representing minimal knowledge set to run preliminary EDE functions.
When more advanced functionality is needed from a project type, that projects
type is required and the load function used.")
(defvar ede-project-class-files
(ede-project-autoload "edeproject-makefile"
:name "Make" :file 'ede/proj
:proj-file "Project.ede"
:load-type 'ede-proj-load
:class-sym 'ede-proj-project)
(ede-project-autoload "edeproject-automake"
:name "Automake" :file 'ede/proj
:proj-file "Project.ede"
:initializers '(:makefile-type
:load-type 'ede-proj-load
:class-sym 'ede-proj-project)
(ede-project-autoload "automake"
:name "automake" :file 'ede/project-am
:proj-file ""
:load-type 'project-am-load
:class-sym 'project-am-makefile
:new-p nil))
"List of vectors defining how to determine what type of projects exist.")
;;; EDE project-autoload methods
(defmethod ede-project-root ((this ede-project-autoload))
"If a project knows its root, return it here.
Allows for one-project-object-for-a-tree type systems."
(defmethod ede-project-root-directory ((this ede-project-autoload)
&optional file)
"If a project knows its root, return it here.
Allows for one-project-object-for-a-tree type systems.
Optional FILE is the file to test. If there is no FILE, use
the current buffer."
(when (not file)
(setq file default-directory))
(when (slot-boundp this :proj-root)
(let ((rootfcn (oref this proj-root)))
(when rootfcn
(condition-case nil
(funcall rootfcn file)
(funcall rootfcn)))
(defmethod ede-dir-to-projectfile ((this ede-project-autoload) dir)
"Return a full file name of project THIS found in DIR.
Return nil if the project file does not exist."
(let* ((d (file-name-as-directory dir))
(root (ede-project-root-directory this d))
(pf (oref this proj-file))
(f (cond ((stringp pf)
(expand-file-name pf (or root d)))
((and (symbolp pf) (fboundp pf))
(funcall pf (or root d)))))
(when (and f (file-exists-p f))
(provide 'ede/auto)
;;; ede/auto.el ends here
......@@ -27,20 +27,8 @@
;;; Code:
(require 'autoconf)
(defvar autoconf-new-automake-string
"dnl Process this file with autoconf to produce a configure script
dnl End the configure script.
AC_OUTPUT(Makefile, [date > stamp-h] )\n"
"This string is used to initialize a new
The default is designed to be used with automake.
The first %s will be filled with the test file.
The second %s will be filled with the program name.")
(declare-function ede-srecode-setup "ede/srecode")
(declare-function ede-srecode-insert "ede/srecode")
(defun autoconf-new-program (rootdir program testfile)
"Initialize a new in ROOTDIR for PROGRAM using TESTFILE.
......@@ -49,6 +37,7 @@ PROGRAM is the program to be configured.
TESTFILE is the file used with AC_INIT.
configure the initial configure script using `autoconf-new-automake-string'"
(interactive "DRoot Dir: \nsProgram: \nsTest File: ")
(require 'ede/srecode)
(if (bufferp rootdir)
(set-buffer rootdir)
(let ((cf1 (expand-file-name "" rootdir))
......@@ -62,7 +51,12 @@ configure the initial configure script using `autoconf-new-automake-string'"
(find-file cf2)))
;; Note, we only ask about overwrite if a string/path is specified.
(insert (format autoconf-new-automake-string testfile program)))
"TEST_FILE" testfile
"PROGRAM" program)
(defvar autoconf-preferred-macro-order
......@@ -151,42 +145,44 @@ From the autoconf manual:
(looking-at (concat "\\(A[CM]_" macro "\\|" macro "\\)"))))
(defun autoconf-find-last-macro (macro)
(defun autoconf-find-last-macro (macro &optional ignore-bol)
"Move to the last occurrence of MACRO in FILE, and return that point.
The last macro is usually the one in which we would like to insert more
items such as CHECK_HEADERS."
(let ((op (point)))
(let ((op (point)) (atbol (if ignore-bol "" "^")))
(goto-char (point-max))
(if (re-search-backward (concat "^" (regexp-quote macro) "\\s-*\\((\\|$\\)") nil t)
(if (re-search-backward (concat atbol (regexp-quote macro) "\\s-*\\((\\|$\\)") nil t)
(unless ignore-bol (beginning-of-line))
(goto-char op)
(defun autoconf-parameter-strip (param)
"Strip the parameter PARAM of whitespace and miscellaneous characters."
(when (string-match "^\\s-*\\[?\\s-*" param)
;; force greedy match for \n.
(when (string-match "\\`\n*\\s-*\\[?\\s-*" param)
(setq param (substring param (match-end 0))))
(when (string-match "\\s-*\\]?\\s-*$" param)
(when (string-match "\\s-*\\]?\\s-*\\'" param)
(setq param (substring param 0 (match-beginning 0))))
(defun autoconf-parameters-for-macro (macro)
(defun autoconf-parameters-for-macro (macro &optional ignore-bol ignore-case)
"Retrieve the parameters to MACRO.
Returns a list of the arguments passed into MACRO as strings."
(when (autoconf-find-last-macro macro)
(forward-sexp 1)
(when (looking-at "(")
(let* ((start (+ (point) 1))
(end (save-excursion
(forward-sexp 1)
(- (point) 1)))
(ans (buffer-substring-no-properties start end)))
(split-string ans "," t)))))))
(let ((case-fold-search ignore-case))
(when (autoconf-find-last-macro macro ignore-bol)
(forward-sexp 1)
(when (looking-at "(")
(let* ((start (+ (point) 1))
(end (save-excursion
(forward-sexp 1)
(- (point) 1)))
(ans (buffer-substring-no-properties start end)))
(split-string ans "," t))))))))
(defun autoconf-position-for-macro (macro)
"Position the cursor where a new MACRO could be inserted.
This diff is collapsed.
......@@ -131,7 +131,7 @@
;; (add-to-list 'ede-project-class-files
;; (ede-project-autoload "cpp-root"
;; :name "CPP ROOT"
;; :file 'ede-cpp-root
;; :file 'ede/cpp-root
;; :proj-file 'MY-FILE-FOR-DIR
;; :proj-root 'MY-ROOT-FCN
;; :load-type 'MY-LOAD
......@@ -237,6 +237,18 @@ ROOTPROJ is nil, since there is only one project."
;; Snoop through our master list.
(ede-cpp-root-file-existing dir))
(add-to-list 'ede-project-class-files
(ede-project-autoload "cpp-root"
:name "CPP ROOT"
:file 'ede/cpp-root
:proj-file 'ede-cpp-root-project-file-for-dir
:proj-root 'ede-cpp-root-project-root
:load-type 'ede-cpp-root-load
:class-sym 'ede-cpp-root
:new-p nil)
;; EDE sets up projects with two kinds of objects.
......@@ -504,6 +516,21 @@ Also set up the lexical preprocessor map."
"Get the pre-processor map for project THIS."
(ede-preprocessor-map (ede-target-parent this)))
;;; Quick Hack
(defun ede-create-lots-of-projects-under-dir (dir projfile &rest attributes)
"Create a bunch of projects under directory DIR.
PROJFILE is a file name sans directory that indicates a subdirectory
is a project directory.
Generic ATTRIBUTES, such as :include-path can be added.
Note: This needs some work."
(let ((files (directory-files dir t)))
(dolist (F files)
(if (file-exists-p (expand-file-name projfile F))
`(ede-cpp-root-project (file-name-nondirectory F)
:name (file-name-nondirectory F)
:file (expand-file-name projfile F)
(provide 'ede/cpp-root)
;; Local variables:
This diff is collapsed.
......@@ -76,11 +76,11 @@ negative, force off."
"Add files to Target: "))))
(dolist (file (dired-get-marked-files t))
(project-add-file target file)
;; Find the buffer for this files, and set it's ede-object
;; Find the buffer for this files, and set its ede-object
(if (get-file-buffer file)
(with-current-buffer (get-file-buffer file)
(setq ede-object nil)
(setq ede-object (ede-buffer-object (current-buffer)))))))
(with-current-buffer (get-file-buffer file)
(setq ede-object nil)
(setq ede-object (ede-buffer-object (current-buffer)))))))
(provide 'ede/dired)
......@@ -133,6 +133,18 @@ ROOTPROJ is nil, since there is only one project."
(add-to-list 'ede-project-class-files
(ede-project-autoload "emacs"
:name "EMACS ROOT"
:file 'ede/emacs
:proj-file "src/emacs.c"
:proj-root 'ede-emacs-project-root
:load-type 'ede-emacs-load
:class-sym 'ede-emacs-project
:new-p nil)
(defclass ede-emacs-target-c (ede-target)
"EDE Emacs Project target for C code.
......@@ -150,7 +162,7 @@ All directories need at least one target.")
(defmethod initialize-instance ((this ede-emacs-project)
&rest fields)
"Make sure the :file is fully expanded."
"Make sure the targets slot is bound."
(unless (slot-boundp this 'targets)
(oset this :targets nil)))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -126,7 +126,11 @@ don't do it. A value of nil means to just do it.")
(while compilation-in-progress
(sit-for 1))
;; If sit for indicates that input is waiting, then
;; read and discard whatever it is that is going on.
(when (not (sit-for 1))
(read-event nil nil .1)
(with-current-buffer "*compilation*"
(goto-char (point-max))
This diff is collapsed.
......@@ -29,7 +29,7 @@
(defclass ede-proj-target-makefile-archive
((availablelinkers :initform (ede-archive-linker)))
((availablelinkers :initform '(ede-archive-linker)))
"This target generates an object code archive.")
(defvar ede-archive-linker
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment