summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-preloaded.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* Recognize defstruct slot names in various eieio functionsThuna2023-05-031-0/+1
| | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Set each slot's name's 'slot-name' property so that 'eieio--known-slot-name-p' can recognize them. (Bug#62959) Copyright-paperwork-exempt: yes
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Merge remote-tracking branch 'origin/master' into feature/tree-sitterYuan Fu2022-08-291-1/+1
|\
| * ; Fix typos.Stefan Kangas2022-07-021-1/+1
| |
* | Merge remote-tracking branch 'savannah/master' into feature/tree-sitterYuan Fu2022-06-141-1/+1
|\|
| * cl-typep: Emit warning when using a type not known to be a typeStefan Monnier2022-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `cl-typep` has used a heuristic that if there's a `<foo>-p` function, then <foo> can be used as a type. This made sense in the past where most types were not officially declared to be (cl-)types, but nowadays this just encourages abuses such as using `cl-typecase` with "types" like `fbound`. It's also a problem for EIEIO objects, where for historical reasons `<foo>-p` tests if the object is of type exactly `<foo>` whereas (cl-typep OBJ <foo>) should instead test if OBJ is a *subtype* of `<foo>`. So we change `cl-typep` to emit a warning whenever this "-p" heuristic is used, to discourage abuses, encourage the use of explicit `cl-deftype` declarations, and try and detect some misuses of `<foo>-p` for EIEIO objects. * lisp/emacs-lisp/eieio.el (defclass): Define as type not only at run-time but also for the current compilation unit. * lisp/emacs-lisp/eieio-core.el (class, eieio-object): Define as types. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't abuse the "-p" heuristic. * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add entries for frames, windows, markers, and overlays. (cl-typep): Emit a warning when using a predicate that is not known to correspond to a type. * lisp/files.el (file-relative-name): Fix error that can trigger if there's an(other) error between loading `files.el` and loading `minibuffer.el`.
* | Add new type treesit-compiled-queryYuan Fu2022-06-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No intergration/interaction with the new type, just adding it. * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add new type. * src/alloc.c (cleanup_vector): Add gc for the new type. * src/data.c (Ftype_of): Add switch case for the new type. (syms_of_data): Add symbols for the new type. * src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add new type. * src/treesit.c (Ftreesit_compiled_query_p): New function. (syms_of_treesit): Add symbol for the new type. * src/treesit.h (struct Lisp_TS_Query): New struct. (TS_COMPILED_QUERY_P, XTS_COMPILED_QUERY, CHECK_TS_COMPILED_QUERY): New macros. * src/print.c (print_vectorlike): Add printing for the new type.
* | ; Merge from master.Yuan Fu2022-05-071-2/+23
|\|
| * * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add `symbol-with-pos`Stefan Monnier2022-04-291-1/+1
| |
| * CL types: Accept both `byte-code-function` and `compiled-function`Stefan Monnier2022-04-291-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | `type-of` returns `compiled-function` for bytecode functions, but the predicate for those objects is called `byte-code-function-p`, So accept both `compiled-function` and `byte-code-function` as type names for those objects. * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add `byte-code-function`. * lisp/emacs-lisp/cl-macs.el (byte-code-function, compiled-function, subr): New types.
| * OClosure: Add support for defmethod dispatchStefan Monnier2022-04-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/oclosure.el (oclosure--class): Add slot `allparents`. (oclosure--class-make): Add corresponding arg `allparents`. (oclosure, oclosure--build-class): Pass the new arg to the constructor. (oclosure--define): Make the predicate function understand subtyping. * lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Move from `cl-generic.el`. * lisp/emacs-lisp/cl-generic.el (cl--generic-class-parents): Move to `cl-preloaded.el` and rename to `cl--class-allparents`. Adjust all callers. (cl--generic-oclosure-tag, cl-generic--oclosure-specializers): New functions. (cl-generic-generalizers) <oclosure-struct>: New generalizer. * test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test-gen): New generic function. (oclosure-test): Add test for dispatch on oclosure types.
* | Add tree-sitter intergrationYuan Fu2022-05-071-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE_TREE_SITTER, TREE_SITTER_OBJ): New variables. (DYNAMIC_LIB_SUFFIX): new variable, I copied code from MODULES_SUFFIX so the diff looks this way. * doc/lispref/elisp.texi (Top): Add tree-sitter manual. * doc/lispref/modes.texi (Font Lock Mode): mention tree-sitter. (Parser-based Font Lock): New section. (Auto-Indentation): Mention tree-sitter. (Parser-based Indentation): New section. * doc/lispref/parsing.texi (Parsing Program Source): New chapter. * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add treesit-parser and treesit-node type. * lisp/treesit.el: New file. * src/Makefile.in (TREE_SITTER_LIBS, TREE_SITTER_FLAGS, TREE_SITTER_OBJ): New variables. * src/alloc.c: (cleanup_vector): Add cleanup code for treesit-parser and treesit-node. * src/casefiddle.c (casify_region): Notify tree-sitter parser of buffer change. * src/data.c (Ftype_of): Add treesit-parser and treesit-node type (Qtreesit_parser, Qtreesit_node): New symbol. * src/emacs.c (main): Add symbols in treesit.c. * src/eval.c (define_error): Move the function to here. * src/insdel.c (insert_1_both, insert_from_string_1, insert_from_gap, insert_from_buffer_1, replace_range, del_range_2): Notify tree-sitter parser of buffer change. * src/json.c (define_error): Move this function out. * src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add treesit-parser and treesit-node. * src/lread.c (Vdynamic_library_suffixes): New variable. * src/print.c (print_vectorlike): Add code for printing treesit-parser and treesit-node. * src/treesit.c: New file. * src/treesit.h: New file. * test/src/treesit-tests.el: New file.
* Reduce code duplication in parts of (auto)load&defaliasStefan Monnier2022-01-281-1/+1
| | | | | | | | | | | | | | | | | | * src/data.c (defalias): New function, extracted from `Fdefalias`. (Fdefalias): Use it. (Ffset): Don't handle `Vautoload_queue` here, handle it in `defalias` instead. * src/comp.c (comp--register-subr): Use `defalias` instead of duplicating its code. * src/eval.c (load_with_autoload_queue): New function, extracted from `Fautoload_do_load`. (Fautoload_do_load): Use it. (un_autoload): Mark it as static. * src/fns.c (Frequire): Use it as well. * src/lisp.h (defalias, load_with_autoload_queue): New declarations. (un_autoload): Remove declaration.
* * 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.