Mercurial > emacs
view lisp/cedet/ede/simple.el @ 105885:8103235103a7
Let integers use up 2 tags to give them one extra bit and double their range.
* lisp.h (USE_2_TAGS_FOR_INTS): New macro.
(LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P): New macros.
(enum Lisp_Type): Use them. Give explicit values.
(Lisp_Type_Limit): Remove.
(XINT, XUINT, make_number) [!USE_LISP_UNION_TYPE]:
(MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
Pay attention to USE_2_TAGS_FOR_INTS.
(INTEGERP): Use LISP_INT_TAG_P.
* fns.c (internal_equal): Simplify the default case.
(sxhash): Use case_Lisp_Int.
* data.c (wrong_type_argument): Don't check against Lisp_Type_Limit any more.
(Ftype_of): Use case_Lisp_Int.
(store_symval_forwarding): Take into account the fact that Ints can
now have more than one tag.
* buffer.c (syms_of_buffer): Use LISP_INT_TAG.
buffer_slot_type_mismatch):
* xfaces.c (face_attr_equal_p):
* print.c (print_object):
* alloc.c (mark_maybe_object, mark_object, survives_gc_p): Use case_Lisp_Int.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 06 Nov 2009 18:47:48 +0000 |
parents | 7f4c7f5c0eba |
children | 1d1d5d9bd884 |
line wrap: on
line source
;;; ede/simple.el --- Overlay an EDE structure on an existing project ;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam <eric@siege-engine.com> ;; 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 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; 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 <http://www.gnu.org/licenses/>. ;;; Commentary: ;; ;; A vast majority of projects use non-EDE project techniques, such ;; as hand written Makefiles, or other IDE's. ;; ;; The EDE-SIMPLE project type allows EDE to wrap an existing mechanism ;; with minimal configuration, and then provides project-root ;; information to Semantic or other tools, and also provides structure ;; information for in-project include header discovery, or speedbar ;; support. ;; ;; It will also support a the minimal EDE UI for compilation and ;; configuration. ;; @todo - Add support for cpp-root as an ede-simple project. ;; @todo - Allow ede-simple to store locally. (require 'ede) (require 'cedet-files) ;;; Code: (defcustom ede-simple-save-directory "~/.ede" "*Directory where simple EDE project overlays are saved." :group 'ede :type 'directory) (defcustom ede-simple-save-file-name "ProjSimple.ede" "*File name used for simple project wrappers." :group 'ede :type 'string) (defun ede-simple-projectfile-for-dir (&optional dir) "Return a full file name to the project file stored in the current directory. The directory has three parts: <STORAGE ROOT>/<PROJ DIR AS FILE>/ProjSimple.ede" (let ((d (or dir default-directory))) (concat ;; Storage root (file-name-as-directory (expand-file-name ede-simple-save-directory)) ;; Convert directory to filename (cedet-directory-name-to-file-name d) ;; Filename ede-simple-save-file-name) )) (defun ede-simple-load (dir &optional rootproj) "Load a project of type `Simple' for the directory DIR. Return nil if there isn't one. ROOTPROJ is nil, since we will only create a single EDE project here." (let ((pf (ede-simple-projectfile-for-dir dir)) (obj nil)) (when pf (setq obj (eieio-persistent-read pf)) (oset obj :directory dir) ) obj)) (defclass ede-simple-target (ede-target) () "EDE Simple project target. All directories need at least one target.") (defclass ede-simple-project (ede-project eieio-persistent) ((extension :initform ".ede") (file-header-line :initform ";; EDE Simple Project") ) "EDE Simple project class. Each directory needs a a project file to control it.") (defmethod ede-commit-project ((proj ede-simple-project)) "Commit any change to PROJ to its file." (when (not (file-exists-p ede-simple-save-directory)) (if (y-or-n-p (concat ede-simple-save-directory " doesn't exist. Create? ")) (make-directory ede-simple-save-directory) (error "No save directory for new project"))) (eieio-persistent-save proj)) (defmethod ede-find-subproject-for-directory ((proj ede-simple-project) dir) "Return PROJ, for handling all subdirs below DIR." proj) (provide 'ede/simple) ;; arch-tag: a0c4264a-89ce-4364-afab-2512acd3b22a ;;; ede/simple.el ends here