summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-preloaded.el
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/emacs-lisp/cl-preloaded.el: Fix the format of props in slot-descsStefan Monnier2021-06-241-10/+11
| | | | | | | | | | (cl--plist-remove): Remove. (cl--plist-to-alist): New function. (cl-struct-define): Use it to convert slots's properties to the format expected by `cl-slot-descriptor`. * lisp/emacs-lisp/cl-extra.el (cl--describe-class-slots): Revert last changes, not needed any more.
* Fix copyright years by handPaul Eggert2021-01-011-1/+1
| | | | These are dates that admin/update-copyright did not update.
* Fix copyright years by handPaul Eggert2020-01-011-1/+1
| | | | These are dates that admin/update-copyright did not update.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Fix copyright years by handPaul Eggert2019-01-011-1/+1
| | | | | | | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* | Add missing module types to cl--typeof-types.Philipp Stephani2018-01-281-0/+2
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add module types. * test/src/emacs-module-tests.el (emacs-module-tests--generic): New helper function. (module-function-object, mod-test-userptr-fun-test): Test that type dispatching works with module types.
* | Prevent name clashes between CL structures and builtin typesPhilipp Stephani2018-01-281-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't allow structures with the same names as builtin types. (cl--typeof-types, cl--all-builtin-types): Move from cl-generic.el and rename. (cl--struct-name-p): New helper function. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't allow structures with the same names as builtin types. * lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-generalizer) (cl-generic-generalizers): Adapt to name change. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/builtin-type): * test/lisp/emacs-lisp/cl-preloaded-tests.el (cl-struct-define/builtin-type): New unit tests. * etc/NEWS: Document changed behavior.
* | * lisp/emacs-lisp/cl-preloaded.el: Update cl-slot-descriptor name.Stefan Monnier2018-01-261-2/+2
| |
* | Revert "Prevent name clashes between CL structures and builtin types"Philipp Stephani2018-01-071-8/+0
| | | | | | | | | | This reverts commit 151496a4b96430924bc148f85b9c8471d1e132b1. That commit breaks bootstrap builds due to a cyclic dependency.
* | Prevent name clashes between CL structures and builtin typesPhilipp Stephani2018-01-071-0/+8
|/ | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't allow structures with the same names as builtin types. (cl--struct-name-p): New helper function. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't allow structures with the same names as builtin types. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/builtin-type): * test/lisp/emacs-lisp/cl-preloaded-tests.el (cl-struct-define/builtin-type): New unit tests. * etc/NEWS: Document changed behavior.
* Fix copyright years by handPaul Eggert2018-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Backward compatibility with pre-existing struct instances.Stefan Monnier2017-04-041-0/+6
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-lib.el (cl--old-struct-type-of): New function. (cl-old-struct-compat-mode): New minor mode. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Pass `record' to cl-struct-define to signal use of record objects. * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class, cl-struct-define): Enable legacy defstruct compatibility. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-old-struct, old-struct): New tests. * doc/lispref/elisp.texi, doc/lispref/records.texi: Document `old-struct-compat'.
* Make cl-defstruct use records.Lars Brinkhoff2017-04-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-extra.el (cl--describe-class) (cl--describe-class-slots): Use the new `type-of'. * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): Use type-of. (cl--generic-struct-specializers): Adjust to new tag. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): When type is nil, use records. Use the type symbol as the tag. Use copy-record to copy structs. (cl--defstruct-predicate): New function. (cl--pcase-mutually-exclusive-p): Use it. (cl-struct-sequence-type): Can now return `record'. * lisp/emacs-lisp/cl-preloaded.el (cl--make-slot-desc): Adjust ad-hoc code to new format. (cl--struct-register-child): Work with records. (cl-struct-define): Don't touch the tag's symbol-value and symbol-function slots when we use the type as tag. * lisp/emacs-lisp/cl-print.el (cl-print-object): Adjust to new tag. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record): New test. * doc/lispref/records.texi, doc/misc/cl.texi: Update for records.
* Merge from origin/emacs-25Paul Eggert2017-03-191-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ab0a60a ; * CONTRIBUTE (Generating ChangeLog entries): Drop duplicate... 7e02a47 Index byte-compile-debug 7c1e598 Document `byte-compile-debug' in the ELisp manual 4d81eb4 Document variable `byte-compile-debug' 72ef710 Fix call to debugger on assertion failure ae8264c Call modification hooks in org-src fontify buffers b3139da ; Fix last change in doc/lispref/strings.texi c331f39 Improve documentation of 'format' conversions 9f52f67 Remove stale functions from ert manual c416b14 Fix a typo in Eshell manual 06695a0 ; Fix a typo in ediff-merg.el 954e9e9 Improve documentation of hooks related to saving buffers 9fcab85 Improve documentation of auto-save-visited-file-name 2236c53 fix typo in mailcap-mime-extensions 85a3e4e Fix typos in flymake.el a1ef10e More NEWS checking for admin.el's set-version # Conflicts: # lisp/emacs-lisp/bytecomp.el
| * Fix call to debugger on assertion failureNoam Postavsky2017-01-301-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl--assertion-failed): The first argument must be `error', and the second is a list of arguments for `signal'.
* | * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Fix duplicationStefan Monnier2017-02-211-1/+14
|/ | | | | which resulted in incomplete list of parents in one copy of the cl-structure-class class.
* Fix copyright years by handPaul Eggert2017-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Do call debugger on failed cl-assertNoam Postavsky2016-11-081-3/+5
| | | | | | | | | | | | | "Don't call debug on failed cl-assert..." removed the call to `debug' in cl--assertion-failed because `debug' calls `kill-emacs' in batch mode, thus messing up ert test runs. However, calling the debugger is useful because it allows catching failed assertions even inside `condition-case' calls. The problem with ert can be avoided by calling `debugger' instead of `debug' directly, since ert installs its own debugger while running tests. * lisp/emacs-lisp/cl-preloaded.el (cl--assertion-failed): Call `debugger' if `debug-on-error' is non-nil.
* Don't call debug on failed cl-assertNoam Postavsky2016-11-041-5/+3
| | | | | | | | | | Doing this causes problems when running ert tests, for instance (Bug#24778). The call to `debug` when `debug-on-error' is non-nil was introduced in 2015-02-14 "* lisp/emacs-lisp/cl*.el: Use define-inline and move some code...". * lisp/emacs-lisp/cl-preloaded.el (cl--assertion-failed): Don't call `debug' directly.
* Fix copyright years by handPaul Eggert2016-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Fix some file headers for the purpose of `package--builtins'Artur Malabarba2015-12-031-0/+1
| | | | | | | | * lisp/emacs-lisp/cl-preloaded.el * lisp/emacs-lisp/eieio-compat.el * lisp/net/sasl-scram-rfc.el: Add a "Package:" header * lisp/ielm.el: Fix summary line.
* Add online-help support to describe typesStefan Monnier2015-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* (cl--copy-slot-descriptor): Copy the `props' alist as wellStefan Monnier2015-07-011-1/+6
| | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl--copy-slot-descriptor-1): Rename from cl--copy-slot-descriptor. (cl--copy-slot-descriptor): New function. Copy the alist (bug#20914).
* EIEIO: Change class's representation to unify instance & class slotsStefan Monnier2015-03-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* Add classes as run-time descriptors of cl-structs.Stefan Monnier2015-03-181-26/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class): New function. (cl--make-slot-desc): New constructor. (cl--plist-remove, cl--struct-register-child): New functions. (cl-struct-define): Rewrite. (cl-structure-class, cl-structure-object, cl-slot-descriptor) (cl--class): New structs. (cl--struct-default-parent): Initialize it here. * lisp/emacs-lisp/cl-macs.el (cl--find-class): New macro. (cl-defsubst, cl--defsubst-expand, cl--sublis): Move before first use. (cl--struct-default-parent): New var. (cl-defstruct): Adjust to new representation of classes; add default parent. In accessors, signal `wrong-type-argument' rather than a generic error. (cl-struct-sequence-type, cl-struct-slot-info) (cl-struct-slot-offset): Rewrite. * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-specializers) (cl-generic-generalizers): Rewrite. * src/alloc.c (purecopy): Handle hash-tables. * lisp/emacs-lisp/debug.el (debug--implement-debug-on-entry): Bind inhibit-debug-on-entry here... (debug): Instead of here. * lisp/emacs-lisp/macroexp.el (macroexp--debug-eager): New var. (internal-macroexpand-for-load): Use it. * lwlib/xlwmenu.c (pop_up_menu): Remove debugging code.
* * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Keep type=nil by default.Stefan Monnier2015-02-161-0/+4
| | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Add sanity checks about relationship between `type', `named', and `slots'. * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tagcode): Adjust to new value of `cl-struct-type' property.
* * lisp/emacs-lisp/cl*.el: Use define-inline and move some codeStefan Monnier2015-02-141-0/+26
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-lib.el: Move autoloaded code to cl-preload. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Register as children of the parent. (cl--assertion-failed): New function. (cl-assertion-failed): Move in from cl-lib.el. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't generate code to register as children of its parents. (cl--make-type-test, cl--compiler-macro-typep): Remove functions. (cl-typep): Reimplement using define-inline. (cl-assert): Use cl--assertion-failed. (cl-struct-slot-value): Use define-inline.
* Tighten up the tagcode used for eieio and cl-struct objectsStefan Monnier2015-01-271-0/+48
* 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.