1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00
emacs/lisp/emacs-lisp/eieio-core.el

1198 lines
46 KiB
EmacsLisp
Raw Normal View History

;;; eieio-core.el --- Core implementation for eieio -*- lexical-binding:t -*-
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Copyright (C) 1995-1996, 1998-2016 Free Software Foundation, Inc.
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Version: 1.4
;; Keywords: OO, lisp
;; 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:
;;
;; The "core" part of EIEIO is the implementation for the object
;; system (such as eieio-defclass, or eieio-defmethod) but not the
;; base classes for the object system, which are defined in EIEIO.
;;
;; See the commentary for eieio.el for more about EIEIO itself.
;;; Code:
(require 'cl-lib)
(require 'pcase)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;;
;; A few functions that are better in the official EIEIO src, but
;; used from the core.
(declare-function slot-unbound "eieio")
(declare-function slot-missing "eieio")
(declare-function child-of-class-p "eieio")
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(declare-function same-class-p "eieio")
(declare-function object-of-class-p "eieio")
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;;
;; Variable declarations.
;;
(defvar eieio-hook nil
"This hook is executed, then cleared each time `defclass' is called.")
(defvar eieio-error-unsupported-class-tags nil
"Non-nil to throw an error if an encountered tag is unsupported.
This may prevent classes from CLOS applications from being used with EIEIO
since EIEIO does not support all CLOS tags.")
(defvar eieio-skip-typecheck nil
"If non-nil, skip all slot typechecking.
Set this to t permanently if a program is functioning well to get a
small speed increase. This variable is also used internally to handle
default setting for optimization purposes.")
(defvar eieio-optimize-primary-methods-flag t
"Non-nil means to optimize the method dispatch on primary methods.")
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(defvar eieio-backward-compatibility t
"If nil, drop support for some behaviors of older versions of EIEIO.
Currently under control of this var:
- Define every class as a var whose value is the class symbol.
- Define <class>-child-p and <class>-list-p predicates.
- Allow object names in constructors.")
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defconst eieio-unbound
(if (and (boundp 'eieio-unbound) (symbolp eieio-unbound))
eieio-unbound
(make-symbol "unbound"))
"Uninterned symbol representing an unbound slot in an object.")
;; This is a bootstrap for eieio-default-superclass so it has a value
;; while it is being built itself.
(defvar eieio-default-superclass nil)
(progn
;; Arrange for field access not to bother checking if the access is indeed
;; made to an eieio--class object.
(cl-declaim (optimize (safety 0)))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(cl-defstruct (eieio--class
(:constructor nil)
(:constructor eieio--class-make (name))
(:include cl--class)
(:copier nil))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
children
initarg-tuples ;; initarg tuples list
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(class-slots nil :type eieio--slot)
class-allocation-values ;; class allocated value vector
default-object-cache ;; what a newly created object would look like.
; This will speed up instantiation time as
; only a `copy-sequence' will be needed, instead of
; looping over all the values and setting them from
; the default.
options ;; storage location of tagged class option
; Stored outright without modifications or stripping
)
;; Set it back to the default value.
(cl-declaim (optimize (safety 1))))
(cl-defstruct (eieio--object
(:type vector) ;We manage our own tagging system.
(:constructor nil)
(:copier nil))
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
;; `class-tag' holds a symbol, which is not the class name, but is instead
;; properly prefixed as an internal EIEIO thingy and which holds the class
;; object/struct in its `symbol-value' slot.
class-tag)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(eval-when-compile
(defconst eieio--object-num-slots
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(length (cl-struct-slot-info 'eieio--object))))
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(defsubst eieio--object-class (obj)
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(symbol-value (eieio--object-class-tag obj)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;; Important macros used internally in eieio.
(require 'cl-macs) ;For cl--find-class.
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(defsubst eieio--class-object (class)
"Return the class object."
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(if (symbolp class)
;; Keep the symbol if class-v is nil, for better error messages.
(or (cl--find-class class) class)
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
class))
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(defun class-p (x)
"Return non-nil if X is a valid class vector.
X can also be is a symbol."
(eieio--class-p (if (symbolp x) (cl--find-class x) x)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defun eieio--class-print-name (class)
"Return a printed representation of CLASS."
(format "#<class %s>" (eieio-class-name class)))
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(defun eieio-class-name (class)
"Return a Lisp like symbol name for CLASS."
(setq class (eieio--class-object class))
(cl-check-type class eieio--class)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(eieio--class-name class))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
(defalias 'eieio--class-constructor #'identity
"Return the symbol representing the constructor of CLASS.")
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defmacro eieio--class-option-assoc (list option)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return from LIST the found OPTION, or nil if it doesn't exist."
`(car-safe (cdr (memq ,option ,list))))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defsubst eieio--class-option (class option)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return the value stored for CLASS' OPTION.
Return nil if that option doesn't exist."
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-option-assoc (eieio--class-options class) option))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(defun eieio-object-p (obj)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return non-nil if OBJ is an EIEIO object."
(and (vectorp obj)
(> (length obj) 0)
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(let ((tag (eieio--object-class-tag obj)))
(and (symbolp tag)
;; (eq (symbol-function tag) :quick-object-witness-check)
(boundp tag)
(eieio--class-p (symbol-value tag))))))
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(define-obsolete-function-alias 'object-p 'eieio-object-p "25.1")
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defun class-abstract-p (class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return non-nil if CLASS is abstract.
Abstract classes cannot be instantiated."
(eieio--class-option (cl--find-class class) :abstract))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defsubst eieio--class-method-invocation-order (class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return the invocation order of CLASS.
Abstract classes cannot be instantiated."
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(or (eieio--class-option class :method-invocation-order)
:breadth-first))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;;
;; Class Creation
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
(defvar eieio-defclass-autoload-map (make-hash-table)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Symbol map of superclasses we find in autoloads.")
;; We autoload this because it's used in `make-autoload'.
;;;###autoload
Improve handling of doc-strings and describe-function for cl-generic * lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long as it's a symbol. (help-fns-short-filename): New function. (describe-function-1): Use it. Use autoload-do-load. * lisp/help-mode.el (help-function-def): Add optional arg `type'. * lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to override an autoload. (cl-generic-current-method-specializers): Replace dyn-bind variable with a lexically-scoped macro. (cl--generic-lambda): Update accordingly. (cl-generic-define-method): Record manually in the load-history with type `cl-defmethod'. (cl--generic-get-dispatcher): Minor optimization. (cl--generic-search-method): New function. (find-function-regexp-alist): Add entry for `cl-defmethod' type. (cl--generic-search-method): Add hyperlinks for methods. Merge the specializers and the function's arguments. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el. (eieio-defclass-autoload): Don't record the superclasses any more. (eieio-defclass-internal): Reuse the old class object if it was just an autoload stub. (eieio--class-precedence-list): Load the class if it's autoloaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core. (eieio--defgeneric-init-form): Don't throw away a previous docstring. (eieio--method-optimize-primary): Don't mess with the docstring. (defgeneric): Keep the `args' in the docstring. (defmethod): Don't use the method's docstring for the generic function's docstring. * lisp/emacs-lisp/find-func.el: Use lexical-binding. (find-function-regexp): Don't rule out `defgeneric'. (find-function-regexp-alist): Document new possibility of including a function instead of a regexp. (find-function-search-for-symbol): Implement that new possibility. (find-function-library): Don't assume that `function' is a symbol. (find-function-do-it): Remove unused var `orig-buf'. * test/automated/cl-generic-tests.el (cl-generic-test-8-after/before): Rename from cl-generic-test-7-after/before. (cl--generic-test-advice): New function. (cl-generic-test-9-advice): New test. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset eieio-test--1.
2015-01-17 03:52:15 +00:00
(defun eieio-defclass-autoload (cname _superclasses filename doc)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Create autoload symbols for the EIEIO class CNAME.
SUPERCLASSES are the superclasses that CNAME inherits from.
DOC is the docstring for CNAME.
This function creates a mock-class for CNAME and adds it into
SUPERCLASSES as children.
It creates an autoload function for CNAME's constructor."
;; Assume we've already debugged inputs.
Improve handling of doc-strings and describe-function for cl-generic * lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long as it's a symbol. (help-fns-short-filename): New function. (describe-function-1): Use it. Use autoload-do-load. * lisp/help-mode.el (help-function-def): Add optional arg `type'. * lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to override an autoload. (cl-generic-current-method-specializers): Replace dyn-bind variable with a lexically-scoped macro. (cl--generic-lambda): Update accordingly. (cl-generic-define-method): Record manually in the load-history with type `cl-defmethod'. (cl--generic-get-dispatcher): Minor optimization. (cl--generic-search-method): New function. (find-function-regexp-alist): Add entry for `cl-defmethod' type. (cl--generic-search-method): Add hyperlinks for methods. Merge the specializers and the function's arguments. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el. (eieio-defclass-autoload): Don't record the superclasses any more. (eieio-defclass-internal): Reuse the old class object if it was just an autoload stub. (eieio--class-precedence-list): Load the class if it's autoloaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core. (eieio--defgeneric-init-form): Don't throw away a previous docstring. (eieio--method-optimize-primary): Don't mess with the docstring. (defgeneric): Keep the `args' in the docstring. (defmethod): Don't use the method's docstring for the generic function's docstring. * lisp/emacs-lisp/find-func.el: Use lexical-binding. (find-function-regexp): Don't rule out `defgeneric'. (find-function-regexp-alist): Document new possibility of including a function instead of a regexp. (find-function-search-for-symbol): Implement that new possibility. (find-function-library): Don't assume that `function' is a symbol. (find-function-do-it): Remove unused var `orig-buf'. * test/automated/cl-generic-tests.el (cl-generic-test-8-after/before): Rename from cl-generic-test-7-after/before. (cl--generic-test-advice): New function. (cl-generic-test-9-advice): New test. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset eieio-test--1.
2015-01-17 03:52:15 +00:00
;; We used to store the list of superclasses in the `parent' slot (as a list
;; of class names). But now this slot holds a list of class objects, and
;; those parents may not exist yet, so the corresponding class objects may
;; simply not exist yet. So instead we just don't store the list of parents
;; here in eieio-defclass-autoload at all, since it seems that they're just
;; not needed before the class is actually loaded.
(let* ((oldc (cl--find-class cname))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(newc (eieio--class-make cname)))
(if (eieio--class-p oldc)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
nil ;; Do nothing if we already have this class.
Improve handling of doc-strings and describe-function for cl-generic * lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long as it's a symbol. (help-fns-short-filename): New function. (describe-function-1): Use it. Use autoload-do-load. * lisp/help-mode.el (help-function-def): Add optional arg `type'. * lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to override an autoload. (cl-generic-current-method-specializers): Replace dyn-bind variable with a lexically-scoped macro. (cl--generic-lambda): Update accordingly. (cl-generic-define-method): Record manually in the load-history with type `cl-defmethod'. (cl--generic-get-dispatcher): Minor optimization. (cl--generic-search-method): New function. (find-function-regexp-alist): Add entry for `cl-defmethod' type. (cl--generic-search-method): Add hyperlinks for methods. Merge the specializers and the function's arguments. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el. (eieio-defclass-autoload): Don't record the superclasses any more. (eieio-defclass-internal): Reuse the old class object if it was just an autoload stub. (eieio--class-precedence-list): Load the class if it's autoloaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core. (eieio--defgeneric-init-form): Don't throw away a previous docstring. (eieio--method-optimize-primary): Don't mess with the docstring. (defgeneric): Keep the `args' in the docstring. (defmethod): Don't use the method's docstring for the generic function's docstring. * lisp/emacs-lisp/find-func.el: Use lexical-binding. (find-function-regexp): Don't rule out `defgeneric'. (find-function-regexp-alist): Document new possibility of including a function instead of a regexp. (find-function-search-for-symbol): Implement that new possibility. (find-function-library): Don't assume that `function' is a symbol. (find-function-do-it): Remove unused var `orig-buf'. * test/automated/cl-generic-tests.el (cl-generic-test-8-after/before): Rename from cl-generic-test-7-after/before. (cl--generic-test-advice): New function. (cl-generic-test-9-advice): New test. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset eieio-test--1.
2015-01-17 03:52:15 +00:00
;; turn this into a usable self-pointing symbol
(when eieio-backward-compatibility
(set cname cname)
(make-obsolete-variable cname (format "use \\='%s instead" cname)
"25.1"))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
Improve handling of doc-strings and describe-function for cl-generic * lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long as it's a symbol. (help-fns-short-filename): New function. (describe-function-1): Use it. Use autoload-do-load. * lisp/help-mode.el (help-function-def): Add optional arg `type'. * lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to override an autoload. (cl-generic-current-method-specializers): Replace dyn-bind variable with a lexically-scoped macro. (cl--generic-lambda): Update accordingly. (cl-generic-define-method): Record manually in the load-history with type `cl-defmethod'. (cl--generic-get-dispatcher): Minor optimization. (cl--generic-search-method): New function. (find-function-regexp-alist): Add entry for `cl-defmethod' type. (cl--generic-search-method): Add hyperlinks for methods. Merge the specializers and the function's arguments. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el. (eieio-defclass-autoload): Don't record the superclasses any more. (eieio-defclass-internal): Reuse the old class object if it was just an autoload stub. (eieio--class-precedence-list): Load the class if it's autoloaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core. (eieio--defgeneric-init-form): Don't throw away a previous docstring. (eieio--method-optimize-primary): Don't mess with the docstring. (defgeneric): Keep the `args' in the docstring. (defmethod): Don't use the method's docstring for the generic function's docstring. * lisp/emacs-lisp/find-func.el: Use lexical-binding. (find-function-regexp): Don't rule out `defgeneric'. (find-function-regexp-alist): Document new possibility of including a function instead of a regexp. (find-function-search-for-symbol): Implement that new possibility. (find-function-library): Don't assume that `function' is a symbol. (find-function-do-it): Remove unused var `orig-buf'. * test/automated/cl-generic-tests.el (cl-generic-test-8-after/before): Rename from cl-generic-test-7-after/before. (cl--generic-test-advice): New function. (cl-generic-test-9-advice): New test. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset eieio-test--1.
2015-01-17 03:52:15 +00:00
;; Store the new class vector definition into the symbol. We need to
;; do this first so that we can call defmethod for the accessor.
;; The vector will be updated by the following while loop and will not
;; need to be stored a second time.
(setf (cl--find-class cname) newc)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
Improve handling of doc-strings and describe-function for cl-generic * lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long as it's a symbol. (help-fns-short-filename): New function. (describe-function-1): Use it. Use autoload-do-load. * lisp/help-mode.el (help-function-def): Add optional arg `type'. * lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to override an autoload. (cl-generic-current-method-specializers): Replace dyn-bind variable with a lexically-scoped macro. (cl--generic-lambda): Update accordingly. (cl-generic-define-method): Record manually in the load-history with type `cl-defmethod'. (cl--generic-get-dispatcher): Minor optimization. (cl--generic-search-method): New function. (find-function-regexp-alist): Add entry for `cl-defmethod' type. (cl--generic-search-method): Add hyperlinks for methods. Merge the specializers and the function's arguments. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el. (eieio-defclass-autoload): Don't record the superclasses any more. (eieio-defclass-internal): Reuse the old class object if it was just an autoload stub. (eieio--class-precedence-list): Load the class if it's autoloaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core. (eieio--defgeneric-init-form): Don't throw away a previous docstring. (eieio--method-optimize-primary): Don't mess with the docstring. (defgeneric): Keep the `args' in the docstring. (defmethod): Don't use the method's docstring for the generic function's docstring. * lisp/emacs-lisp/find-func.el: Use lexical-binding. (find-function-regexp): Don't rule out `defgeneric'. (find-function-regexp-alist): Document new possibility of including a function instead of a regexp. (find-function-search-for-symbol): Implement that new possibility. (find-function-library): Don't assume that `function' is a symbol. (find-function-do-it): Remove unused var `orig-buf'. * test/automated/cl-generic-tests.el (cl-generic-test-8-after/before): Rename from cl-generic-test-7-after/before. (cl--generic-test-advice): New function. (cl-generic-test-9-advice): New test. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset eieio-test--1.
2015-01-17 03:52:15 +00:00
;; Create an autoload on top of our constructor function.
(autoload cname filename doc nil nil)
(autoload (intern (format "%s-p" cname)) filename "" nil nil)
(when eieio-backward-compatibility
(autoload (intern (format "%s-child-p" cname)) filename "" nil nil)
(autoload (intern (format "%s-list-p" cname)) filename "" nil nil)))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defsubst eieio-class-un-autoload (cname)
"If class CNAME is in an autoload state, load its file."
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
(autoload-do-load (symbol-function cname))) ; cname
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(cl-deftype list-of (elem-type)
`(and list
(satisfies (lambda (list)
(cl-every (lambda (elem) (cl-typep elem ',elem-type))
list)))))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(defun eieio-make-class-predicate (class)
(lambda (obj)
(:documentation
(format "Return non-nil if OBJ is an object of type `%S'.\n\n(fn OBJ)"
class))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(and (eieio-object-p obj)
(same-class-p obj class))))
(defun eieio-make-child-predicate (class)
(lambda (obj)
(:documentation
(format "Return non-nil if OBJ is an object of type `%S' or a subclass.
\n(fn OBJ)" class))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(and (eieio-object-p obj)
(object-of-class-p obj class))))
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
(defvar eieio--known-slot-names nil)
(defun eieio-defclass-internal (cname superclasses slots options)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Define CNAME as a new subclass of SUPERCLASSES.
SLOTS are the slots residing in that class definition, and OPTIONS
holds the class options.
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
See `defclass' for more information."
;; Run our eieio-hook each time, and clear it when we are done.
;; This way people can add hooks safely if they want to modify eieio
;; or add definitions when eieio is loaded or something like that.
(run-hooks 'eieio-hook)
(setq eieio-hook nil)
(let* ((oldc (let ((c (cl--find-class cname))) (if (eieio--class-p c) c)))
(newc (or oldc
;; Reuse `oldc' instead of creating a new one, so that
;; existing references stay valid. E.g. when
;; reloading the file that does the `defclass', we don't
;; want to create a new class object.
(eieio--class-make cname)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(groups nil) ;; list of groups id'd from slots
(clearparent nil))
;; If this class already existed, and we are updating its structure,
;; make sure we keep the old child list. This can cause bugs, but
;; if no new slots are created, it also saves time, and prevents
;; method table breakage, particularly when the users is only
;; byte compiling an EIEIO file.
(if oldc
(progn
(cl-assert (eq newc oldc))
;; Reset the fields.
(setf (eieio--class-parents newc) nil)
(setf (eieio--class-slots newc) nil)
(setf (eieio--class-initarg-tuples newc) nil)
(setf (eieio--class-class-slots newc) nil))
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
;; If the old class did not exist, but did exist in the autoload map,
;; then adopt those children. This is like the above, but deals with
;; autoloads nicely.
(let ((children (gethash cname eieio-defclass-autoload-map)))
(when children
(setf (eieio--class-children newc) children)
(remhash cname eieio-defclass-autoload-map))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if superclasses
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(progn
(dolist (p superclasses)
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(if (not (and p (symbolp p)))
(error "Invalid parent class %S" p)
(let ((c (cl--find-class p)))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(if (not (eieio--class-p c))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; bad class
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
(error "Given parent class %S is not a class" p)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; good parent class...
;; save new child in parent
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(cl-pushnew cname (eieio--class-children c))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Get custom groups, and store them into our local copy.
(mapc (lambda (g) (cl-pushnew g groups :test #'equal))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(eieio--class-option c :custom-groups))
;; Save parent in child.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(push c (eieio--class-parents newc))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Reverse the list of our parents so that they are prioritized in
;; the same order as specified in the code.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(cl-callf nreverse (eieio--class-parents newc)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; If there is nothing to loop over, then inherit from the
;; default superclass.
(unless (eq cname 'eieio-default-superclass)
;; adopt the default parent here, but clear it later...
(setq clearparent t)
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
;; save new child in parent
(cl-pushnew cname (eieio--class-children eieio-default-superclass))
;; save parent in child
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(setf (eieio--class-parents newc) (list eieio-default-superclass))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
;; turn this into a usable self-pointing symbol; FIXME: Why?
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(when eieio-backward-compatibility
(set cname cname)
(make-obsolete-variable cname (format "use \\='%s instead" cname)
"25.1"))
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
;; Create a handy list of the class test too
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(when eieio-backward-compatibility
(let ((csym (intern (concat (symbol-name cname) "-list-p"))))
(defalias csym
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
`(lambda (obj)
,(format
"Test OBJ to see if it a list of objects which are a child of type %s"
cname)
(when (listp obj)
(let ((ans t)) ;; nil is valid
;; Loop over all the elements of the input list, test
;; each to make sure it is a child of the desired object class.
(while (and obj ans)
(setq ans (and (eieio-object-p (car obj))
(object-of-class-p (car obj) ,cname)))
(setq obj (cdr obj)))
ans))))
(make-obsolete csym (format
"use (cl-typep ... \\='(list-of %s)) instead"
cname)
"25.1")))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Before adding new slots, let's add all the methods and classes
;; in from the parent class.
(eieio-copy-parents-into-subclass newc)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Store the new class vector definition into the symbol. We need to
;; do this first so that we can call defmethod for the accessor.
;; The vector will be updated by the following while loop and will not
;; need to be stored a second time.
(setf (cl--find-class cname) newc)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Query each slot in the declaration list and mangle into the
;; class structure I have defined.
(pcase-dolist (`(,name . ,slot) slots)
(let* ((init (or (plist-get slot :initform)
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(if (member :initform slot) nil
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
eieio-unbound)))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(initarg (plist-get slot :initarg))
(docstr (plist-get slot :documentation))
(prot (plist-get slot :protection))
(alloc (plist-get slot :allocation))
(type (plist-get slot :type))
(custom (plist-get slot :custom))
(label (plist-get slot :label))
(customg (plist-get slot :group))
(printer (plist-get slot :printer))
(skip-nil (eieio--class-option-assoc options :allow-nil-initform))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
)
;; Clean up the meaning of protection.
(setq prot
(pcase prot
((or 'nil 'public ':public) nil)
((or 'protected ':protected) 'protected)
((or 'private ':private) 'private)
(_ (signal 'invalid-slot-type (list :protection prot)))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; The default type specifier is supposed to be t, meaning anything.
(if (not type) (setq type t))
;; intern the symbol so we can use it blankly
(if eieio-backward-compatibility
(and initarg (not (keywordp initarg))
(progn
(set initarg initarg)
(make-obsolete-variable
initarg (format "use \\='%s instead" initarg) "25.1"))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
;; The customgroup should be a list of symbols.
(cond ((and (null customg) custom)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(setq customg '(default)))
((not (listp customg))
(setq customg (list customg))))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
;; The customgroup better be a list of symbols.
(dolist (cg customg)
(unless (symbolp cg)
(signal 'invalid-slot-type (list :group cg))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; First up, add this slot into our new class.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(eieio--add-new-slot
newc (cl--make-slot-descriptor
name init type
`(,@(if docstr `((:documentation . ,docstr)))
,@(if custom `((:custom . ,custom)))
,@(if label `((:label . ,label)))
,@(if customg `((:group . ,customg)))
,@(if printer `((:printer . ,printer)))
,@(if prot `((:protection . ,prot)))))
initarg alloc 'defaultoverride skip-nil)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; We need to id the group, and store them in a group list attribute.
(dolist (cg customg)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(cl-pushnew cg groups :test #'equal))
))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Now that everything has been loaded up, all our lists are backwards!
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
;; Fix that up now and then them into vectors.
(cl-callf (lambda (slots) (apply #'vector (nreverse slots)))
(eieio--class-slots newc))
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
(cl-callf nreverse (eieio--class-initarg-tuples newc))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; The storage for class-class-allocation-type needs to be turned into
;; a vector now.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(cl-callf (lambda (slots) (apply #'vector slots))
(eieio--class-class-slots newc))
;; Also, setup the class allocated values.
(let* ((slots (eieio--class-class-slots newc))
(n (length slots))
(v (make-vector n nil)))
(dotimes (i n)
(setf (aref v i) (eieio-default-eval-maybe
(cl--slot-descriptor-initform (aref slots i)))))
(setf (eieio--class-class-allocation-values newc) v))
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
;; Attach slot symbols into a hashtable, and store the index of
;; this slot as the value this table.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let* ((slots (eieio--class-slots newc))
;; (cslots (eieio--class-class-slots newc))
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
(oa (make-hash-table :test #'eq)))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
;; (dotimes (cnt (length cslots))
;; (setf (gethash (cl--slot-descriptor-name (aref cslots cnt)) oa) (- -1 cnt)))
(dotimes (cnt (length slots))
(setf (gethash (cl--slot-descriptor-name (aref slots cnt)) oa) cnt))
(setf (eieio--class-index-table newc) oa))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Set up a specialized doc string.
;; Use stored value since it is calculated in a non-trivial way
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((docstring (eieio--class-option-assoc options :documentation)))
(setf (eieio--class-docstring newc) docstring)
(when eieio-backward-compatibility
(put cname 'variable-documentation docstring)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Save the file location where this class is defined.
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
(add-to-list 'current-load-list `(define-type . ,cname))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; We have a list of custom groups. Store them into the options.
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(let ((g (eieio--class-option-assoc options :custom-groups)))
(mapc (lambda (cg) (cl-pushnew cg g :test 'equal)) groups)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if (memq :custom-groups options)
(setcar (cdr (memq :custom-groups options)) g)
(setq options (cons :custom-groups (cons g options)))))
;; Set up the options we have collected.
(setf (eieio--class-options newc) options)
;; if this is a superclass, clear out parent (which was set to the
;; default superclass eieio-default-superclass)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(if clearparent (setf (eieio--class-parents newc) nil))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Create the cached default object.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((cache (make-vector (+ (length (eieio--class-slots newc))
* lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarrays * lisp/emacs-lisp/eieio-core.el (class): Rename field symbol-obarray to symbol-hashtable. It contains a hashtable instead of an obarray. (generic-p): Use symbol property `eieio-method-hashtable' instead of `eieio-method-obarray'. (generic-primary-only-p, generic-primary-only-one-p): Slight optimization. (eieio-defclass-autoload-map): Use a hashtable instead of an obarray. (eieio-defclass-autoload, eieio-defclass): Adjust/simplify accordingly. (eieio-class-un-autoload): Use autoload-do-load. (eieio-defclass): Use dolist, cl-pushnew, cl-callf. Use new cl-deftype-satisfies. Adjust to use of hashtables. Don't hardcode the value of eieio--object-num-slots. (eieio-defgeneric-form-primary-only-one): Remove `doc-string' arg. Use a closure rather than a backquoted lambda. (eieio--defmethod): Adjust call accordingly. Set doc-string via the function-documentation property. (eieio-slot-originating-class-p, eieio-slot-name-index) (eieiomt--optimizing-hashtable, eieiomt-install, eieiomt-add) (eieio-generic-form): Adjust to use of hashtables. (eieiomt--sym-optimize): Rename from eieiomt-sym-optimize; take additional class argument. (eieio-generic-call-methodname): Remove, unused. * lisp/emacs-lisp/eieio-custom.el: Use lexical-binding. (eieio-object-value-to-abstract): Simplify. * lisp/emacs-lisp/eieio-datadebug.el: Use lexical-binding. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-list): Use cl-mapcan. (eieio-build-class-alist): Use dolist. (eieio-all-generic-functions): Adjust to use of hashtables. * lisp/emacs-lisp/eieio.el (child-of-class-p): Fix case where `class' is `eieio-default-superclass'. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Remove use of eieio-generic-call-methodname. (eieio-test-method-order-list-3, eieio-test-method-order-list-6) (eieio-test-method-order-list-7, eieio-test-method-order-list-8): Adjust the expected result accordingly. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): Prefer \' to $.
2014-12-22 20:13:02 +00:00
(eval-when-compile eieio--object-num-slots))
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
nil))
;; We don't strictly speaking need to use a symbol, but the old
;; code used the class's name rather than the class's object, so
;; we follow this preference for using a symbol, which is probably
;; convenient to keep the printed representation of such Elisp
;; objects readable.
(tag (intern (format "eieio-class-tag--%s" cname))))
(set tag newc)
(fset tag :quick-object-witness-check)
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(setf (eieio--object-class-tag cache) tag)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(let ((eieio-skip-typecheck t))
;; All type-checking has been done to our satisfaction
;; before this call. Don't waste our time in this call..
(eieio-set-defaults cache t))
(setf (eieio--class-default-object-cache newc) cache))
;; Return our new class object
;; newc
cname
))
(defsubst eieio-eval-default-p (val)
"Whether the default value VAL should be evaluated for use."
(and (consp val) (symbolp (car val)) (fboundp (car val))))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(defun eieio--perform-slot-validation-for-default (slot skipnil)
"For SLOT, signal if its type does not match its default value.
If SKIPNIL is non-nil, then if default value is nil return t instead."
(let ((value (cl--slot-descriptor-initform slot))
(spec (cl--slot-descriptor-type slot)))
(if (not (or (eieio-eval-default-p value) ;FIXME: Why?
eieio-skip-typecheck
(and skipnil (null value))
(eieio--perform-slot-validation spec value)))
(signal 'invalid-slot-type (list (cl--slot-descriptor-name slot) spec value)))))
(defun eieio--slot-override (old new skipnil)
(cl-assert (eq (cl--slot-descriptor-name old) (cl--slot-descriptor-name new)))
;; There is a match, and we must override the old value.
(let* ((a (cl--slot-descriptor-name old))
(tp (cl--slot-descriptor-type old))
(d (cl--slot-descriptor-initform new))
(type (cl--slot-descriptor-type new))
(oprops (cl--slot-descriptor-props old))
(nprops (cl--slot-descriptor-props new))
(custg (alist-get :group nprops)))
;; If type is passed in, is it the same?
(if (not (eq type t))
(if (not (equal type tp))
(error
Go back to grave quoting in source-code docstrings etc. This reverts almost all my recent changes to use curved quotes in docstrings and/or strings used for error diagnostics. There are a few exceptions, e.g., Bahá’í proper names. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/abbrev.el (expand-region-abbrevs): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet) (outlineify-sticky): * lisp/apropos.el (apropos-library): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/button.el (button-category-symbol, button-put) (make-text-button): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-ext.el (calc-user-function-list): * lisp/calc/calc-graph.el (calc-graph-show-dumb): * lisp/calc/calc-help.el (calc-describe-key) (calc-describe-thing, calc-full-help): * lisp/calc/calc-lang.el (calc-c-language) (math-parse-fortran-vector-end, math-parse-tex-sum) (math-parse-eqn-matrix, math-parse-eqn-prime) (calc-yacas-language, calc-maxima-language, calc-giac-language) (math-read-giac-subscr, math-read-math-subscr) (math-read-big-rec, math-read-big-balance): * lisp/calc/calc-misc.el (calc-help, report-calc-bug): * lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes) (calc-auto-recompute): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part, calc-user-define-invocation) (math-do-arg-check): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-vec.el (math-read-brackets): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calc/calc.el (calc, calc-do, calc-user-invocation): * lisp/calendar/appt.el (appt-display-message): * lisp/calendar/diary-lib.el (diary-check-diary-file) (diary-mail-entries, diary-from-outlook): * lisp/calendar/icalendar.el (icalendar-export-region) (icalendar--convert-float-to-ical) (icalendar--convert-date-to-ical) (icalendar--convert-ical-to-diary) (icalendar--convert-recurring-to-diary) (icalendar--add-diary-entry): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/timeclock.el (timeclock-mode-line-display) (timeclock-make-hours-explicit, timeclock-log-data): * lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category) (todo-item-mark, todo-check-format) (todo-insert-item--next-param, todo-edit-item--next-key) (todo-mode): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/mode-local.el (describe-mode-local-overload) (mode-local-print-binding, mode-local-describe-bindings-2): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/cedet/srecode/srt-mode.el (srecode-macro-help): * lisp/cus-start.el (standard): * lisp/cus-theme.el (describe-theme-1): * lisp/custom.el (custom-add-dependencies, custom-check-theme) (custom--sort-vars-1, load-theme): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/dired-x.el (dired-do-run-mail): * lisp/dired.el (dired-log): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-enable-advice) (ad-disable-advice, ad-remove-advice, ad-set-argument) (ad-set-arguments, ad--defalias-fset, ad-activate) (ad-deactivate): * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand) (byte-compile-unfold-lambda, byte-optimize-form-code-walker) (byte-optimize-while, byte-optimize-apply): * lisp/emacs-lisp/byte-run.el (defun, defsubst): * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode) (byte-compile-log-file, byte-compile-format-warn) (byte-compile-nogroup-warn, byte-compile-arglist-warn) (byte-compile-cl-warn) (byte-compile-warn-about-unresolved-functions) (byte-compile-file, byte-compile--declare-var) (byte-compile-file-form-defmumble, byte-compile-form) (byte-compile-normal-call, byte-compile-check-variable) (byte-compile-variable-ref, byte-compile-variable-set) (byte-compile-subr-wrong-args, byte-compile-setq-default) (byte-compile-negation-optimizer) (byte-compile-condition-case--old) (byte-compile-condition-case--new, byte-compile-save-excursion) (byte-compile-defvar, byte-compile-autoload) (byte-compile-lambda-form) (byte-compile-make-variable-buffer-local, display-call-tree) (batch-byte-compile): * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use): * lisp/emacs-lisp/chart.el (chart-space-usage): * lisp/emacs-lisp/check-declare.el (check-declare-scan) (check-declare-warn, check-declare-file) (check-declare-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-message-text-engine): * lisp/emacs-lisp/cl-extra.el (cl-parse-integer) (cl--describe-class): * lisp/emacs-lisp/cl-generic.el (cl-defgeneric) (cl--generic-describe, cl-generic-generalizers): * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody) (cl-symbol-macrolet): * lisp/emacs-lisp/cl.el (cl-unload-function, flet): * lisp/emacs-lisp/copyright.el (copyright) (copyright-update-directory): * lisp/emacs-lisp/edebug.el (edebug-read-list): * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): * lisp/emacs-lisp/eieio-core.el (eieio--slot-override) (eieio-oref): * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): * lisp/emacs-lisp/eieio-speedbar.el: (eieio-speedbar-child-make-tag-lines) (eieio-speedbar-child-description): * lisp/emacs-lisp/eieio.el (defclass, change-class): * lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms) (elint-init-form, elint-check-defalias-form) (elint-check-let-form): * lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu) (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-describe-test): * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol) (find-function-library): * lisp/emacs-lisp/generator.el (iter-yield): * lisp/emacs-lisp/gv.el (gv-define-simple-setter): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): * lisp/emacs-lisp/nadvice.el (advice--make-docstring) (advice--make, define-advice): * lisp/emacs-lisp/package-x.el (package-upload-file): * lisp/emacs-lisp/package.el (package-version-join) (package-disabled-p, package-activate-1, package-activate) (package--download-one-archive) (package--download-and-read-archives) (package-compute-transaction, package-install-from-archive) (package-install, package-install-selected-packages) (package-delete, package-autoremove, describe-package-1) (package-install-button-action, package-delete-button-action) (package-menu-hide-package, package-menu--list-to-prompt) (package-menu--perform-transaction) (package-menu--find-and-notify-upgrades): * lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1): * lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode): * lisp/emacs-lisp/ring.el (ring-previous, ring-next): * lisp/emacs-lisp/rx.el (rx-check, rx-anything) (rx-check-any-string, rx-check-any, rx-check-not, rx-=) (rx-repeat, rx-check-backref, rx-syntax, rx-check-category) (rx-form): * lisp/emacs-lisp/smie.el (smie-config-save): * lisp/emacs-lisp/subr-x.el (internal--check-binding): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): * lisp/emacs-lisp/testcover.el (testcover-1value): * lisp/emacs-lisp/timer.el (timer-event-handler): * lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments) (viper-toggle-search-style, viper-kill-buffer) (viper-brac-function): * lisp/emulation/viper-macs.el (viper-record-kbd-macro): * lisp/env.el (setenv): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp) (eshell-glob-entries): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/facemenu.el (facemenu-add-new-face) (facemenu-add-new-color): * lisp/faces.el (read-face-name, read-face-font, describe-face) (x-resolve-font-name): * lisp/files-x.el (modify-file-local-variable): * lisp/files.el (locate-user-emacs-file, find-alternate-file) (set-auto-mode, hack-one-local-variable--obsolete) (dir-locals-set-directory-class, write-file, basic-save-buffer) (delete-directory, copy-directory, recover-session) (recover-session-finish, insert-directory) (file-modes-char-to-who, file-modes-symbolic-to-number) (move-file-to-trash): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/finder.el (finder-commentary): * lisp/font-lock.el (font-lock-fontify-buffer): * lisp/format.el (format-write-file, format-find-file) (format-insert-file): * lisp/frame.el (get-device-terminal, select-frame-by-name): * lisp/fringe.el (fringe--check-style): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--parent-mode) (help-fns--obsolete, help-fns--interactive-only) (describe-function-1, describe-variable): * lisp/help.el (describe-mode) (describe-minor-mode-from-indicator): * lisp/image.el (image-type): * lisp/international/ccl.el (ccl-dump): * lisp/international/fontset.el (x-must-resolve-font-name): * lisp/international/mule-cmds.el (prefer-coding-system) (select-safe-coding-system-interactively) (select-safe-coding-system, activate-input-method) (toggle-input-method, describe-current-input-method) (describe-language-environment): * lisp/international/mule-conf.el (code-offset): * lisp/international/mule-diag.el (describe-character-set) (list-input-methods-1): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc-playlist-rename): * lisp/msb.el (msb--choose-menu): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/imap.el (imap-interactive-login): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/newst-backend.el (newsticker--sentinel-work): * lisp/net/newst-treeview.el (newsticker--treeview-load): * lisp/net/rlogin.el (rlogin): * lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer): * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/proced.el (proced-log): * lisp/progmodes/ada-mode.el (ada-get-indent-case) (ada-check-matching-start, ada-goto-matching-start): * lisp/progmodes/ada-prj.el (ada-prj-display-page): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/ebrowse.el (ebrowse-tags-apropos): * lisp/progmodes/etags.el (etags-tags-apropos-additional): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-shell-get-process-or-error) (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate): * lisp/recentf.el (recentf-open-files): * lisp/replace.el (query-replace-read-from) (occur-after-change-function, occur-1): * lisp/scroll-bar.el (scroll-bar-columns): * lisp/server.el (server-get-auth-key): * lisp/simple.el (execute-extended-command) (undo-outer-limit-truncate, list-processes--refresh) (compose-mail, set-variable, choose-completion-string) (define-alternatives): * lisp/startup.el (site-run-file, tty-handle-args, command-line) (command-line-1): * lisp/subr.el (noreturn, define-error, add-to-list) (read-char-choice, version-to-list): * lisp/term/common-win.el (x-handle-xrm-switch) (x-handle-name-switch, x-handle-args): * lisp/term/x-win.el (x-handle-parent-id, x-handle-smid): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/textmodes/two-column.el (2C-split): * lisp/tutorial.el (tutorial--describe-nonstandard-key) (tutorial--find-changed-keys): * lisp/type-break.el (type-break-noninteractive-query): * lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes) (wdired-do-perm-changes): * lisp/whitespace.el (whitespace-report-region): Prefer grave quoting in source-code strings used to generate help and diagnostics. * lisp/faces.el (face-documentation): No need to convert quotes, since the result is a docstring. * lisp/info.el (Info-virtual-index-find-node) (Info-virtual-index, info-apropos): Simplify by generating only curved quotes, since info files are typically that ways nowadays anyway. * lisp/international/mule-diag.el (list-input-methods): Don’t assume text quoting style is curved. * lisp/org/org-bibtex.el (org-bibtex-fields): Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
"Child slot type `%s' does not match inherited type `%s' for `%s'"
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
type tp a))
(setf (cl--slot-descriptor-type new) tp))
;; If we have a repeat, only update the initarg...
(unless (eq d eieio-unbound)
(eieio--perform-slot-validation-for-default new skipnil)
(setf (cl--slot-descriptor-initform old) d))
;; PLN Tue Jun 26 11:57:06 2007 : The protection is
;; checked and SHOULD match the superclass
;; protection. Otherwise an error is thrown. However
;; I wonder if a more flexible schedule might be
;; implemented.
;;
;; EML - We used to have (if prot... here,
;; but a prot of 'nil means public.
;;
(let ((super-prot (alist-get :protection oprops))
(prot (alist-get :protection nprops)))
(if (not (eq prot super-prot))
Go back to grave quoting in source-code docstrings etc. This reverts almost all my recent changes to use curved quotes in docstrings and/or strings used for error diagnostics. There are a few exceptions, e.g., Bahá’í proper names. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/abbrev.el (expand-region-abbrevs): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet) (outlineify-sticky): * lisp/apropos.el (apropos-library): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/button.el (button-category-symbol, button-put) (make-text-button): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-ext.el (calc-user-function-list): * lisp/calc/calc-graph.el (calc-graph-show-dumb): * lisp/calc/calc-help.el (calc-describe-key) (calc-describe-thing, calc-full-help): * lisp/calc/calc-lang.el (calc-c-language) (math-parse-fortran-vector-end, math-parse-tex-sum) (math-parse-eqn-matrix, math-parse-eqn-prime) (calc-yacas-language, calc-maxima-language, calc-giac-language) (math-read-giac-subscr, math-read-math-subscr) (math-read-big-rec, math-read-big-balance): * lisp/calc/calc-misc.el (calc-help, report-calc-bug): * lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes) (calc-auto-recompute): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part, calc-user-define-invocation) (math-do-arg-check): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-vec.el (math-read-brackets): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calc/calc.el (calc, calc-do, calc-user-invocation): * lisp/calendar/appt.el (appt-display-message): * lisp/calendar/diary-lib.el (diary-check-diary-file) (diary-mail-entries, diary-from-outlook): * lisp/calendar/icalendar.el (icalendar-export-region) (icalendar--convert-float-to-ical) (icalendar--convert-date-to-ical) (icalendar--convert-ical-to-diary) (icalendar--convert-recurring-to-diary) (icalendar--add-diary-entry): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/timeclock.el (timeclock-mode-line-display) (timeclock-make-hours-explicit, timeclock-log-data): * lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category) (todo-item-mark, todo-check-format) (todo-insert-item--next-param, todo-edit-item--next-key) (todo-mode): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/mode-local.el (describe-mode-local-overload) (mode-local-print-binding, mode-local-describe-bindings-2): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/cedet/srecode/srt-mode.el (srecode-macro-help): * lisp/cus-start.el (standard): * lisp/cus-theme.el (describe-theme-1): * lisp/custom.el (custom-add-dependencies, custom-check-theme) (custom--sort-vars-1, load-theme): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/dired-x.el (dired-do-run-mail): * lisp/dired.el (dired-log): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-enable-advice) (ad-disable-advice, ad-remove-advice, ad-set-argument) (ad-set-arguments, ad--defalias-fset, ad-activate) (ad-deactivate): * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand) (byte-compile-unfold-lambda, byte-optimize-form-code-walker) (byte-optimize-while, byte-optimize-apply): * lisp/emacs-lisp/byte-run.el (defun, defsubst): * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode) (byte-compile-log-file, byte-compile-format-warn) (byte-compile-nogroup-warn, byte-compile-arglist-warn) (byte-compile-cl-warn) (byte-compile-warn-about-unresolved-functions) (byte-compile-file, byte-compile--declare-var) (byte-compile-file-form-defmumble, byte-compile-form) (byte-compile-normal-call, byte-compile-check-variable) (byte-compile-variable-ref, byte-compile-variable-set) (byte-compile-subr-wrong-args, byte-compile-setq-default) (byte-compile-negation-optimizer) (byte-compile-condition-case--old) (byte-compile-condition-case--new, byte-compile-save-excursion) (byte-compile-defvar, byte-compile-autoload) (byte-compile-lambda-form) (byte-compile-make-variable-buffer-local, display-call-tree) (batch-byte-compile): * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use): * lisp/emacs-lisp/chart.el (chart-space-usage): * lisp/emacs-lisp/check-declare.el (check-declare-scan) (check-declare-warn, check-declare-file) (check-declare-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-message-text-engine): * lisp/emacs-lisp/cl-extra.el (cl-parse-integer) (cl--describe-class): * lisp/emacs-lisp/cl-generic.el (cl-defgeneric) (cl--generic-describe, cl-generic-generalizers): * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody) (cl-symbol-macrolet): * lisp/emacs-lisp/cl.el (cl-unload-function, flet): * lisp/emacs-lisp/copyright.el (copyright) (copyright-update-directory): * lisp/emacs-lisp/edebug.el (edebug-read-list): * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): * lisp/emacs-lisp/eieio-core.el (eieio--slot-override) (eieio-oref): * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): * lisp/emacs-lisp/eieio-speedbar.el: (eieio-speedbar-child-make-tag-lines) (eieio-speedbar-child-description): * lisp/emacs-lisp/eieio.el (defclass, change-class): * lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms) (elint-init-form, elint-check-defalias-form) (elint-check-let-form): * lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu) (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-describe-test): * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol) (find-function-library): * lisp/emacs-lisp/generator.el (iter-yield): * lisp/emacs-lisp/gv.el (gv-define-simple-setter): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): * lisp/emacs-lisp/nadvice.el (advice--make-docstring) (advice--make, define-advice): * lisp/emacs-lisp/package-x.el (package-upload-file): * lisp/emacs-lisp/package.el (package-version-join) (package-disabled-p, package-activate-1, package-activate) (package--download-one-archive) (package--download-and-read-archives) (package-compute-transaction, package-install-from-archive) (package-install, package-install-selected-packages) (package-delete, package-autoremove, describe-package-1) (package-install-button-action, package-delete-button-action) (package-menu-hide-package, package-menu--list-to-prompt) (package-menu--perform-transaction) (package-menu--find-and-notify-upgrades): * lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1): * lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode): * lisp/emacs-lisp/ring.el (ring-previous, ring-next): * lisp/emacs-lisp/rx.el (rx-check, rx-anything) (rx-check-any-string, rx-check-any, rx-check-not, rx-=) (rx-repeat, rx-check-backref, rx-syntax, rx-check-category) (rx-form): * lisp/emacs-lisp/smie.el (smie-config-save): * lisp/emacs-lisp/subr-x.el (internal--check-binding): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): * lisp/emacs-lisp/testcover.el (testcover-1value): * lisp/emacs-lisp/timer.el (timer-event-handler): * lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments) (viper-toggle-search-style, viper-kill-buffer) (viper-brac-function): * lisp/emulation/viper-macs.el (viper-record-kbd-macro): * lisp/env.el (setenv): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp) (eshell-glob-entries): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/facemenu.el (facemenu-add-new-face) (facemenu-add-new-color): * lisp/faces.el (read-face-name, read-face-font, describe-face) (x-resolve-font-name): * lisp/files-x.el (modify-file-local-variable): * lisp/files.el (locate-user-emacs-file, find-alternate-file) (set-auto-mode, hack-one-local-variable--obsolete) (dir-locals-set-directory-class, write-file, basic-save-buffer) (delete-directory, copy-directory, recover-session) (recover-session-finish, insert-directory) (file-modes-char-to-who, file-modes-symbolic-to-number) (move-file-to-trash): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/finder.el (finder-commentary): * lisp/font-lock.el (font-lock-fontify-buffer): * lisp/format.el (format-write-file, format-find-file) (format-insert-file): * lisp/frame.el (get-device-terminal, select-frame-by-name): * lisp/fringe.el (fringe--check-style): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--parent-mode) (help-fns--obsolete, help-fns--interactive-only) (describe-function-1, describe-variable): * lisp/help.el (describe-mode) (describe-minor-mode-from-indicator): * lisp/image.el (image-type): * lisp/international/ccl.el (ccl-dump): * lisp/international/fontset.el (x-must-resolve-font-name): * lisp/international/mule-cmds.el (prefer-coding-system) (select-safe-coding-system-interactively) (select-safe-coding-system, activate-input-method) (toggle-input-method, describe-current-input-method) (describe-language-environment): * lisp/international/mule-conf.el (code-offset): * lisp/international/mule-diag.el (describe-character-set) (list-input-methods-1): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc-playlist-rename): * lisp/msb.el (msb--choose-menu): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/imap.el (imap-interactive-login): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/newst-backend.el (newsticker--sentinel-work): * lisp/net/newst-treeview.el (newsticker--treeview-load): * lisp/net/rlogin.el (rlogin): * lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer): * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/proced.el (proced-log): * lisp/progmodes/ada-mode.el (ada-get-indent-case) (ada-check-matching-start, ada-goto-matching-start): * lisp/progmodes/ada-prj.el (ada-prj-display-page): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/ebrowse.el (ebrowse-tags-apropos): * lisp/progmodes/etags.el (etags-tags-apropos-additional): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-shell-get-process-or-error) (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate): * lisp/recentf.el (recentf-open-files): * lisp/replace.el (query-replace-read-from) (occur-after-change-function, occur-1): * lisp/scroll-bar.el (scroll-bar-columns): * lisp/server.el (server-get-auth-key): * lisp/simple.el (execute-extended-command) (undo-outer-limit-truncate, list-processes--refresh) (compose-mail, set-variable, choose-completion-string) (define-alternatives): * lisp/startup.el (site-run-file, tty-handle-args, command-line) (command-line-1): * lisp/subr.el (noreturn, define-error, add-to-list) (read-char-choice, version-to-list): * lisp/term/common-win.el (x-handle-xrm-switch) (x-handle-name-switch, x-handle-args): * lisp/term/x-win.el (x-handle-parent-id, x-handle-smid): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/textmodes/two-column.el (2C-split): * lisp/tutorial.el (tutorial--describe-nonstandard-key) (tutorial--find-changed-keys): * lisp/type-break.el (type-break-noninteractive-query): * lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes) (wdired-do-perm-changes): * lisp/whitespace.el (whitespace-report-region): Prefer grave quoting in source-code strings used to generate help and diagnostics. * lisp/faces.el (face-documentation): No need to convert quotes, since the result is a docstring. * lisp/info.el (Info-virtual-index-find-node) (Info-virtual-index, info-apropos): Simplify by generating only curved quotes, since info files are typically that ways nowadays anyway. * lisp/international/mule-diag.el (list-input-methods): Don’t assume text quoting style is curved. * lisp/org/org-bibtex.el (org-bibtex-fields): Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
(error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
prot super-prot a)))
;; End original PLN
;; PLN Tue Jun 26 11:57:06 2007 :
;; Do a non redundant combination of ancient custom
;; groups and new ones.
(when custg
(let* ((list1 (alist-get :group oprops)))
(dolist (elt custg)
(unless (memq elt list1)
(push elt list1)))
(setf (alist-get :group (cl--slot-descriptor-props old)) list1)))
;; End PLN
;; PLN Mon Jun 25 22:44:34 2007 : If a new cust is
;; set, simply replaces the old one.
(dolist (prop '(:custom :label :documentation :printer))
(when (alist-get prop (cl--slot-descriptor-props new))
(setf (alist-get prop (cl--slot-descriptor-props old))
(alist-get prop (cl--slot-descriptor-props new))))
) ))
(defun eieio--add-new-slot (newc slot init alloc
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
&optional defaultoverride skipnil)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
"Add into NEWC attribute SLOT.
If a slot of that name already exists in NEWC, then do nothing. If it doesn't exist,
INIT is the initarg, if any.
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
Argument ALLOC specifies if the slot is allocated per instance, or per class.
If optional DEFAULTOVERRIDE is non-nil, then if A exists in NEWC,
we must override its value for a default.
Optional argument SKIPNIL indicates if type checking should be skipped
if default value is nil."
;; Make sure we duplicate those items that are sequences.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let* ((a (cl--slot-descriptor-name slot))
(d (cl--slot-descriptor-initform slot))
(old (car (cl-member a (eieio--class-slots newc)
:key #'cl--slot-descriptor-name)))
(cold (car (cl-member a (eieio--class-class-slots newc)
:key #'cl--slot-descriptor-name))))
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
(cl-pushnew a eieio--known-slot-names)
(condition-case nil
(if (sequencep d) (setq d (copy-sequence d)))
;; This copy can fail on a cons cell with a non-cons in the cdr. Let's
;; skip it if it doesn't work.
(error nil))
;; (if (sequencep type) (setq type (copy-sequence type)))
;; (if (sequencep cust) (setq cust (copy-sequence cust)))
;; (if (sequencep custg) (setq custg (copy-sequence custg)))
;; To prevent override information w/out specification of storage,
;; we need to do this little hack.
(if cold (setq alloc :class))
(if (memq alloc '(nil :instance))
;; In this case, we modify the INSTANCE version of a given slot.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(progn
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
;; Only add this element if it is so-far unique
(if (not old)
(progn
(eieio--perform-slot-validation-for-default slot skipnil)
(push slot (eieio--class-slots newc))
)
;; When defaultoverride is true, we are usually adding new local
;; attributes which must override the default value of any slot
;; passed in by one of the parent classes.
(when defaultoverride
(eieio--slot-override old slot skipnil)))
(when init
(cl-pushnew (cons init a) (eieio--class-initarg-tuples newc)
:test #'equal)))
;; CLASS ALLOCATED SLOTS
(if (not cold)
(progn
(eieio--perform-slot-validation-for-default slot skipnil)
;; Here we have found a :class version of a slot. This
;; requires a very different approach.
(push slot (eieio--class-class-slots newc)))
(when defaultoverride
;; There is a match, and we must override the old value.
(eieio--slot-override cold slot skipnil))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defun eieio-copy-parents-into-subclass (newc)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Copy into NEWC the slots of PARENTS.
Follow the rules of not overwriting early parents when applying to
the new child class."
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(let ((sn (eieio--class-option-assoc (eieio--class-options newc)
:allow-nil-initform)))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(dolist (pcv (eieio--class-parents newc))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; First, duplicate all the slots of the parent.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((pslots (eieio--class-slots pcv))
(pinit (eieio--class-initarg-tuples pcv)))
(dotimes (i (length pslots))
(let* ((sd (cl--copy-slot-descriptor (aref pslots i)))
(init (car (rassq (cl--slot-descriptor-name sd) pinit))))
(eieio--add-new-slot newc sd init nil nil sn))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
)) ;; while/let
;; Now duplicate all the class alloc slots.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((pcslots (eieio--class-class-slots pcv)))
(dotimes (i (length pcslots))
(eieio--add-new-slot newc (cl--copy-slot-descriptor
(aref pcslots i))
nil :class sn)
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
)))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;; Slot type validation
;; This is a hideous hack for replacing `typep' from cl-macs, to avoid
;; requiring the CL library at run-time. It can be eliminated if/when
;; `typep' is merged into Emacs core.
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(defun eieio--perform-slot-validation (spec value)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return non-nil if SPEC does not match VALUE."
(or (eq spec t) ; t always passes
(eq value eieio-unbound) ; unbound always passes
(cl-typep value spec)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(defun eieio--validate-slot-value (class slot-idx value slot)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
Checks the :type specifier.
SLOT is the slot that is being checked, and is only used when throwing
an error."
(if eieio-skip-typecheck
nil
;; Trim off object IDX junk added in for the object index.
* lisp/emacs-lisp/eieio*.el: Remove "name" field of objects * lisp/emacs-lisp/eieio-base.el (clone) <eieio-instance-inheritor>: Use call-next-method. (eieio-constructor): Rename from `constructor'. (eieio-persistent-convert-list-to-object): Drop objname. (eieio-persistent-validate/fix-slot-value): Don't hardcode eieio--object-num-slots. (eieio-named): Use a normal slot. (slot-missing) <eieio-named>: Remove. (eieio-object-name-string, eieio-object-set-name-string, clone) <eieio-named>: New methods. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Follow aliases. (eieio--object): Remove `name' field. (eieio-defclass): Adjust to new convention where constructors don't take an "object name" any more. (eieio--defgeneric-init-form, eieio--defmethod): Follow aliases. (eieio-validate-slot-value, eieio-oset-default) (eieio-slot-name-index): Don't hardcode eieio--object-num-slots. (eieio-generic-call-primary-only): Simplify. * lisp/emacs-lisp/eieio-custom.el (eieio-widget-test): Remove dummy arg. (eieio-object-value-get): Use eieio-object-set-name-string. * lisp/emacs-lisp/eieio.el (make-instance): Simplify by not adding an object name argument. (eieio-object-name): Use eieio-object-name-string. (eieio--object-names): New const. (eieio-object-name-string, eieio-object-set-name-string): Re-implement using a hashtable rather than a built-in slot. (eieio-constructor): Rename from `constructor'. Remove `newname' arg. (clone): Don't mess with the object's "name". * test/automated/eieio-test-persist.el (persistent-with-objs-slot-subs): The type FOO-child is the same as FOO. * test/automated/eieio-tests.el: Remove dummy object names.
2014-12-23 03:05:46 +00:00
(setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots)))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((st (cl--slot-descriptor-type (aref (eieio--class-slots class)
slot-idx))))
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(if (not (eieio--perform-slot-validation st value))
(signal 'invalid-slot-type
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(list (eieio--class-name class) slot st value))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(defun eieio--validate-class-slot-value (class slot-idx value slot)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
Checks the :type specifier.
SLOT is the slot that is being checked, and is only used when throwing
an error."
(if eieio-skip-typecheck
nil
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((st (cl--slot-descriptor-type (aref (eieio--class-class-slots class)
slot-idx))))
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(if (not (eieio--perform-slot-validation st value))
(signal 'invalid-slot-type
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(list (eieio--class-name class) slot st value))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defun eieio-barf-if-slot-unbound (value instance slotname fn)
"Throw a signal if VALUE is a representation of an UNBOUND slot.
INSTANCE is the object being referenced. SLOTNAME is the offending
slot. If the slot is ok, return VALUE.
Argument FN is the function calling this verifier."
(if (and (eq value eieio-unbound) (not eieio-skip-typecheck))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(slot-unbound instance (eieio--object-class instance) slotname fn)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
value))
;;; Get/Set slots in an object.
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defun eieio-oref (obj slot)
"Return the value in OBJ at SLOT in the object vector."
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
(declare (compiler-macro
(lambda (exp)
(ignore obj)
(pcase slot
((and (or `',name (and name (pred keywordp)))
(guard (not (memq name eieio--known-slot-names))))
(macroexp--warn-and-return
Go back to grave quoting in source-code docstrings etc. This reverts almost all my recent changes to use curved quotes in docstrings and/or strings used for error diagnostics. There are a few exceptions, e.g., Bahá’í proper names. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/abbrev.el (expand-region-abbrevs): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet) (outlineify-sticky): * lisp/apropos.el (apropos-library): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/button.el (button-category-symbol, button-put) (make-text-button): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-ext.el (calc-user-function-list): * lisp/calc/calc-graph.el (calc-graph-show-dumb): * lisp/calc/calc-help.el (calc-describe-key) (calc-describe-thing, calc-full-help): * lisp/calc/calc-lang.el (calc-c-language) (math-parse-fortran-vector-end, math-parse-tex-sum) (math-parse-eqn-matrix, math-parse-eqn-prime) (calc-yacas-language, calc-maxima-language, calc-giac-language) (math-read-giac-subscr, math-read-math-subscr) (math-read-big-rec, math-read-big-balance): * lisp/calc/calc-misc.el (calc-help, report-calc-bug): * lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes) (calc-auto-recompute): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part, calc-user-define-invocation) (math-do-arg-check): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-vec.el (math-read-brackets): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calc/calc.el (calc, calc-do, calc-user-invocation): * lisp/calendar/appt.el (appt-display-message): * lisp/calendar/diary-lib.el (diary-check-diary-file) (diary-mail-entries, diary-from-outlook): * lisp/calendar/icalendar.el (icalendar-export-region) (icalendar--convert-float-to-ical) (icalendar--convert-date-to-ical) (icalendar--convert-ical-to-diary) (icalendar--convert-recurring-to-diary) (icalendar--add-diary-entry): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/timeclock.el (timeclock-mode-line-display) (timeclock-make-hours-explicit, timeclock-log-data): * lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category) (todo-item-mark, todo-check-format) (todo-insert-item--next-param, todo-edit-item--next-key) (todo-mode): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/mode-local.el (describe-mode-local-overload) (mode-local-print-binding, mode-local-describe-bindings-2): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/cedet/srecode/srt-mode.el (srecode-macro-help): * lisp/cus-start.el (standard): * lisp/cus-theme.el (describe-theme-1): * lisp/custom.el (custom-add-dependencies, custom-check-theme) (custom--sort-vars-1, load-theme): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/dired-x.el (dired-do-run-mail): * lisp/dired.el (dired-log): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-enable-advice) (ad-disable-advice, ad-remove-advice, ad-set-argument) (ad-set-arguments, ad--defalias-fset, ad-activate) (ad-deactivate): * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand) (byte-compile-unfold-lambda, byte-optimize-form-code-walker) (byte-optimize-while, byte-optimize-apply): * lisp/emacs-lisp/byte-run.el (defun, defsubst): * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode) (byte-compile-log-file, byte-compile-format-warn) (byte-compile-nogroup-warn, byte-compile-arglist-warn) (byte-compile-cl-warn) (byte-compile-warn-about-unresolved-functions) (byte-compile-file, byte-compile--declare-var) (byte-compile-file-form-defmumble, byte-compile-form) (byte-compile-normal-call, byte-compile-check-variable) (byte-compile-variable-ref, byte-compile-variable-set) (byte-compile-subr-wrong-args, byte-compile-setq-default) (byte-compile-negation-optimizer) (byte-compile-condition-case--old) (byte-compile-condition-case--new, byte-compile-save-excursion) (byte-compile-defvar, byte-compile-autoload) (byte-compile-lambda-form) (byte-compile-make-variable-buffer-local, display-call-tree) (batch-byte-compile): * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use): * lisp/emacs-lisp/chart.el (chart-space-usage): * lisp/emacs-lisp/check-declare.el (check-declare-scan) (check-declare-warn, check-declare-file) (check-declare-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-message-text-engine): * lisp/emacs-lisp/cl-extra.el (cl-parse-integer) (cl--describe-class): * lisp/emacs-lisp/cl-generic.el (cl-defgeneric) (cl--generic-describe, cl-generic-generalizers): * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody) (cl-symbol-macrolet): * lisp/emacs-lisp/cl.el (cl-unload-function, flet): * lisp/emacs-lisp/copyright.el (copyright) (copyright-update-directory): * lisp/emacs-lisp/edebug.el (edebug-read-list): * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): * lisp/emacs-lisp/eieio-core.el (eieio--slot-override) (eieio-oref): * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): * lisp/emacs-lisp/eieio-speedbar.el: (eieio-speedbar-child-make-tag-lines) (eieio-speedbar-child-description): * lisp/emacs-lisp/eieio.el (defclass, change-class): * lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms) (elint-init-form, elint-check-defalias-form) (elint-check-let-form): * lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu) (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-describe-test): * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol) (find-function-library): * lisp/emacs-lisp/generator.el (iter-yield): * lisp/emacs-lisp/gv.el (gv-define-simple-setter): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): * lisp/emacs-lisp/nadvice.el (advice--make-docstring) (advice--make, define-advice): * lisp/emacs-lisp/package-x.el (package-upload-file): * lisp/emacs-lisp/package.el (package-version-join) (package-disabled-p, package-activate-1, package-activate) (package--download-one-archive) (package--download-and-read-archives) (package-compute-transaction, package-install-from-archive) (package-install, package-install-selected-packages) (package-delete, package-autoremove, describe-package-1) (package-install-button-action, package-delete-button-action) (package-menu-hide-package, package-menu--list-to-prompt) (package-menu--perform-transaction) (package-menu--find-and-notify-upgrades): * lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1): * lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode): * lisp/emacs-lisp/ring.el (ring-previous, ring-next): * lisp/emacs-lisp/rx.el (rx-check, rx-anything) (rx-check-any-string, rx-check-any, rx-check-not, rx-=) (rx-repeat, rx-check-backref, rx-syntax, rx-check-category) (rx-form): * lisp/emacs-lisp/smie.el (smie-config-save): * lisp/emacs-lisp/subr-x.el (internal--check-binding): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): * lisp/emacs-lisp/testcover.el (testcover-1value): * lisp/emacs-lisp/timer.el (timer-event-handler): * lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments) (viper-toggle-search-style, viper-kill-buffer) (viper-brac-function): * lisp/emulation/viper-macs.el (viper-record-kbd-macro): * lisp/env.el (setenv): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp) (eshell-glob-entries): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/facemenu.el (facemenu-add-new-face) (facemenu-add-new-color): * lisp/faces.el (read-face-name, read-face-font, describe-face) (x-resolve-font-name): * lisp/files-x.el (modify-file-local-variable): * lisp/files.el (locate-user-emacs-file, find-alternate-file) (set-auto-mode, hack-one-local-variable--obsolete) (dir-locals-set-directory-class, write-file, basic-save-buffer) (delete-directory, copy-directory, recover-session) (recover-session-finish, insert-directory) (file-modes-char-to-who, file-modes-symbolic-to-number) (move-file-to-trash): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/finder.el (finder-commentary): * lisp/font-lock.el (font-lock-fontify-buffer): * lisp/format.el (format-write-file, format-find-file) (format-insert-file): * lisp/frame.el (get-device-terminal, select-frame-by-name): * lisp/fringe.el (fringe--check-style): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--parent-mode) (help-fns--obsolete, help-fns--interactive-only) (describe-function-1, describe-variable): * lisp/help.el (describe-mode) (describe-minor-mode-from-indicator): * lisp/image.el (image-type): * lisp/international/ccl.el (ccl-dump): * lisp/international/fontset.el (x-must-resolve-font-name): * lisp/international/mule-cmds.el (prefer-coding-system) (select-safe-coding-system-interactively) (select-safe-coding-system, activate-input-method) (toggle-input-method, describe-current-input-method) (describe-language-environment): * lisp/international/mule-conf.el (code-offset): * lisp/international/mule-diag.el (describe-character-set) (list-input-methods-1): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mouse.el (minor-mode-menu-from-indicator): * lisp/mpc.el (mpc-playlist-rename): * lisp/msb.el (msb--choose-menu): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/imap.el (imap-interactive-login): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/newst-backend.el (newsticker--sentinel-work): * lisp/net/newst-treeview.el (newsticker--treeview-load): * lisp/net/rlogin.el (rlogin): * lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer): * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/proced.el (proced-log): * lisp/progmodes/ada-mode.el (ada-get-indent-case) (ada-check-matching-start, ada-goto-matching-start): * lisp/progmodes/ada-prj.el (ada-prj-display-page): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/ebrowse.el (ebrowse-tags-apropos): * lisp/progmodes/etags.el (etags-tags-apropos-additional): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-shell-get-process-or-error) (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate): * lisp/recentf.el (recentf-open-files): * lisp/replace.el (query-replace-read-from) (occur-after-change-function, occur-1): * lisp/scroll-bar.el (scroll-bar-columns): * lisp/server.el (server-get-auth-key): * lisp/simple.el (execute-extended-command) (undo-outer-limit-truncate, list-processes--refresh) (compose-mail, set-variable, choose-completion-string) (define-alternatives): * lisp/startup.el (site-run-file, tty-handle-args, command-line) (command-line-1): * lisp/subr.el (noreturn, define-error, add-to-list) (read-char-choice, version-to-list): * lisp/term/common-win.el (x-handle-xrm-switch) (x-handle-name-switch, x-handle-args): * lisp/term/x-win.el (x-handle-parent-id, x-handle-smid): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/textmodes/two-column.el (2C-split): * lisp/tutorial.el (tutorial--describe-nonstandard-key) (tutorial--find-changed-keys): * lisp/type-break.el (type-break-noninteractive-query): * lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes) (wdired-do-perm-changes): * lisp/whitespace.el (whitespace-report-region): Prefer grave quoting in source-code strings used to generate help and diagnostics. * lisp/faces.el (face-documentation): No need to convert quotes, since the result is a docstring. * lisp/info.el (Info-virtual-index-find-node) (Info-virtual-index, info-apropos): Simplify by generating only curved quotes, since info files are typically that ways nowadays anyway. * lisp/international/mule-diag.el (list-input-methods): Don’t assume text quoting style is curved. * lisp/org/org-bibtex.el (org-bibtex-fields): Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
(format-message "Unknown slot `%S'" name) exp 'compile-only))
Add online-help support to describe types * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el. (describe-symbol): Improve the selection of default. * lisp/help-mode.el: Require cl-lib. (describe-symbol-backends): Move from help-fns.el. (help-make-xrefs): Use it. * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry for types. (cl--typedef-regexp): New const. (find-function-regexp-alist): Add entry for types. (cl-help-type, cl-type-definition): New buttons. (cl-find-class): New function. (cl-describe-type): New command. (cl--describe-class, cl--describe-class-slot) (cl--describe-class-slots): New functions, moved from eieio-opt.el. * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation) (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p): New functions. Moved from eieio-opt.el. (cl--generic-class-parents): New function, extracted from cl--generic-struct-specializers. (cl--generic-struct-specializers): Use it. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist. Improve constructor's docstrings. (cl-struct-unknown-slot): New error. (cl-struct-slot-offset): Use it. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type definition in current-load-list. * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var. (eieio--add-new-slot): Set it. (eieio-defclass-internal): Use new name for current-load-list. (eieio-oref): Add compiler-macro to warn about unknown slots. * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names as compile-time as well. Improve constructor docstrings. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el. (eieio-class-def): Remove button. (eieio-help-constructor): Use new name for load-history element. (eieio--specializers-apply-to-class-p, eieio-all-generic-functions) (eieio-method-documentation): Move to cl-generic.el. (eieio-display-method-list): Use new names. * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add "define-linline". (lisp-fdefs): Remove "defsubst". (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline". * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var. (macroexp--warn-and-return): Use it to avoid inf-loops. Add `compile-only' argument.
2015-07-07 06:14:16 +00:00
(_ exp)))))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(cl-check-type slot symbol)
(cl-check-type obj (or eieio-object class))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(let* ((class (cond ((symbolp obj)
(error "eieio-oref called on a class: %s" obj)
(let ((c (cl--find-class obj)))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(if (eieio--class-p c) (eieio-class-un-autoload obj))
c))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(t (eieio--object-class obj))))
(c (eieio--slot-name-index class slot)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(if (setq c (eieio--class-slot-name-index class slot))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Oref that slot.
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(aref (eieio--class-class-allocation-values class) c)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; The slot-missing method is a cool way of allowing an object author
;; to intercept missing slot definitions. Since it is also the LAST
;; thing called in this fn, its return value would be retrieved.
(slot-missing obj slot 'oref)
;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
)
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(cl-check-type obj eieio-object)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(eieio-barf-if-slot-unbound (aref obj c) obj slot 'oref))))
(defun eieio-oref-default (obj slot)
"Do the work for the macro `oref-default' with similar parameters.
Fills in OBJ's SLOT with its default value."
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(cl-check-type obj (or eieio-object class))
(cl-check-type slot symbol)
(let* ((cl (cond ((symbolp obj) (cl--find-class obj))
((eieio-object-p obj) (eieio--object-class obj))
(t obj)))
(c (eieio--slot-name-index cl slot)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
(if (setq c
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-slot-name-index cl slot))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Oref that slot.
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(aref (eieio--class-class-allocation-values cl)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
c)
(slot-missing obj slot 'oref-default)
;;(signal 'invalid-slot-name (list (class-name cl) slot))
)
(eieio-barf-if-slot-unbound
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((val (cl--slot-descriptor-initform
(aref (eieio--class-slots cl)
(- c (eval-when-compile eieio--object-num-slots))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(eieio-default-eval-maybe val))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
obj (eieio--class-name cl) 'oref-default))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(defun eieio-default-eval-maybe (val)
"Check VAL, and return what `oref-default' would provide."
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
;; FIXME: What the hell is this supposed to do? Shouldn't it evaluate
;; variables as well? Why not just always call `eval'?
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(cond
;; Is it a function call? If so, evaluate it.
((eieio-eval-default-p val)
(eval val))
;;;; check for quoted things, and unquote them
;;((and (consp val) (eq (car val) 'quote))
;; (car (cdr val)))
;; return it verbatim
(t val)))
(defun eieio-oset (obj slot value)
"Do the work for the macro `oset'.
Fills in OBJ's SLOT with VALUE."
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(cl-check-type obj eieio-object)
(cl-check-type slot symbol)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let* ((class (eieio--object-class obj))
(c (eieio--slot-name-index class slot)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
(if (setq c
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-slot-name-index class slot))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Oset that slot.
(progn
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(eieio--validate-class-slot-value class c value slot)
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(aset (eieio--class-class-allocation-values class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
c value))
;; See oref for comment on `slot-missing'
(slot-missing obj slot 'oset value)
;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
)
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(eieio--validate-slot-value class c value slot)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(aset obj c value))))
(defun eieio-oset-default (class slot value)
"Do the work for the macro `oset-default'.
Fills in the default value in CLASS' in SLOT with VALUE."
lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. * lisp/cedet/ede/speedbar.el (ede-speedbar-compile-line) (ede-speedbar-get-top-project-for-line): * lisp/cedet/ede.el (ede-buffer-belongs-to-target-p) (ede-buffer-belongs-to-project-p, ede-build-forms-menu) (ede-add-project-to-global-list): * lisp/cedet/semantic/db-typecache.el (semanticdb-get-typecache): * lisp/cedet/semantic/db-file.el (semanticdb-load-database): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-load-helper): * lisp/cedet/ede/project-am.el (project-am-preferred-target-type): * lisp/cedet/ede/proj.el (ede-proj-load): * lisp/cedet/ede/custom.el (ede-customize-current-target, ede-customize-target): * lisp/cedet/semantic/ede-grammar.el ("semantic grammar"): * lisp/cedet/semantic/scope.el (semantic-scope-reset-cache) (semantic-calculate-scope): * lisp/cedet/srecode/map.el (srecode-map-update-map): * lisp/cedet/srecode/insert.el (srecode-insert-show-error-report) (srecode-insert-method, srecode-insert-include-lookup) (srecode-insert-method): * lisp/cedet/srecode/fields.el (srecode-active-template-region): * lisp/cedet/srecode/compile.el (srecode-flush-active-templates) (srecode-compile-inserter): Don't use <class> as a variable. Use `oref-default' for class slots. * lisp/cedet/semantic/grammar.el (semantic-grammar-eldoc-last-data): New var. (semantic-grammar-eldoc-get-macro-docstring): Use it instead of eldoc-last-data. * lisp/cedet/semantic/fw.el (semantic-exit-on-input): Use `declare'. (semantic-throw-on-input): Use `with-current-buffer'. * lisp/cedet/semantic/db.el (semanticdb-abstract-table-list): Define if not pre-defined. * lisp/cedet/semantic/db-find.el (semanticdb-find-tags-collector): Use save-current-buffer. (semanticdb-find-tags-collector): Don't use <class> as a variable. * lisp/cedet/semantic/complete.el (semantic-complete-active-default) (semantic-complete-current-matched-tag): Declare. (semantic-complete-inline-custom-type): Don't use <class> as a variable. * lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions): Use with-current-buffer. * lisp/cedet/semantic.el (semantic-parser-warnings): Declare. * lisp/cedet/ede/base.el (ede-target-list): Define if not pre-defined. (ede-with-projectfile): Prefer find-file-noselect over save-window-excursion. * lisp/emacs-lisp/chart.el (chart-add-sequence, chart-bar-quickie): Don't use <class> as a variable. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Improve error messages. (eieio-persistent-slot-type-is-class-p): Handle `list-of' types, as well as user-defined types. Emit errors for legacy types like <class>-child and <class>-list, if not eieio-backward-compatibility. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var. (eieio-defclass-autoload): Obey it. (eieio--class-object): Improve error behavior. (eieio-class-children-fast, same-class-fast-p): Remove. Inline at every use site. (eieio--defgeneric-form-primary-only): Rename from eieio-defgeneric-form-primary-only; update all callers. (eieio--defgeneric-form-primary-only-one): Rename from eieio-defgeneric-form-primary-only-one; update all callers. (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only-one): Remove. (eieio--method-optimize-primary): New function to replace them. (eieio--defmethod, eieio-defmethod): Use it. (eieio--perform-slot-validation): Rename from eieio-perform-slot-validation; update all callers. (eieio--validate-slot-value): Rename from eieio-validate-slot-value. Change `class' to be a class object. Update all callers. (eieio--validate-class-slot-value): Rename from eieio-validate-class-slot-value. Change `class' to be a class object. Update all callers. (eieio-oset-default): Accept class object as well. (eieio--generic-call-primary-only): Rename from eieio-generic-call-primary-only. Update all callers. * lisp/emacs-lisp/eieio-opt.el (eieio-read-generic-p): Remove. (eieio-read-generic): Use `generic-p' instead. * lisp/emacs-lisp/eieio.el (same-class-p): Accept class object as well. (call-next-method): Simplify. (clone): Obey eieio-backward-compatibility. * lisp/gnus/registry.el: Don't use <class> as a variable. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-order-list-4): Don't use <class> as a variable. * test/automated/eieio-test-persist.el (persistent-with-objs-list-slot): Don't use <class>-list type. * test/automated/eieio-tests.el: Use cl-lib. Don't use <class> as a variable. Don't use <class>-list types and <class>-list-p predicates.
2015-01-08 04:11:58 +00:00
(setq class (eieio--class-object class))
EIEIO: Simplify help hyperlinks; Try and reduce hardcoding in .elc * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): Fix regexp. * lisp/emacs-lisp/eieio-core.el (eieio--check-type): Remove. Use cl-check-type everywhere instead. (eieio-class-object): Remove, use find-class instead when needed. (class-p): Don't inline. (eieio-object-p): Check more thoroughly, so we don't treat cl-structs, such as eieio classes, as objects. Don't inline. (object-p): Mark as obsolete. (eieio-defclass-autoload, eieio-defclass-internal, eieio-oref) (eieio--generic-tagcode): Avoid `class-p'. (eieio-make-class-predicate, eieio-make-child-predicate): New functions. (eieio-defclass-internal): Use current-load-list rather than `class-location'. * lisp/emacs-lisp/eieio-opt.el (eieio-help-class, eieio-help-constructor): Use find-lisp-object-file-name, help-fns-short-filename and new calling convention for eieio-class-def. (eieio-build-class-list): Remove function, unused. (eieio-method-def): Remove button type, unused. (eieio-class-def): Inherit from help-function-def. (eieio--defclass-regexp): New constant. (find-function-regexp-alist): Use it. (eieio--specializers-apply-to-class-p): Handle eieio--static as well. (eieio-help-find-method-definition, eieio-help-find-class-definition): Remove functions. * lisp/emacs-lisp/eieio.el (defclass): Use new eieio-make-class-predicate and eieio-make-child-predicate. (eieio-class-parents): Use eieio--class-object. (slot-boundp, find-class, eieio-override-prin1): Avoid class-p. (slot-exists-p): Use find-class. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Simplify.
2015-01-31 05:48:14 +00:00
(cl-check-type class eieio--class)
(cl-check-type slot symbol)
(let* ((c (eieio--slot-name-index class slot)))
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
(if (setq c (eieio--class-slot-name-index class slot))
(progn
;; Oref that slot.
(eieio--validate-class-slot-value class c value slot)
(aset (eieio--class-class-allocation-values class) c
value))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(signal 'invalid-slot-name (list (eieio--class-name class) slot)))
;; `oset-default' on an instance-allocated slot is allowed by EIEIO but
;; not by CLOS and is mildly inconsistent with the :initform thingy, so
;; it'd be nice to get of it. This said, it is/was used at one place by
;; gnus/registry.el, so it might be used elsewhere as well, so let's
;; keep it for now.
;; FIXME: Generate a compile-time warning for it!
;; (error "Can't `oset-default' an instance-allocated slot: %S of %S"
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
;; slot class)
(eieio--validate-slot-value class c value slot)
;; Set this into the storage for defaults.
(if (eieio-eval-default-p value)
(error "Can't set default to a sexp that gets evaluated again"))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(setf (cl--slot-descriptor-initform
;; FIXME: Apparently we set it both in `slots' and in
;; `object-cache', which seems redundant.
(aref (eieio--class-slots class)
(- c (eval-when-compile eieio--object-num-slots))))
value)
;; Take the value, and put it into our cache object.
(eieio-oset (eieio--class-default-object-cache class)
slot value)
)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;; EIEIO internal search functions
;;
(defun eieio--slot-name-index (class slot)
"In CLASS find the index of the named SLOT.
The slot is a symbol which is installed in CLASS by the `defclass' call.
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
If SLOT is the value created with :initarg instead,
reverse-lookup that name, and recurse with the associated slot value."
;; Removed checks to outside this call
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let* ((fsi (gethash slot (eieio--class-index-table class))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if (integerp fsi)
(+ (eval-when-compile eieio--object-num-slots) fsi)
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(let ((fn (eieio--initarg-to-attribute class slot)))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(if fn
;; Accessing a slot via its :initarg is accepted by EIEIO
;; (but not CLOS) but is a bad idea (for one: it's slower).
;; FIXME: We should emit a compile-time warning when this happens!
(eieio--slot-name-index class fn)
nil)))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--class-slot-name-index (class slot)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"In CLASS find the index of the named SLOT.
The slot is a symbol which is installed in CLASS by the `defclass'
call. If SLOT is the value created with :initarg instead,
reverse-lookup that name, and recurse with the associated slot value."
;; This will happen less often, and with fewer slots. Do this the
;; storage cheap way.
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((index nil)
(slots (eieio--class-class-slots class)))
(dotimes (i (length slots))
(if (eq slot (cl--slot-descriptor-name (aref slots i)))
(setq index i)))
index))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;;
;; Way to assign slots based on a list. Used for constructors, or
;; even resetting an object at run-time
;;
(defun eieio-set-defaults (obj &optional set-all)
"Take object OBJ, and reset all slots to their defaults.
If SET-ALL is non-nil, then when a default is nil, that value is
reset. If SET-ALL is nil, the slots are only reset if the default is
not nil."
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let ((slots (eieio--class-slots (eieio--object-class obj))))
(dotimes (i (length slots))
(let* ((name (cl--slot-descriptor-name (aref slots i)))
(df (eieio-oref-default obj name)))
(if (or df set-all)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(eieio-oset obj name df))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(defun eieio--initarg-to-attribute (class initarg)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"For CLASS, convert INITARG to the actual attribute name.
If there is no translation, pass it in directly (so we can cheat if
need be... May remove that later...)"
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot * lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
2014-12-29 17:11:09 +00:00
(let ((tuple (assoc initarg (eieio--class-initarg-tuples class))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(if tuple
(cdr tuple)
nil)))
;;;
;; Method Invocation order: C3
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--c3-candidate (class remaining-inputs)
"Return CLASS if it can go in the result now, otherwise nil."
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; Ensure CLASS is not in any position but the first in any of the
;; element lists of REMAINING-INPUTS.
(and (not (let ((found nil))
(while (and remaining-inputs (not found))
(setq found (member class (cdr (car remaining-inputs)))
remaining-inputs (cdr remaining-inputs)))
found))
class))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--c3-merge-lists (reversed-partial-result remaining-inputs)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Merge REVERSED-PARTIAL-RESULT REMAINING-INPUTS in a consistent order, if possible.
If a consistent order does not exist, signal an error."
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(setq remaining-inputs (delq nil remaining-inputs))
(if (null remaining-inputs)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;; If all remaining inputs are empty lists, we are done.
(nreverse reversed-partial-result)
;; Otherwise, we try to find the next element of the result. This
;; is achieved by considering the first element of each
;; (non-empty) input list and accepting a candidate if it is
;; consistent with the rests of the input lists.
(let* ((found nil)
(tail remaining-inputs)
(next (progn
(while (and tail (not found))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(setq found (eieio--c3-candidate (caar tail)
remaining-inputs)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
tail (cdr tail)))
found)))
(if next
;; The graph is consistent so far, add NEXT to result and
;; merge input lists, dropping NEXT from their heads where
;; applicable.
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--c3-merge-lists
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(cons next reversed-partial-result)
(mapcar (lambda (l) (if (eq (cl-first l) next) (cl-rest l) l))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
remaining-inputs))
;; The graph is inconsistent, give up
(signal 'inconsistent-class-hierarchy (list remaining-inputs))))))
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(defsubst eieio--class/struct-parents (class)
(or (eieio--class-parents class)
`(,eieio-default-superclass)))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--class-precedence-c3 (class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return all parents of CLASS in c3 order."
(let ((parents (eieio--class-parents class)))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--c3-merge-lists
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(list class)
(append
(or
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(mapcar #'eieio--class-precedence-c3 parents)
`((,eieio-default-superclass)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(list parents))))
)
;;;
;; Method Invocation Order: Depth First
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--class-precedence-dfs (class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return all parents of CLASS in depth-first order."
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(let* ((parents (eieio--class-parents class))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(classes (copy-sequence
(apply #'append
(list class)
(or
(mapcar
(lambda (parent)
(cons parent
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-precedence-dfs parent)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
parents)
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
`((,eieio-default-superclass))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(tail classes))
;; Remove duplicates.
(while tail
(setcdr tail (delq (car tail) (cdr tail)))
(setq tail (cdr tail)))
classes))
;;;
;; Method Invocation Order: Breadth First
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--class-precedence-bfs (class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return all parents of CLASS in breadth-first order."
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(let* ((result)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(queue (eieio--class/struct-parents class)))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(while queue
(let ((head (pop queue)))
(unless (member head result)
(push head result)
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(unless (eq head eieio-default-superclass)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(setq queue (append queue (eieio--class/struct-parents head)))))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(cons class (nreverse result)))
)
;;;
;; Method Invocation Order
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(defun eieio--class-precedence-list (class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
"Return (transitively closed) list of parents of CLASS.
The order, in which the parents are returned depends on the
method invocation orders of the involved classes."
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(if (or (null class) (eq class eieio-default-superclass))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
nil
Improve handling of doc-strings and describe-function for cl-generic * lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long as it's a symbol. (help-fns-short-filename): New function. (describe-function-1): Use it. Use autoload-do-load. * lisp/help-mode.el (help-function-def): Add optional arg `type'. * lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to override an autoload. (cl-generic-current-method-specializers): Replace dyn-bind variable with a lexically-scoped macro. (cl--generic-lambda): Update accordingly. (cl-generic-define-method): Record manually in the load-history with type `cl-defmethod'. (cl--generic-get-dispatcher): Minor optimization. (cl--generic-search-method): New function. (find-function-regexp-alist): Add entry for `cl-defmethod' type. (cl--generic-search-method): Add hyperlinks for methods. Merge the specializers and the function's arguments. * lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el. (eieio-defclass-autoload): Don't record the superclasses any more. (eieio-defclass-internal): Reuse the old class object if it was just an autoload stub. (eieio--class-precedence-list): Load the class if it's autoloaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core. (eieio--defgeneric-init-form): Don't throw away a previous docstring. (eieio--method-optimize-primary): Don't mess with the docstring. (defgeneric): Keep the `args' in the docstring. (defmethod): Don't use the method's docstring for the generic function's docstring. * lisp/emacs-lisp/find-func.el: Use lexical-binding. (find-function-regexp): Don't rule out `defgeneric'. (find-function-regexp-alist): Document new possibility of including a function instead of a regexp. (find-function-search-for-symbol): Implement that new possibility. (find-function-library): Don't assume that `function' is a symbol. (find-function-do-it): Remove unused var `orig-buf'. * test/automated/cl-generic-tests.el (cl-generic-test-8-after/before): Rename from cl-generic-test-7-after/before. (cl--generic-test-advice): New function. (cl-generic-test-9-advice): New test. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset eieio-test--1.
2015-01-17 03:52:15 +00:00
(unless (eieio--class-default-object-cache class)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
(eieio-class-un-autoload (eieio--class-name class)))
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(cl-case (eieio--class-method-invocation-order class)
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(:depth-first
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-precedence-dfs class))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(:breadth-first
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-precedence-bfs class))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(:c3
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
(eieio--class-precedence-c3 class))))
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
)
(define-obsolete-function-alias
* lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field. * lisp/emacs-lisp/eieio-core.el (eieio-class-object): New function. (eieio-class-parents-fast): Remove macro. (eieio--class-option-assoc): Rename from class-option-assoc. Update all callers. (eieio--class-option): Rename from class-option. Change `class' arg to be a class object. Update all callers. (eieio--class-method-invocation-order): Rename from class-method-invocation-order. Change `class' arg to be a class object. Update all callers. (eieio-defclass-autoload, eieio-defclass): Set the `parent' field to a list of class objects rather than names. (eieio-defclass): Remove redundant quotes. Use `eieio-oref-default' for accessors to class allocated slots. (eieio--perform-slot-validation-for-default): Rename from eieio-perform-slot-validation-for-default. Update all callers. (eieio--add-new-slot): Rename from eieio-add-new-slot. Update all callers. Use push. (eieio-copy-parents-into-subclass): Adjust to new content of `parent' field. Use dolist. (eieio-oref): Remove support for providing a class rather than an object. (eieio-oref-default): Prefer class objects over class names. (eieio--slot-originating-class-p): Rename from eieio-slot-originating-class-p. Update all callers. Use `or'. (eieio--slot-name-index): Turn check into assertion. (eieio--class-slot-name-index): Rename from eieio-class-slot-name-index. Change `class' arg to be a class object. Update all callers. (eieio-attribute-to-initarg): Move to eieio-test-persist.el. (eieio--c3-candidate): Rename from eieio-c3-candidate. Update all callers. (eieio--c3-merge-lists): Rename from eieio-c3-merge-lists. Update all callers. (eieio--class-precedence-c3): Rename from eieio-class-precedence-c3. Update all callers. (eieio--class-precedence-dfs): Rename from eieio-class-precedence-dfs. Update all callers. (eieio--class-precedence-bfs): Rename from eieio-class-precedence-bfs. Update all callers. Adjust to new `parent' content. (eieio--class-precedence-list): Rename from -class-precedence-list. Update all callers. (eieio-generic-call): Use autoloadp and autoload-do-load. Slight simplification. (eieio-generic-call, eieio-generic-call-primary-only): Adjust to new return value of `eieio-generic-form'. (eieiomt-add): Index the hashtable with class objects rather than class names. (eieio-generic-form): Accept class objects as well. * lisp/emacs-lisp/eieio.el (eieio-class-parents): Accept class objects. (eieio--class-slot-initarg): Rename from class-slot-initarg. Change `class' arg to be a class object. Update all callers. (call-next-method): Adjust to new return value of `eieio-generic-form'. (eieio-default-superclass): Set var to the class object. (eieio-edebug-prin1-to-string): Fix recursive call for lists. Change print behavior to affect class objects rather than class symbols. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Adjust to new convention for eieio-persistent-validate/fix-slot-value. (eieio-persistent-validate/fix-slot-value): Change `class' arg to be a class object. Update all callers. * test/automated/eieio-test-persist.el (eieio--attribute-to-initarg): Move from eieio-core.el. Rename from eieio-attribute-to-initarg. Change arg to be a class object. Update all callers. * test/automated/eieio-tests.el (eieio-test-04-static-method) (eieio-test-05-static-method-2): Use oref-default to access class slots. (eieio-test-23-inheritance-check): Don't assume that eieio-class-parents returns class names, or that a class can only have a single name.
2015-01-05 04:11:37 +00:00
'class-precedence-list 'eieio--class-precedence-list "24.4")
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;; Here are some special types of errors
;;
(define-error 'invalid-slot-name "Invalid slot name")
(define-error 'invalid-slot-type "Invalid slot type")
(define-error 'unbound-slot "Unbound slot")
(define-error 'inconsistent-class-hierarchy "Inconsistent class hierarchy")
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
;;; Hooking into cl-generic.
(require 'cl-generic)
;;;; General support to dispatch based on the type of the argument.
(cl-generic-define-generalizer eieio--generic-generalizer
;; Use the exact same tagcode as for cl-struct, so that methods
;; that dispatch on both kinds of objects get to share this
;; part of the dispatch code.
50 #'cl--generic-struct-tag
(lambda (tag &rest _)
(and (symbolp tag) (boundp tag) (eieio--class-p (symbol-value tag))
(mapcar #'eieio--class-name
(eieio--class-precedence-list (symbol-value tag))))))
Replace *-function vars with generic functions in cl-generic. * lisp/emacs-lisp/cl-generic.el (cl--generic-generalizer): New struct. (cl-generic-tagcode-function, cl-generic-tag-types-function): Remove. (cl--generic-t-generalizer): New const. (cl--generic-make-method): Rename from `cl--generic-method-make'. (cl--generic-make): Change calling convention. (cl--generic): Add `options' field. (cl-generic-function-options): New function. (cl-defgeneric): Rewrite handling of options. Add support for :method options and allow the use of a default body. (cl-generic-define): Save options in the corresponding new field. (cl-defmethod): Fix ordering of qualifiers. (cl-generic-define-method): Use cl-generic-generalizers. (cl--generic-get-dispatcher): Change calling convention, and change calling convention of the returned function as well so as to take the list of methods separately from the generic function object, so that it can receive the original generic function object. (cl--generic-make-next-function): New function, extracted from cl--generic-make-function. (cl--generic-make-function): Use it. (cl-generic-method-combination-function): Remove. (cl--generic-cyclic-definition): New error. (cl-generic-call-method): Take a generic function object rather than its name. (cl-method-qualifiers): New alias. (cl--generic-build-combined-method): Use cl-generic-combine-methods, don't segregate by qualifiers here any more. (cl--generic-standard-method-combination): Segregate by qualifiers here instead. Add support for the `:extra' qualifier. (cl--generic-cache-miss): Move earlier, adjust to new calling convention. (cl-generic-generalizers, cl-generic-combine-methods): New generic functions. (cl-no-next-method, cl-no-applicable-method, cl-no-primary-method): Use the new "default method in defgeneric" functionality, change calling convention to receive a generic function object. (cl--generic-head-used): New var. (cl--generic-head-generalizer, cl--generic-eql-generalizer) (cl--generic-struct-generalizer, cl--generic-typeof-generalizer): New consts. * lisp/emacs-lisp/eieio-core.el (eieio--generic-generalizer) (eieio--generic-subclass-generalizer): New consts. (cl-generic-generalizers): New methods. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-generalizer) (eieio--generic-static-object-generalizer): New consts. (cl-generic-generalizers) <(head eieio--static)>: New method. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Unfold closures like lambdas.
2015-03-05 01:04:57 +00:00
(cl-defmethod cl-generic-generalizers :extra "class" (specializer)
;; CLHS says:
;; A class must be defined before it can be used as a parameter
;; specializer in a defmethod form.
;; So we can ignore types that are not known to denote classes.
Replace *-function vars with generic functions in cl-generic. * lisp/emacs-lisp/cl-generic.el (cl--generic-generalizer): New struct. (cl-generic-tagcode-function, cl-generic-tag-types-function): Remove. (cl--generic-t-generalizer): New const. (cl--generic-make-method): Rename from `cl--generic-method-make'. (cl--generic-make): Change calling convention. (cl--generic): Add `options' field. (cl-generic-function-options): New function. (cl-defgeneric): Rewrite handling of options. Add support for :method options and allow the use of a default body. (cl-generic-define): Save options in the corresponding new field. (cl-defmethod): Fix ordering of qualifiers. (cl-generic-define-method): Use cl-generic-generalizers. (cl--generic-get-dispatcher): Change calling convention, and change calling convention of the returned function as well so as to take the list of methods separately from the generic function object, so that it can receive the original generic function object. (cl--generic-make-next-function): New function, extracted from cl--generic-make-function. (cl--generic-make-function): Use it. (cl-generic-method-combination-function): Remove. (cl--generic-cyclic-definition): New error. (cl-generic-call-method): Take a generic function object rather than its name. (cl-method-qualifiers): New alias. (cl--generic-build-combined-method): Use cl-generic-combine-methods, don't segregate by qualifiers here any more. (cl--generic-standard-method-combination): Segregate by qualifiers here instead. Add support for the `:extra' qualifier. (cl--generic-cache-miss): Move earlier, adjust to new calling convention. (cl-generic-generalizers, cl-generic-combine-methods): New generic functions. (cl-no-next-method, cl-no-applicable-method, cl-no-primary-method): Use the new "default method in defgeneric" functionality, change calling convention to receive a generic function object. (cl--generic-head-used): New var. (cl--generic-head-generalizer, cl--generic-eql-generalizer) (cl--generic-struct-generalizer, cl--generic-typeof-generalizer): New consts. * lisp/emacs-lisp/eieio-core.el (eieio--generic-generalizer) (eieio--generic-subclass-generalizer): New consts. (cl-generic-generalizers): New methods. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-generalizer) (eieio--generic-static-object-generalizer): New consts. (cl-generic-generalizers) <(head eieio--static)>: New method. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Unfold closures like lambdas.
2015-03-05 01:04:57 +00:00
(or
(and (eieio--class-p (eieio--class-object specializer))
(list eieio--generic-generalizer))
(cl-call-next-method)))
;;;; Dispatch for arguments which are classes.
;; Since EIEIO does not support metaclasses, users can't easily use the
;; "dispatch on argument type" for class arguments. That's why EIEIO's
;; `defmethod' added the :static qualifier. For cl-generic, such a qualifier
;; would not make much sense (e.g. to which argument should it apply?).
;; Instead, we add a new "subclass" specializer.
(defun eieio--generic-subclass-specializers (tag &rest _)
(when (eieio--class-p tag)
(mapcar (lambda (class)
EIEIO: Change class's representation to unify instance & class slots * lisp/emacs-lisp/eieio-core.el (eieio--class): Change field names and order to match those of cl--class; use cl--slot for both instance slots and class slots. (eieio--object-num-slots): Use cl-struct-slot-info. (eieio--object-class): Rename from eieio--object-class-object. (eieio--object-class-name): Remove. (eieio-defclass-internal): Adjust to new slot representation. Store doc in class rather than in `variable-documentation'. (eieio--perform-slot-validation-for-default): Change API to take a slot object. (eieio--slot-override): New function. (eieio--add-new-slot): Rewrite. (eieio-copy-parents-into-subclass): Rewrite. (eieio--validate-slot-value, eieio--validate-class-slot-value) (eieio-oref-default, eieio-oset-default) (eieio--class-slot-name-index, eieio-set-defaults): Adjust to new slot representation. (eieio--c3-merge-lists): Simplify. (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. * lisp/emacs-lisp/eieio.el (with-slots): Use macroexp-let2. (object-class-fast): Change recommend replacement. (eieio-object-class): Rewrite. (slot-exists-p): Adjust to new slot representation. (initialize-instance): Adjust to new slot representation. (object-write): Adjust to new slot representation. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object): Manually map initargs to slot names. (eieio-persistent-validate/fix-slot-value): Adjust to new slot representation. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. * lisp/emacs-lisp/eieio-custom.el (eieio-object-value-create) (eieio-object-value-get): Adjust to new slot representation. * lisp/emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): Declare to silence warnings. (data-debug-insert-object-button): Avoid `object-slots'. (data-debug/eieio-insert-slots): Adjust to new slot representation. * lisp/emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function extracted from eieio-help-class-slots. (eieio-help-class-slots): Use it. Adjust to new slot representation. * test/automated/eieio-test-methodinvoke.el (make-instance): Use new-style `subclass' specializer for a change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): Adjust to new slot representation. * test/automated/eieio-tests.el (eieio-test-17-virtual-slot): Don't use initarg in `oset'. (eieio-test-32-slot-attribute-override-2): Adjust to new slot representation. * lisp/emacs-lisp/cl-preloaded.el (cl--class): Fix type of `parents'.
2015-03-19 03:02:26 +00:00
`(subclass ,(eieio--class-name class)))
(eieio--class-precedence-list tag))))
(cl-generic-define-generalizer eieio--generic-subclass-generalizer
60 (lambda (name &rest _) `(and (symbolp ,name) (cl--find-class ,name)))
#'eieio--generic-subclass-specializers)
Replace *-function vars with generic functions in cl-generic. * lisp/emacs-lisp/cl-generic.el (cl--generic-generalizer): New struct. (cl-generic-tagcode-function, cl-generic-tag-types-function): Remove. (cl--generic-t-generalizer): New const. (cl--generic-make-method): Rename from `cl--generic-method-make'. (cl--generic-make): Change calling convention. (cl--generic): Add `options' field. (cl-generic-function-options): New function. (cl-defgeneric): Rewrite handling of options. Add support for :method options and allow the use of a default body. (cl-generic-define): Save options in the corresponding new field. (cl-defmethod): Fix ordering of qualifiers. (cl-generic-define-method): Use cl-generic-generalizers. (cl--generic-get-dispatcher): Change calling convention, and change calling convention of the returned function as well so as to take the list of methods separately from the generic function object, so that it can receive the original generic function object. (cl--generic-make-next-function): New function, extracted from cl--generic-make-function. (cl--generic-make-function): Use it. (cl-generic-method-combination-function): Remove. (cl--generic-cyclic-definition): New error. (cl-generic-call-method): Take a generic function object rather than its name. (cl-method-qualifiers): New alias. (cl--generic-build-combined-method): Use cl-generic-combine-methods, don't segregate by qualifiers here any more. (cl--generic-standard-method-combination): Segregate by qualifiers here instead. Add support for the `:extra' qualifier. (cl--generic-cache-miss): Move earlier, adjust to new calling convention. (cl-generic-generalizers, cl-generic-combine-methods): New generic functions. (cl-no-next-method, cl-no-applicable-method, cl-no-primary-method): Use the new "default method in defgeneric" functionality, change calling convention to receive a generic function object. (cl--generic-head-used): New var. (cl--generic-head-generalizer, cl--generic-eql-generalizer) (cl--generic-struct-generalizer, cl--generic-typeof-generalizer): New consts. * lisp/emacs-lisp/eieio-core.el (eieio--generic-generalizer) (eieio--generic-subclass-generalizer): New consts. (cl-generic-generalizers): New methods. * lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-generalizer) (eieio--generic-static-object-generalizer): New consts. (cl-generic-generalizers) <(head eieio--static)>: New method. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Unfold closures like lambdas.
2015-03-05 01:04:57 +00:00
(cl-defmethod cl-generic-generalizers ((_specializer (head subclass)))
(list eieio--generic-subclass-generalizer))
;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "dba4205b1a0d7133f1311d975b4d0ebe")
;;; Generated autoloads from eieio-compat.el
(autoload 'eieio--defalias "eieio-compat" "\
Like `defalias', but with less side-effects.
More specifically, it has no side-effects at all when the new function
definition is the same (`eq') as the old one.
\(fn NAME BODY)" nil nil)
(autoload 'defgeneric "eieio-compat" "\
Create a generic function METHOD.
DOC-STRING is the base documentation for this class. A generic
function has no body, as its purpose is to decide which method body
is appropriate to use. Uses `defmethod' to create methods, and calls
`defgeneric' for you. With this implementation the ARGS are
currently ignored. You can use `defgeneric' to apply specialized
top level documentation to a method.
\(fn METHOD ARGS &optional DOC-STRING)" nil t)
(function-put 'defgeneric 'doc-string-elt '3)
(make-obsolete 'defgeneric 'cl-defgeneric '"25.1")
(autoload 'defmethod "eieio-compat" "\
Create a new METHOD through `defgeneric' with ARGS.
The optional second argument KEY is a specifier that
modifies how the method is called, including:
:before - Method will be called before the :primary
:primary - The default if not specified
:after - Method will be called after the :primary
:static - First arg could be an object or class
The next argument is the ARGLIST. The ARGLIST specifies the arguments
to the method as with `defun'. The first argument can have a type
specifier, such as:
((VARNAME CLASS) ARG2 ...)
where VARNAME is the name of the local variable for the method being
created. The CLASS is a class symbol for a class made with `defclass'.
A DOCSTRING comes after the ARGLIST, and is optional.
All the rest of the args are the BODY of the method. A method will
return the value of the last form in the BODY.
Summary:
(defmethod mymethod [:before | :primary | :after | :static]
((typearg class-name) arg2 &optional opt &rest rest)
\"doc-string\"
body)
\(fn METHOD &rest ARGS)" nil t)
(function-put 'defmethod 'doc-string-elt '3)
(make-obsolete 'defmethod 'cl-defmethod '"25.1")
(autoload 'eieio--defgeneric-init-form "eieio-compat" "\
\(fn METHOD DOC-STRING)" nil nil)
(autoload 'eieio--defmethod "eieio-compat" "\
\(fn METHOD KIND ARGCLASS CODE)" nil nil)
2015-01-21 11:20:15 +00:00
(autoload 'eieio-defmethod "eieio-compat" "\
Obsolete work part of an old version of the `defmethod' macro.
\(fn METHOD ARGS)" nil nil)
(make-obsolete 'eieio-defmethod 'cl-defmethod '"24.1")
(autoload 'eieio-defgeneric "eieio-compat" "\
Obsolete work part of an old version of the `defgeneric' macro.
\(fn METHOD DOC-STRING)" nil nil)
(make-obsolete 'eieio-defgeneric 'cl-defgeneric '"24.1")
(autoload 'eieio-defclass "eieio-compat" "\
\(fn CNAME SUPERCLASSES SLOTS OPTIONS)" nil nil)
(make-obsolete 'eieio-defclass 'eieio-defclass-internal '"25.1")
;;;***
Merge from CEDET upstream (8564). * lisp/emacs-lisp: * emacs-lisp/eieio.el (eieio--defalias, eieio-hook) (eieio-error-unsupported-class-tags, eieio-skip-typecheck) (eieio-optimize-primary-methods-flag, eieio-initializing-object) (eieio-unbound, eieio-default-superclass) (eieio--define-field-accessors, method-static, method-before) (method-primary, method-after, method-num-lists) (method-generic-before, method-generic-primary) (method-generic-after, method-num-slots) (eieio-specialized-key-to-generic-key) (eieio--check-type, class-v, class-p) (eieio-class-name, define-obsolete-function-alias) (eieio-class-parents-fast, eieio-class-children-fast) (same-class-fast-p, class-constructor, generic-p) (generic-primary-only-p, generic-primary-only-one-p) (class-option-assoc, class-option, eieio-object-p) (class-abstract-p, class-method-invocation-order) (eieio-defclass-autoload-map, eieio-defclass-autoload) (eieio-class-un-autoload, eieio-defclass) (eieio-eval-default-p, eieio-perform-slot-validation-for-default) (eieio-add-new-slot, eieio-copy-parents-into-subclass) (eieio--defgeneric-init-form, eieio-defgeneric-form) (eieio-defgeneric-reset-generic-form) (eieio-defgeneric-form-primary-only) (eieio-defgeneric-reset-generic-form-primary-only) (eieio-defgeneric-form-primary-only-one) (eieio-defgeneric-reset-generic-form-primary-only-one) (eieio-unbind-method-implementations) (eieio--defmethod, eieio--typep) (eieio-perform-slot-validation, eieio-validate-slot-value) (eieio-validate-class-slot-value, eieio-barf-if-slot-unbound) (eieio-oref, eieio-oref-default, eieio-default-eval-maybe) (eieio-oset, eieio-oset-default, eieio-slot-originating-class-p) (eieio-slot-name-index, eieio-class-slot-name-index) (eieio-set-defaults, eieio-initarg-to-attribute) (eieio-attribute-to-initarg, eieio-c3-candidate) (eieio-c3-merge-lists, eieio-class-precedence-c3) (eieio-class-precedence-dfs, eieio-class-precedence-bfs) (eieio-class-precedence-list, eieio-generic-call-methodname) (eieio-generic-call-arglst, eieio-generic-call-key) (eieio-generic-call-next-method-list) (eieio-pre-method-execution-functions, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-method-list) (eieiomt-optimizing-obarray, eieiomt-install) (eieiomt-add, eieiomt-next, eieiomt-sym-optimize) (eieio-generic-form, eieio-defmethod, make-obsolete) (eieio-defgeneric, make-obsolete): Moved to eieio-core.el (defclass): Remove `eval-and-compile' from macro. (call-next-method, shared-initialize): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. (initialize-instance): Rename local variable 'scoped-class' to 'this-class' to remove ambiguitity from old global. * emacs-lisp/eieio-core.el: New file. Derived from key parts of eieio.el. (eieio--scoped-class-stack): New variable (eieio--scoped-class): New fcn (eieio--with-scoped-class): New scoping macro. (eieio-defclass): Use pushnew instead of add-to-list. (eieio-defgeneric-form-primary-only-one, eieio-oset-default) (eieio-slot-name-index, eieio-set-defaults, eieio-generic-call) (eieio-generic-call-primary-only, eieiomt-add): Instead of using `scoped-class' variable, use new eieio--scoped-class, and eieio--with-scoped-class. * emacs-lisp/eieio-base.el (cl-lib): Require during compile. * admin/grammars: * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. (wisent-srecode-template-lexer): Move number up so it can be created. * etc/srecode: * srecode/c.srt (header_guard): Add :c parameter so it works standalone * lisp/cedet: * semantic/edit.el (semantic-change-function): Use `save-match-data' around running hooks. * semantic/decorate/mode.el (semantic-decorate-style-predicate-default) (semantic-decorate-style-highlighter-default): New. (semantic-decoration-mode): Do not require `semantic/decorate/include' anymore. (semantic-toggle-decoration-style): Error if an unknown decoration style is toggled. (define-semantic-decoration-style): Add new :load option. When :load is specified, add autoload tokens for the definition functions so that code is loaded when the mode is used. (semantic-decoration-on-includes): New autoload definition for highlighting includes. * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc characters to appear after the tested variable. * semantic/ede-grammar.el (project-compile-target): Calculate full src name via ede-expand-filename instead of the crutch of the current buffer. Enables this target to compile in batch mode. * semantic/idle.el (semantic-idle-symbol-maybe-highlight): Wrap highlighting of remote symbol with `save-excursion'. (semantic-idle-scheduler-work-parse-neighboring-files): Instead of using directory-files on each found mode pattern, collect all the patterns for the current mode, and then for each file, see if it matches any of them. If it does, parse the file. (Patch inspiration from Tomasz Gajewski.) * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New. (semantic-ctxt-current-symbol-default): New. * semantic/bovine/el.el (semantic-default-elisp-setup): Add autoload cookie. Explain existence. (footer): Add local variable for loaddefs. * semantic/db.el (semanticdb-file-table-object): Add new filter, only checking for regular files too. * semantic/wisent/python.el (semantic-format-tag-abbreviate): New override. Cuts back on size of code tags. * srecode/compile.el (srecode-compile-templates): Fix warning punctuation. Remove status messages to clean up testing output * ede/base.el (ede-project-placeholder-cache-file): Update doc to mention 'nil' value. (ede-save-cache): Disable cache save if file is nil. * ede.el (ede-initialize-state-current-buffer): Flush deleted projects. (global-ede-mode): Always append our find-file-hook to the end. (ede-flush-deleted-projects): New command. * ede/cpp-root.el (ede-preprocessor-map): Protect against init problems. * ede/proj.el (ede-proj-target): Added a new "custom" option for custom symbols representing a compiler or linker instead of restricting things to only the predefined compilers and linkers. * semantic.el (semantic-mode-map): To avoid showing showing Development menu twice, only disable menu item if menu-bar is actually enabled, otherwise the popup 'global menu' might display a disabled Development menu. * semantic/complete.el (semantic-displayor-show-request): Fix which slot in obj is set to the max tags.
2013-06-02 13:33:09 +00:00
(provide 'eieio-core)
;;; eieio-core.el ends here