summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Tighten up the tagcode used for eieio and cl-struct objectsStefan Monnier2015-01-274-128/+176
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Set the function slot of the tag symbol to :quick-object-witness-check. (eieio-object-p): Use :quick-object-witness-check. (eieio--generic-tagcode): Use cl--generic-struct-tag. * lisp/emacs-lisp/cl-preloaded.el: New file. * lisp/emacs-lisp/cl-macs.el (cl--bind-inits): Remove, unused. (cl--transform-lambda, cl-destructuring-bind): Remove cl--bind-inits. (cl--make-usage-args): Strip away &aux args. (cl-case, cl-typecase, cl--parse-loop-clause): Use macroexp-let2. (cl-the, cl-check-type): Use macroexp-let2 and cl-typep. (cl-defstruct): Use `declare' and cl-struct-define. * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): New function. (cl--generic-struct-tagcode): Use it to tighten the tagcode. * lisp/loadup.el: Load cl-preloaded. * src/lisp.mk (lisp): Add cl-preloaded.
* lisp/emacs-lisp/cl.el (cl--function-convert): Merge cache that ↵Katsumi Yamaoka2015-01-271-1/+3
| | | | cl--labels-convert adds (bug#19699)
* Auto-commit of loaddefs files.Glenn Morris2015-01-272-2/+2
|
* lisp/emacs-lisp/derived.el (define-derived-mode): Declare indent 3.Oleh Krehel2015-01-271-1/+2
| | | | | | | | | | | | Now, e.g. `indent-sexp' will produce: (define-derived-mode outline-mode text-mode "Outline" "Set ...") instead of: (define-derived-mode outline-mode text-mode "Outline" "Set ...")
* lisp/emacs-lisp/cl.el (cl--function-convert): Work for cl-flet and cl-labelsKatsumi Yamaoka2015-01-271-7/+4
|
* * lisp/emacs-lisp/cl-generic.el (cl--generic-method): New struct.Stefan Monnier2015-01-263-81/+104
| | | | | | | | | | | | | | | | | | | | | | | (cl--generic): The method-table is now a (list-of cl--generic-method). (cl--generic-member-method): New function. (cl-generic-define-method): Use it. (cl--generic-build-combined-method, cl--generic-cache-miss): Adapt to new method-table. (cl--generic-no-next-method-function): Add `method' argument. (cl-generic-call-method): Adapt to new method representation. (cl--generic-cnm-sample, cl--generic-nnm-sample): Adjust. (cl-find-method, cl-method-qualifiers): New functions. (cl--generic-method-info): Adapt to new method representation. Return a string for the qualifiers. (cl--generic-describe): * lisp/emacs-lisp/eieio-opt.el (eieio-help-class): Adjust accordingly. (eieio-all-generic-functions, eieio-method-documentation): Adjust to new method representation. * lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Use cl-find-method. * test/automated/cl-generic-tests.el: Try and make sure cl-lib is not required at run-time.
* * lisp/emacs-lisp/cl-generic.el: Add a method-combination hook.Stefan Monnier2015-01-263-107/+120
| | | | | | | | | | | | | | | | | | | | | | | | (cl-generic-method-combination-function): New var. (cl--generic-lambda): Remove `with-cnm' arg. (cl-defmethod): Change accordingly. (cl-generic-define-method): Don't check qualifiers validity. Preserve all qualifiers in `method-table'. (cl-generic-call-method): New function. (cl--generic-nest): Remove (morph into cl-generic-call-method). (cl--generic-build-combined-method): Adjust to new format of method-table and use cl-generic-method-combination-function. (cl--generic-standard-method-combination): New function, extracted from cl--generic-build-combined-method. (cl--generic-cnm-sample): Adjust to new format of method-table. * lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Use () qualifiers instead of :primary. * lisp/emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): Remove obsolete function. * test/automated/cl-generic-tests.el (cl-generic-test-11-next-method-p): New test.
* * lisp/emacs-lisp/cl-generic.el: Fix next-method-p testStefan Monnier2015-01-251-22/+34
| | | | | | | | | Fixes: debbugs:19672 * lisp/emacs-lisp/cl-generic.el (cl--generic-no-next-method-function): New. (cl--generic-build-combined-method, cl--generic-nnm-sample): Use it. (cl--generic-typeof-types): Add support for `sequence'. (cl-defmethod): Add non-keywords in the qualifiers.
* (find-function-regexp): Don't match `defgroup'Dmitry Gutov2015-01-251-1/+1
| | | | | * lisp/emacs-lisp/find-func.el (find-function-regexp): Don't match `defgroup' (regression from the previous change here).
* * lisp/emacs-lisp/cl-generic.el (cl-no-primary-method): New fun and error.Stefan Monnier2015-01-231-5/+13
| | | | (cl--generic-build-combined-method): Use it.
* Auto-commit of loaddefs files.Glenn Morris2015-01-222-3/+3
|
* Don't downcase system diagnostics' first lettersPaul Eggert2015-01-211-2/+2
| | | | | | | | | | | | | | | | | | * etc/NEWS: Document this. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): * lisp/ffap.el (find-file-at-point): * lisp/files.el (insert-file-1): * lisp/net/ange-ftp.el (ange-ftp-barf-if-not-directory) (ange-ftp-copy-file-internal): * lisp/progmodes/etags.el (visit-tags-table): * lisp/url/url-dav.el (url-dav-delete-directory, url-dav-delete-file) (url-dav-directory-files): Keep diagnostics consistent with system's. * lisp/erc/erc-dcc.el (erc-dcc-server): * lisp/ffap.el (ffap-machine-p): Ignore case while comparing diagnostics. * src/fileio.c (report_file_errno): Don't downcase, and simplify. Fixes: bug#19642
* Avoid generating invalid usage info for pathological functionStefan Monnier2015-01-211-2/+3
| | | | | | | | Fixes: debbugs:19645 * lisp/help.el (help-make-usage): Don't turn a "_" arg into an empty-string. * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Don't confuse a string body with a docstring.
* * lisp/emacs-lisp/eieio*.el: Fix up warnings and improve compatibilityStefan Monnier2015-01-218-202/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: debbugs:19645 * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add support for `declare'. (cl--generic-setf-rewrite): Setup the setf expander right away. (cl-defmethod): Make sure the setf expander is setup before we expand the body. (cl-defmethod): Silence byte-compiler warnings. (cl-generic-define-method): Shuffle code to change return value. (cl--generic-method-info): New function, extracted from cl--generic-describe. (cl--generic-describe): Use it. * lisp/emacs-lisp/eieio-speedbar.el: * lisp/emacs-lisp/eieio-datadebug.el: * lisp/emacs-lisp/eieio-custom.el: * lisp/emacs-lisp/eieio-base.el: Use cl-defmethod. * lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Avoid no-next-method errors when there's a `before' but no `primary'. (next-method-p): Return nil rather than signal an error. (eieio-defgeneric): Remove bogus (fboundp 'method). * lisp/emacs-lisp/eieio-opt.el: Adapt to cl-generic. (eieio--specializers-apply-to-class-p): New function. (eieio-all-generic-functions): Use it. (eieio-method-documentation): Use it as well as cl--generic-method-info. Change format of return value. (eieio-help-class): Adapt accordingly. * lisp/emacs-lisp/eieio.el: Use cl-defmethod. (defclass): Generate cl-defmethod calls; use setf methods for :accessor. (eieio-object-name-string): Declare as obsolete. * test/automated/cl-generic-tests.el (setf cl--generic-2): Make sure the setf can be used already in the body of the method.
* Auto-commit of loaddefs files.Glenn Morris2015-01-211-1/+22
|
* emacs-lisp/package.el (package-dir-info): Fix `while' logic.Artur Malabarba2015-01-201-3/+8
|
* lisp/emacs-lisp/eieio*.el: Rewrite our generics on top of cl-genericStefan Monnier2015-01-207-949/+356
| | | | | | | | | | | | | * lisp/emacs-lisp/eieio-generic.el: Remove. (defgeneric, defmethod): Move to eieio-compat.el. Mark obsolete. * lisp/emacs-lisp/eieio-compat.el: New file. * lisp/emacs-lisp/eieio.el: Don't require eieio-generic any more. * lisp/emacs-lisp/eieio-core.el (eieio--slot-originating-class-p): Remove unused function. (eieio-defclass): Move to eieio-compat.el. * lisp/emacs-lisp/macroexp.el (macroexp-macroexpand): New function. (macroexp--expand-all): Use it. * lisp/emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel): Here too.
* eldoc: modify `eldoc-documentation-function' using `add-function'Michal Nazarewicz2015-01-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): Describe how major modes should use `add-function' to alter value of the variable. * lisp/hexl.el (hexl-mode): Set `eldoc-documentation-function' using `add-function' so the default value is always used. * lisp/ielm.el (inferior-emacs-lisp-mode): Set `eldoc-documentation-function' using `add-function' so the default value is always used. * lisp/progmodes/cfengine.el (cfengine3-mode): Set `eldoc-documentation-function' using `add-function' so the default value is always used. * lisp/progmodes/elisp-mode (emacs-lisp-mode): Set `eldoc-documentation-function' using `add-function' so the default value is always used. * lisp/progmodes/octave.el (octave-mode): Set `eldoc-documentation-function' using `add-function' so the default value is always used. * lisp/progmodes/python.el (python-mode): Set `eldoc-documentation-function' using `add-function' so the default value is always used. * lisp/simple.el (read--expression): Set `eldoc-documentation-function' using `add-function' so the default value is always used.
* * lisp/emacs-lisp/eieio-core.el: Add `subclass' specializer for cl-generic.Stefan Monnier2015-01-181-0/+25
| | | | | | | | | (eieio--generic-subclass-tagcode, eieio--generic-subclass-tag-types): New functions. (cl-generic-tagcode-function, cl-generic-tag-types-function): Use them. * test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Test `subclass' specializer.
* EIEIO&cl-generic: Add obsolescence warnings and fix corner caseStefan Monnier2015-01-183-10/+30
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Correctly handle introduction of a new dispatch argument. (cl--generic-cache-miss): Handle dispatch on an argument which was not considered as dispatchable for this method. (cl-defmethod): Warn when adding a method to an obsolete generic function. (cl--generic-lambda): Make sure it works if cl-lib is not yet loaded. * lisp/emacs-lisp/eieio-generic.el (eieio--defgeneric-init-form): Use autoloadp. * lisp/emacs-lisp/eieio.el (defclass): Add obsolescence warning for the `newname' argument. * test/automated/cl-generic-tests.el (cl-generic-test-10-weird): New test. Rename other tests to preserve ordering.
* (package--append-to-alist): Updated docstring due to new name.Artur Malabarba2015-01-181-3/+5
|
* package.el (package--append-to-alist): Renamed from `add-to-alist'Artur Malabarba2015-01-181-3/+3
|
* Fix seq-subseq and cl-subseq for bad bounding indicesLeo Liu2015-01-182-25/+12
| | | | | | | | | | | | Fixes: debbugs:19434 debbugs:19519 * lisp/emacs-lisp/cl-extra.el (cl-subseq): Use seq-subseq and fix multiple evaluation. * lisp/emacs-lisp/seq.el (seq-subseq): Throw bad bounding indices error. * test/automated/seq-tests.el (test-seq-subseq): Add more tests.
* * lisp/emacs-lisp/cl-generic.el: Add support for cl-next-method-p.Stefan Monnier2015-01-172-14/+66
| | | | | | | | | | | (cl-defmethod): Add edebug spec. (cl--generic-build-combined-method): Fix call to cl-no-applicable-method. (cl--generic-nnm-sample, cl--generic-cnm-sample): New constant. (cl--generic-isnot-nnm-p): New function. (cl--generic-lambda): Use it to add support for cl-next-method-p. (cl-no-next-method, cl-no-applicable-method): Simplify arg list. (cl-next-method-p): New function.
* * lisp/emacs-lisp/eieio-core.el (eieio--class-constructor): Rename.Stefan Monnier2015-01-174-9/+6
| | | | | | | Fixes: debbugs:19620 (eieio--class-constructor): Rename from class-constructor, and make it an alias for `identity'. Update all callers.
* * lisp/emacs-lisp/eieio.el: Improve `constructor' compatibility.Stefan Monnier2015-01-172-7/+9
| | | | | | | | | | Fixes: debbugs:19620 (eieio-constructor): Handle obsolete object name argument here... (defclass): ...instead of in the constructor here. * test/automated/eieio-tests.el (eieio-test-37-obsolete-name-in-constructor): New test.
* Type fix for defcustom.Jorgen Schaefer2015-01-171-1/+2
| | | | | * emacs-lisp/package.el (package-archive-priorities): Specify correct type.
* Don't enforce :protection in EIEIO objects any moreStefan Monnier2015-01-163-134/+74
| | | | | | | | | | | | | | | | | | | | | | | * doc/misc/eieio.texi (Slot Options): Document :protection as unsupported. * lisp/emacs-lisp/eieio-core.el (eieio--scoped-class-stack): Remove var. (eieio--scoped-class): Remove function. (eieio--with-scoped-class): Remove macro. Replace uses with `progn'. (eieio--slot-name-index): Don't check the :protection anymore. (eieio-initializing-object): Remove var. (eieio-set-defaults): Don't let-bind eieio-initializing-object. * lisp/emacs-lisp/eieio-generic.el (call-next-method): Don't bother checking eieio--scoped-class any more. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Use an explicit arg instead of eieio--scoped-class. Update all callers. * test/automated/eieio-tests.el (eieio-test-25-slot-tests) (eieio-test-26-default-inheritance, eieio-test-28-slot-protection) (eieio-test-30-slot-attribute-override) (eieio-test-31-slot-attribute-override-class-allocation): Don't check that we enforce :protection since we don't any more.
* Improve handling of doc-strings and describe-function for cl-genericStefan Monnier2015-01-164-147/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* emacs-lisp/package.el and package-x.el: References to package-desc-kindArtur Malabarba2015-01-162-0/+8
|
* (package-install-file): Install packages from directory.Artur Malabarba2015-01-161-2/+6
|
* (package-install-from-buffer): Install packages from dired buffer.Artur Malabarba2015-01-161-5/+34
|
* * emacs-lisp/package.el (package-dir-info): New function.Artur Malabarba2015-01-161-0/+18
| | | | | Find package information for a directory. The return result is a `package-desc'.
* * emacs-lisp/package.el (package--read-pkg-desc): New function.Artur Malabarba2015-01-161-10/+16
| | | | | Read a `define-package' form in current buffer. Return the pkg-desc, with desc-kind set to KIND.
* * lisp/emacs-lisp/cl-macs.el: Fix last change.Stefan Monnier2015-01-161-15/+22
| | | | | | (cl--labels-magic): New constant. (cl--labels-convert): Use it to ask the macro what is its replacement in the #'f case.
* * lisp/emacs-lisp/cl-generic.el (cl--generic-build-combined-method):Stefan Monnier2015-01-161-3/+4
| | | | Return the value of the primary rather than the after method.
* Package archives now have priorities.Jorgen Schaefer2015-01-161-26/+70
| | | | | | | | | | | | | * lisp/package.el: Provide repository priorities. (package-archive-priorities): New variable. (package--add-to-alist): New function. (package--add-to-archive-contents): Use it. (package-menu--find-upgrades): Use it as well. Small clean up to make the use of the package name here explicit. (package-archive-priority): New function. (package-desc-priority-version): New function. Fixes: debbugs:19296
* # Set copyright to FSF, standardize license noticeGlenn Morris2015-01-141-4/+6
|
* * lisp/emacs-lisp/eieio-core.el: Provide support for cl-generic.Stefan Monnier2015-01-152-5/+29
| | | | | | | | | | | | | | | (eieio--generic-tagcode): New function. (cl-generic-tagcode-function): Use it. (eieio--generic-tag-types): New function. (cl-generic-tag-types-function): Use it. (eieio-object-p): Tighten up the test. * lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Fix paren typo. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Add keysym arg instead of relying on internal var eieio--generic-call-key. Update all callers. (eieio-test-cl-generic-1): New tests.
* * lisp/emacs-lisp/cl-generic.el: New file.Stefan Monnier2015-01-142-17/+640
| | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-flet): Allow (FUN EXP) forms. (cl-load-time-value, cl-labels): Use closures rather than backquoted lambdas. (cl-macrolet): Use `eval' to create the function value, and support CL style arguments in for the defined macros. * test/automated/cl-generic-tests.el: New file.
* Fixes: debbugs:19552Stefan Monnier2015-01-131-1/+1
| | | | * lisp/emacs-lisp/eieio-core.el (eieio-defclass): Fix call to `defclass'.
* Shrink EIEIO object header. Move generics to eieio-generic.el.Stefan Monnier2015-01-089-1787/+1794
|\
| * * lisp/emacs-lisp/eieio*.el: Move the function defs to defclass.Stefan Monnier2015-01-083-271/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eieio.el (defclass): Move from eieio-defclass all the code that creates functions, and most of the sanity checks. Mark as obsolete the <class>-child-p function. * lisp/emacs-lisp/eieio-core.el (eieio--define-field-accessors): Remove. (eieio--class, eieio--object): Use cl-defstruct. (eieio--object-num-slots): Define manually. (eieio-defclass-autoload): Use eieio--class-make. (eieio-defclass-internal): Rename from eieio-defclass. Move all the `(lambda...) definitions and most of the sanity checks to `defclass'. Mark as obsolete the <class>-list-p function, the <class> variable and the <initarg> variables. Use pcase-dolist. (eieio-defclass): New compatibility function. * lisp/emacs-lisp/eieio-opt.el (eieio-build-class-alist) (eieio-class-speedbar): Don't use eieio-default-superclass var.
| * * emacs-lisp/eieio-generic.el: New file.Stefan Monnier2015-01-086-888/+913
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eieio-core.el: Move all generic function code to eieio-generic.el. (eieio--defmethod): Declare. * lisp/emacs-lisp/eieio.el: Require eieio-generic. Move all generic function code to eieio-generic.el. * lisp/emacs-lisp/eieio-opt.el (eieio-help-generic): Move to eieio-generic.el. * lisp/emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): Update call to eieio--generic-call. * lisp/emacs-lisp/eieio-base.el (eieio-instance-inheritor): Don't use <class>-child type. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Update reference to eieio--generic-call-key. * test/automated/eieio-tests.el (eieio-test-23-inheritance-check): Don't use <foo>-child-p.
| * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): New var.Stefan Monnier2015-01-075-127/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * * lisp/emacs-lisp/eieio*.el: Use class objects in `parent' field.Stefan Monnier2015-01-046-250/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slotStefan Monnier2014-12-294-76/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * * lisp/emacs-lisp/eieio*.el: Remove "name" field of objectsStefan Monnier2014-12-224-101/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * * lisp/emacs-lisp/eieio-core.el (eieio--class-v): Rename from class-v.Stefan Monnier2014-12-227-157/+148
| | | | | | | | | | | | | | | | (method-*): Add a "eieio--" prefix to those constants. * lisp/emacs-lisp/eieio-speedbar.el: Use lexical-binding. * lisp/emacs-lisp/eieio.el: Move edebug specs to the corresponding macro.
| * * lisp/emacs-lisp/eieio*.el: Use hashtables rather than obarraysStefan Monnier2014-12-226-353/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 $.