summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* * Fix some comp-vec logicAndrea Corallo2021-02-251-4/+4
| | | | | | * lisp/emacs-lisp/comp.el (comp-vec-length, comp-vec-append) (comp-vec-prepend): Fix logic. (comp-vec-aref): Fix indentation.
* * Fix two docstrings in comp.elAndrea Corallo2021-02-251-2/+2
| | | | | * lisp/emacs-lisp/comp.el (comp-new-frame, comp-maybe-add-vmvar): Fix docstring.
* Fix async compilation and paramenter namingAndrea Corallo2021-02-241-6/+6
| | | | | * lisp/emacs-lisp/comp.el (native--compile-async) (native-compile-async): Fix broken parameter renaming.
* Do not emit assumptions referencing clobbered mvars (bug#46670)Andrea Corallo2021-02-231-37/+65
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-func): Add `vframe-size' slot. (comp-new-frame): Add `vsize' parameter. (comp-limplify-top-level, comp-limplify-function): Update for new `comp-new-frame'. (comp-maybe-add-vmvar): New function. (comp-add-cond-cstrs): Logic update to emit assumptions not referencing clobbered variables. (comp-place-phis, comp-ssa, comp-ssa-rename-insn) (comp-ssa-rename): Update rename logic to rename also negative slots. (comp-fwprop-insn): Update to handle `(assume mvar mvar)' form. * test/src/comp-tests.el (46670-1): Add testcase. * test/src/comp-test-funcs.el (comp-test-46670-1-f) (comp-test-46670-2-f): New functions.
* * Move ssa rename from vector to comp-vecAndrea Corallo2021-02-231-14/+14
| | | | | | | | | * lisp/emacs-lisp/comp.el (comp-block): Updated `final-frame' slot type. (comp-limplify): Updated `frame' slot type. (comp-slot-n, comp-new-frame, comp-place-phis, comp-ssa) (comp-ssa-rename-insn, comp-ssa-rename, comp-finalize-phis): Use `comp-vec'.
* * Add a simple growable vector like typeAndrea Corallo2021-02-231-3/+50
| | | | | | * lisp/emacs-lisp/comp.el (comp-vec): Define struct. (comp-vec-copy, comp-vec-length, comp-vec--verify-idx) (comp-vec-aref, comp-vec-append, comp-vec-prepend): New functions.
* * Some clean-up in comp.elAndrea Corallo2021-02-221-9/+0
| | | | | | | * lisp/emacs-lisp/comp.el (comp-func): Remove 'array-h'. (comp-spill-lap-function, comp-intern-func-in-ctxt) (comp-spill-lap-function, comp-addr-to-bb-name): Update accordingly.
* * Don't use paths to indicate filenamesAndrea Corallo2021-02-221-10/+10
| | | | | * lisp/emacs-lisp/comp.el (native--compile-async) (native-compile-async): Replace `paths' argname with `files'.
* * Fix union constraint for mixed pos/neg constraintsAndrea Corallo2021-02-221-0/+6
| | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix neg type shadowing pos values. * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist): Add testcase. * test/src/comp-tests.el (comp-tests-type-spec-tests): Fix testcase.
* * lisp/emacs-lisp/comp.el (comp-spill-lap): Fix doc string.Andrea Corallo2021-02-211-1/+1
|
* Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2021-02-2111-163/+110
|\
| * Faster, more compact, and readable closure creationMattias Engdegård2021-02-211-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify closure creation by calling a single function at run time instead of putting it together from small pieces. This is faster (by about a factor 2), takes less space on disk and in memory, and makes internal functions somewhat readable in disassembly listings again. This is done by creating a prototype function at compile-time whose closure variables are placeholder values V0, V1... which can be seen in the disassembly. The prototype is then cloned at run time using the new make-closure function that replaces the placeholders with the actual closure variables. * lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Generate call to make-closure from a prototype function. * src/alloc.c (Fmake_closure): New function. (syms_of_alloc): Defsubr it. * src/data.c (syms_of_data): Defsym byte-code-function-p.
| * ; Fix previous easy-menu-define conversionStefan Kangas2021-02-211-3/+3
| | | | | | | | | | | | * lisp/emacs-lisp/re-builder.el (reb-mode-menu): * lisp/progmodes/make-mode.el (makefile-mode-menu): Replace :button attribute with :style and :selected.
| * Change how (declare (modes store the dataLars Ingebrigtsen2021-02-201-3/+1
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-run--set-modes): Change from being a predicate to storing the modes. This allows using the modes for positive command discovery, too. * src/data.c (Fcommand_modes): Look at the `command-modes' symbol property, too.
| * Add the `always' functionLars Ingebrigtsen2021-02-201-1/+1
| | | | | | | | | | | | | | | | * doc/lispref/functions.texi (Calling Functions): Document it. * lisp/subr.el (always): New function. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark it as side effect free.
| * Convert re-builder menu to easy-menu-defineStefan Kangas2021-02-201-49/+29
| | | | | | | | | | | | * lisp/emacs-lisp/re-builder.el (reb-mode-map): Move menu definition from here... (reb-mode-menu): ...to here, and rewrite using easy-menu-define.
| * * lisp/emacs-lisp/bytecomp.el: Don't warn for repeated _ argsStefan Monnier2021-02-191-1/+3
| | | | | | | | | | (byte-compile-check-lambda-list): Skip warnings of repeated arg for those that are declared as unused anyway.
| * Do interactive mode tagging for package.elStefan Kangas2021-02-191-22/+31
| |
| * * lisp/emacs-lisp/bindat.el: Tweak example in commentStefan Monnier2021-02-181-9/+9
| | | | | | | | Suggested by Kim Storm <storm@cua.dk>.
| * Fix typosMattias Engdegård2021-02-183-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/display.texi (Size of Displayed Text): * doc/lispref/windows.texi (Buffer Display Action Functions): * etc/NEWS: * etc/ORG-NEWS (Org-Attach has been refactored and extended): * lisp/battery.el (display-battery-mode, battery--upower-subsribe): * lisp/calendar/parse-time.el: * lisp/dired-x.el: * lisp/emacs-lisp/chart.el (chart-sequece, chart-bar-quickie): * lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p) (eldoc-documentation-strategy): * lisp/emacs-lisp/pcase.el (pcase--split-pred, pcase--u1): * lisp/gnus/gnus-search.el (gnus-search-expandable-keys) (gnus-search-parse-query, gnus-search-query-return-string) (gnus-search-imap, gnus-search-imap-search-command) (gnus-search-transform-expression): * lisp/gnus/nnselect.el: * lisp/isearch.el (isearch-lazy-count-format): * lisp/mh-e/mh-show.el (mh-show-msg): * lisp/net/dictionary-connection.el (dictionary-connection-open): * lisp/net/dictionary.el (dictionary-default-popup-strategy) (dictionary, dictionary-split-string, dictionary-do-select-dictionary) (dictionary-display-dictionarys, dictionary-search) (dictionary-tooltip-mode): * lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-set-server): * lisp/net/mailcap.el (mailcap-mime-data): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): * lisp/nxml/nxml-mode.el (nxml-mode): * lisp/progmodes/cc-engine.el: * lisp/progmodes/cperl-mode.el (cperl-mode) (cperl-fontify-syntaxically): * lisp/progmodes/flymake.el (flymake-diagnostic-functions): * lisp/progmodes/verilog-mode.el (verilog--supressed-warnings) (verilog-preprocess): * lisp/simple.el (self-insert-uses-region-functions): * lisp/textmodes/bibtex.el (bibtex-copy-summary-as-kill): * lisp/textmodes/texnfo-upd.el (texinfo-insert-master-menu-list): * src/dispnew.c: * src/font.c (Ffont_get): * src/indent.c (compute_motion): * src/process.c (init_process_emacs): * src/w32fns.c (deliver_wm_chars): * test/lisp/jsonrpc-tests.el (deferred-action-complex-tests): Fix typos in documentation, comments, and internal identifiers.
| * * lisp/emacs-lisp/edebug.el (eval-defun): SimplifyStefan Monnier2021-02-181-61/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (edebug-all-defs, edebug-all-forms): Don't autoload since the problem it was working around has been fixed a while back. (edebug--eval-defun): Rename from `edebug-eval-defun` and simplify by making it an `:around` advice. (edebug-install-read-eval-functions) (edebug-uninstall-read-eval-functions): Adjust accordingly. (edebug-eval-defun): Redefine as an obsolete wrapper. * lisp/progmodes/elisp-mode.el (elisp--eval-defun): Use `load-read-function` so it obeys `edebug-all-(defs|forms)`. (elisp--eval-defun): Fix recent regression introduced with `elisp--eval-defun-result`.
| * Fix rx `regexp` form with deprecated syntaxMattias Engdegård2021-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The argument of the rx `regexp` form is assumed to evaluate to a valid regexp, but certain kinds of deprecated but still accepted usage were not handled correctly, such as unescaped literal (special) characters: (rx "a" (regexp "*")) => "a*" which is wrong. Handle these cases; there is no extra trouble. * lisp/emacs-lisp/rx.el (rx--translate-regexp): Force bracketing of single special characters. * test/lisp/emacs-lisp/rx-tests.el (rx-regexp): Add test case.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-02-1720-767/+877
|\|
| * Adjust the edebug spec for `interactive'Lars Ingebrigtsen2021-02-171-2/+4
| | | | | | | | | | * lisp/emacs-lisp/edebug.el: Adjust the edebug spec for `interactive' for the new syntax.
| * Fix recently introduced bug in `byte-compile-lambda'Lars Ingebrigtsen2021-02-171-11/+11
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Fix recently introduced error when compiling non-lexical commands (bug#46589).
| * Change name for the completion-* predicatesLars Ingebrigtsen2021-02-171-2/+3
| | | | | | | | | | | | | | | | | | | | * lisp/simple.el (command-completion-default-include-p) (command-completion-with-modes-p, command-completion-button-p): Rename from completion-*. (read-extended-command-predicate): Adjust default predicate. * lisp/emacs-lisp/byte-run.el (byte-run--set-modes): Adjust predicate name.
| * * lisp/emacs-lisp/bindat.el: Add 64bit int supportStefan Monnier2021-02-151-20/+31
| | | | | | | | | | | | | | (bindat--unpack-u64, bindat--unpack-u64r, bindat--pack-u64) (bindat--pack-u64r): New functions. (bindat--unpack-item, bindat--pack-item): Use them. (bindat--fixed-length-alist): Add new types.
| * * lisp/emacs-lisp/bindat.el: Clarify when field labels are optionalStefan Monnier2021-02-151-115/+102
| | | | | | | | | | | | | | | | | | | | | | | | The fixes the doc and the Edebug spec, as well as a subtle issue in the code where a field whose name is (eval 'fill) was mistakenly considered as an anonymous field of type `fill`. (bindat--unpack-item, bindat--unpack-group, bindat--length-group) (bindat--pack-item, bindat--pack-group): Use dotimes, dolist, and pcase. (bindat--item-aux): New edebug elem. (bindat-item): Use it to fix the handling of optional fields. (bindat-format-vector): Use `mapconcat`.
| * * lisp/emacs-lisp/bindat.el (bindat-spec): New macro.Stefan Monnier2021-02-151-9/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's basically an alias for `quote`, but it offers the advantage of providing Edebug support and opens the possibility of compiling the bindat spec to ELisp code. * doc/lispref/processes.texi (Bindat Spec): Document `bindat-spec`. (Bindat Functions): Tweak a few things to adjust to the state of the code. * test/lisp/emacs-lisp/bindat-tests.el: Use it. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests--read): New function. (edebug-tests--&rest-behavior): New test.
| * * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Warn on empty let bodiesStefan Monnier2021-02-151-1/+6
| |
| * * lisp/emacs-lisp/bindat.el: Expose the `struct` variable (bug#46534)Stefan Monnier2021-02-151-11/+12
| | | | | | | | | | (bindat--unpack-group, bindat--length-group, bindat--pack-group): Mark it as dynamically scoped.
| * Add a new variable `global-minor-modes'Lars Ingebrigtsen2021-02-151-5/+8
| | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Minor Modes): Document it. * lisp/simple.el (global-minor-modes): New variable. (completion-in-mode-p): Use it. (completion-with-modes-p): Use it. * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Support it.
| * Rename minor-modes to local-minor-modesLars Ingebrigtsen2021-02-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Minor Modes): Update documentation. * lisp/simple.el (completion-with-modes-p): Change usage. * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Change usage. * src/buffer.c: Rename from minor_modes to local_minor_modes throughout. (syms_of_buffer): Rename minor-modes to local-minor-modes. * src/buffer.h (struct buffer): Rename minor_modes_. * src/pdumper.c (dump_buffer): Update hash and usage.
| * * lisp/emacs-lisp/edebug.el (edebug-&optional, edebug-&rest): Remove varsStefan Monnier2021-02-141-35/+24
| | | | | | | | | | | | | | | | According to my tests, `edebug-&optional` never has any effect. And `edebug-&rest` can be replaced with a closure. (edebug-&rest-wrapper): Remove function. (edebug--match-&-spec-op): Use a closure to remember the `specs`.
| * * lisp/emacs-lisp/byte-run.el (compiler-macro): Make it EdebuggableStefan Monnier2021-02-142-1/+6
| | | | | | | | | | * lisp/emacs-lisp/gv.el (gc-expander, gv-setter): Reuse the spec of `compiler-macro`.
| * * Edebug: Generalize `&lookup`, use it for `cl-macrolet` and `cl-generic`Stefan Monnier2021-02-144-108/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the use of (declare (debug ...)) in the lexical macros defined with `cl-macrolet`. It also fixes the names used by Edebug for the methods of `cl-generic` so it doesn't need to use gensym and so they don't include the formal arg names any more. * lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Rename from `edebug--handle-&-spec-op`. (edebug--match-&-spec-op <&interpose>): Rename from `&lookup` and generalize so it can let-bind dynamic variables around the rest of the parse. (edebug-lexical-macro-ctx): Rename from `edebug--cl-macrolet-defs` and make it into an alist. (edebug-list-form-args): Use the specs from `edebug-lexical-macro-ctx` when available. (edebug--current-cl-macrolet-defs): Delete var. (edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name) (edebug-match-cl-macrolet-body): Delete functions. (def-declarations): Use new `&interpose`. (edebug--match-declare-arg): Rename from `edebug--get-declare-spec` and adjust to new calling convention. * lisp/subr.el (def-edebug-elem-spec): Fix docstring. (eval-after-load): Use `declare`. * lisp/emacs-lisp/cl-generic.el: Fix Edebug names so we don't need gensym any more and we only include the specializers but not the formal arg names. (cl--generic-edebug-name): New var. (cl--generic-edebug-remember-name, cl--generic-edebug-make-name): New funs. (cl-defgeneric, cl-defmethod): Use them. * lisp/emacs-lisp/cl-macs.el: Add support for `debug` declarations in `cl-macrolet`. (cl-declarations-or-string): Fix use of `lambda-doc` and allow use of `declare`. (edebug-lexical-macro-ctx): Declare var. (cl--edebug-macrolet-interposer): New function. (cl-macrolet): Use it to pass the right `lexical-macro-ctx` to the body. * lisp/emacs-lisp/pcase.el (pcase-PAT): Use new `&interpose`. (pcase--edebug-match-pat-args): Rename from `pcase--get-edebug-spec` and adjust to new calling convention. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method): Adjust to the new names. * test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier) (edebug-tests-cl-flet): Adjust to the new names. * doc/lispref/edebug.texi (Specification List): Document &interpose.
| * Fix byte-run--set-modes call signatureLars Ingebrigtsen2021-02-141-2/+2
| | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-run--set-modes): We take a list of modes, not a single one (and fix the quoting).
| * Don't update `minor-modes' in global modesLars Ingebrigtsen2021-02-141-4/+5
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): There's no point in setting the buffer-local `minor-modes' in global modes.
| * Really fix the syntax problem in define-minor-modeLars Ingebrigtsen2021-02-141-2/+2
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix interactive extension in previous change.
| * Fix previous define-minor-mode changeLars Ingebrigtsen2021-02-141-4/+5
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix interactive extension in previous change.
| * Allow define-minor-mode to take an :interactive keywordLars Ingebrigtsen2021-02-141-5/+17
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Allow specifying the :interactive state and the modes.
| * Add 'read-extended-command-predicate'Lars Ingebrigtsen2021-02-141-0/+1
| | | | | | | | | | | | | | | | | | * doc/emacs/m-x.texi (M-x): Document it. * doc/lispref/commands.texi (Interactive Call): Document it further. * lisp/simple.el (read-extended-command-predicate): New user option. (read-extended-command-predicate): Use it. (completion-in-mode-p): New function (the default predicate).
| * Mark easy-menu-do-define menus as "not interesting"Lars Ingebrigtsen2021-02-141-1/+4
| | | | | | | | | | * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Mark menu keymaps as "not interesting" when doing completion.
| * Add new 'declare' forms for command completion predicatesLars Ingebrigtsen2021-02-141-1/+14
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/functions.texi (Declare Form): Document the new `completion' and `modes' declarations. * lisp/simple.el (completion-with-modes-p): New helper functions. * lisp/emacs-lisp/byte-run.el (byte-run--set-completion) (byte-run--set-modes): (defun-declarations-alist): New declarations for `completion' and `modes'.
| * Extend the syntax of `interactive' to list applicable modesLars Ingebrigtsen2021-02-142-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/commands.texi (Using Interactive): Document the extended `interactive' form. * doc/lispref/loading.texi (Autoload): Document list-of-modes form. * lisp/emacs-lisp/autoload.el (make-autoload): Pick the list of modes from `interactive' out of the functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Allow for the extended `interactive' form. * src/callint.c (Finteractive): Document the extended form. * src/data.c (Finteractive_form): Return the interactive form in the old format (even when there's an extended `interactive') to avoid having other parts of Emacs be aware of this. (Fcommand_modes): New defun. * src/emacs-module.c (GCALIGNED_STRUCT): Allow for modules to return command modes. * src/lisp.h: New function module_function_command_modes.
| * Introduce an :interactive keyword for `defined-derived-mode'Lars Ingebrigtsen2021-02-141-1/+6
| | | | | | | | | | | | * doc/lispref/modes.texi (Derived Modes): Document it. * lisp/emacs-lisp/derived.el (define-derived-mode): Introduce a new :interactive keyword.
| * Add a new buffer-local variable `minor-modes'Lars Ingebrigtsen2021-02-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Keep `minor-modes' updated. * src/buffer.c (bset_minor_modes, Fmake_indirect_buffer) (reset_buffer, init_buffer_once): Initialise `minor-modes'. (syms_of_buffer): Add `minor-modes' as a new permanently-local variable. * src/buffer.h (struct buffer): Add minor_modes_.
| * * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Reinstate.Stefan Monnier2021-02-131-0/+27
| | | | | | | | Removed by accident.
| * * lisp/emacs-lisp/edebug.el: Fix `called-interactively-p`Stefan Monnier2021-02-131-58/+12
| | | | | | | | | | | | | | | | | | | | | | | | And get rid of the old special-case handling of `interactive-p`, which is now redundant. (edebug--called-interactively-skip): Fix lexical-binding case, and adjust to some formerly missed call patterns. (edebug-def-interactive, edebug-interactive-p): Remove vars. (edebug-interactive-p-name, edebug-wrap-def-body) (edebug-make-enter-wrapper): Remove functions. (edebug-list-form): Don't special-case `interactive-p`.
| * * lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete functionStefan Monnier2021-02-131-28/+8
| | | | | | | | | | | | | | | | (lambda-expr): Define with `def-edebug-elem-spec` instead. (edebug--handle-&-spec-op): Remove left over code. (interactive): Re-add mistakenly removed spec elem. * doc/lispref/edebug.texi (Specification List): Remove `function-form`.