summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '9cbdf20316' into native-compAndrea Corallo2021-03-0925-715/+1129
|\
| * * lisp/emacs-lisp/bindat.el (bindat-struct): Fix Edebug defStefan Monnier2021-03-061-2/+2
| |
| * Various map.el improvementsBasil L. Contovounesios2021-03-062-147/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-do-indexed): Return nil as per doc. * lisp/emacs-lisp/map.el: Require Emacs >= 26 due to dependence on 5-arg alist-get. Bump package to version 3.0. Fix other headers. (Bug#46754) (map--plist-p): Detect list starting with nil as plist, not alist. (map-elt, map-filter, map-apply, map--make-pcase-bindings) (map--make-pcase-patterns): Simplify. (map-let, map-put, map-nested-elt, mapp): Update docstring for plist support. (map-delete): Fix OBOE on arrays. Split into cl-defmethods. (map-values, map-values-apply): Specialize for arrays. (map-pairs, map-keys-apply, map-put!): Improve docstring. (map-length): Clarify docstring w.r.t. duplicate keys. Split into cl-defmethods. Optimize default implementation. (map-copy): Use copy-alist on alists. Split into cl-defmethods. (map-contains-key): Add plist support. Clarify docstring w.r.t. optional argument. Simplify default implementation. (map-some, map-every-p, map-merge, map-merge-with, map--into-hash): Don't use map-apply for side effects. (map-into): Preserve plist ordering. Improve docstrings. (map-insert): Add hash-table and array support. (map-inplace): Remove unused error symbol. (map-do): Return nil as per doc. * etc/NEWS: Announce new user-visible behavior. * test/lisp/emacs-lisp/map-tests.el: Prefer should-not over (should (not ...)) in general. (with-maps-do): Fix docstring. (with-empty-maps-do): New macro. (test-map-elt-default, test-mapp, test-map-keys, test-map-values) (test-map-pairs, test-map-length, test-map-copy, test-map-apply) (test-map-do, test-map-keys-apply, test-map-values-apply) (test-map-filter, test-map-remove, test-map-empty-p) (test-map-contains-key, test-map-some, test-map-every-p): Use it. (test-map-plist-p, test-map-put!-new-keys, test-map-insert-empty) (test-map-insert, test-map-delete-empty, test-map-copy-alist) (test-map-contains-key-testfn, test-map-into-hash-test) (test-map-into-empty, test-map-merge, test-map-merge-empty): New tests. (test-map-elt): Test array key that is within bounds but not fixnum. (test-map-put!): Use map--plist-p. Remove redundant tests. (test-map-put-alist-new-key): Don't modify list literal. (test-map-put-testfn-alist, test-map-put-return-value): Silence obsoletion warnings. (test-map-delete): Check for OBOE on arrays. (test-map-delete-return-value): Remove test made redundant by test-map-delete. (test-map-nested-elt, test-map-into): Test plists too.
| * ; Fix typo.Stefan Kangas2021-03-061-1/+1
| |
| * Bindat: new macro-expansion based data layout languageStefan Monnier2021-03-051-151/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thorough redesign of the Bindat system, which makes it possible to define new Bindat type forms, define recursive types, control the values returned when unpacking, freely mix arbitrary computations with type definitions, as well as support for arbitrary sized integers. This also reverts the recent addition of the `bindat-spec` macro and the support for 64bit integers in the old Bindat language since that is now considered obsolete anyway. * doc/lispref/processes.texi (Bindat Types): Rename from `Bindat Spec` and rewrite for the new sublanguage. (Bindat Functions): Adjust to the new terminology. (Bindat Computed Types): New node. * lisp/emacs-lisp/bindat.el (bindat--type): New type. (bindat--unpack-u64, bindat--unpack-u64r): Delete functions. (bindat--unpack-item, bindat--pack-item, bindat--fixed-length-alist): Revert addition of support for 64bit integers. (bindat--unpack-group, bindat--length-group, bindat--pack-group): Handle the new `bindat--type` values. (bindat-spec): Revert addition of this macro. (bindat--unpack-uint, bindat--unpack-uintr, bindat--pack-uint) (bindat--pack-uintr): New functions. (bindat-type, bindat-defmacro, bindat--pcase): New macros. (bindat-type): New Edebug elem. (bindat--type): New generic function. (bindat--primitives): New constant. (bindat--macroenv, bindat--op): New vars. (bindat--make-docstring, bindat--fun, bindat--makefun, bindat--toplevel): New functions. * test/lisp/emacs-lisp/bindat-tests.el: Use `bindat-type`. (ip): New Bindat type. (header-bindat-spec, data-bindat-spec, packet-bindat-spec): Adjust to new `bindat-type` macro. (bindat-test-unpack): Simplify now that the order of fields is preserved. (bindat-test--int-websocket-type, bindat-test--LEB128): New consts. (bindat-test--pack-val, bindat-test--sint, bindat-test--recursive): New tests.
| * Make lambda-lifting work againMattias Engdegård2021-03-051-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Fix typo. * test/lisp/emacs-lisp/cconv-tests.el (cconv-convert-lambda-lifted): Add test case.
| * * lisp/emacs-lisp/bindat.el: Minor refactoringStefan Monnier2021-03-051-69/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (bindat--unpack-str, bindat--unpack-strz, bindat--unpack-bits): New functions, extracted from `bindat--unpack-item`. (bindat--unpack-item): Use them. (bindat--align): New function. (bindat--unpack-group, bindat--length-group, bindat--pack-group): Use it. (bindat-get-field): Allow integers to index both lists (as returned by `repeat`) and vectors (as returned by `vec`). (bindat--pack-str, bindat--pack-bits): New functions, extracted from `bindat--pack-item`. (bindat--pack-item): Use them. * test/lisp/emacs-lisp/bindat-tests.el (struct-bindat): Place the fields in the order in which they appear in the structs.
| * Improve the documentation of :extra in cl-defmethodLars Ingebrigtsen2021-03-051-3/+7
| | | | | | | | | | | | | | * doc/lispref/functions.texi (Generic Functions): Improve documentation of :extra (bug#46917). * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Ditto.
| * Fix qualifiers order for loadhist-unload-element in elp.elMauro Aranda2021-03-051-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/elp.el (loadhist-unload-element): The :extra qualifier is expected to come before the other qualifiers, so do that (bug#46917).
| * Actually fill the correct paragraph in `lisp-fill-paragraph'Lars Ingebrigtsen2021-03-051-1/+4
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Fix previous change here by actually filling the correct paragraph (bug#28937).
| * Don't ignore lexically-bound variables in a defvar (bug#46912)Pip Cet2021-03-051-3/+6
| | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Walk the value form of a defvar.
| * * lisp/emacs-lisp/cl-generic.el: Make `doc-string` prop work with qualifiersStefan Monnier2021-03-041-1/+11
| | | | | | | | | | (cl--defmethod-doc-pos): New function. (cl-defmethod): Use it.
| * Add a command in package mode for opening home pages directlyLars Ingebrigtsen2021-03-041-0/+19
| | | | | | | | | | | | * doc/emacs/package.texi (Package Menu): Document it. * lisp/emacs-lisp/package.el (package-browse-url): New command and keystroke (bug#46927).
| * Make checkdoc work with qualified methodsMauro Aranda2021-03-041-1/+20
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Handle cl-defmethod in a case of its own. Check for the presence of qualifiers, and skip them accordingly until the docstring. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-cl-defmethod-qualified-ok) (checkdoc-cl-defmethod-with-extra-qualifier-ok) (checkdoc-cl-defmethod-with-extra-and-nil-args-ok): Add tests for the fix.
| * Fix pcase dontcare pattern in cl--sm-macroexpandBasil L. Contovounesios2021-03-041-1/+1
| | | | | | | | | | | | | | | | For discussion, see the following thread: https://lists.gnu.org/r/emacs-devel/2021-03/msg00119.html * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix recently uncovered use of old name for pcase--dontcare.
| * * lisp/emacs-lisp/pcase.el (pcase-defmacro): Fix `pcase-tests-macro`Stefan Monnier2021-03-032-8/+13
| | | | | | | | * lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Simplify accordingly.
| * * lisp/emacs-lisp/pcase.el (pcase--u1): Fix typoStefan Monnier2021-03-021-1/+1
| |
| * * lisp/emacs-lisp/trace.el (trace-values): Work outside of traced functionStefan Monnier2021-03-021-2/+2
| |
| * Compile closures that modify their bound vars correctly (Bug#46834)Pip Cet2021-03-021-23/+23
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Don't move let bindings into the lambda. Don't reverse list of bindings. (byte-compile): Evaluate the return value if it was previously reified. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-reify-function): Add tests.
| * * lisp/emacs-lisp/pcase.el: Bind all the vars in `or` patternsStefan Monnier2021-03-011-74/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the handling of `or` patterns where not all sub-patterns bind the same set of variables. This used to be "unsupported" and behaved in somewhat unpredictable ways. (pcase--expand): Rewrite. (pcase-codegen): Delete. * doc/lispref/control.texi (pcase Macro): Adjust accordingly. Also remove the warning about "at least two" sub patterns. These work fine, AFAICT, and if not we should fix it. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-or-vars): New test.
| * Make easymenu downcase the menu symbol for greater backwards compatLars Ingebrigtsen2021-03-011-1/+5
| | | | | | | | | | | | | | | | | | * lisp/cmuscheme.el (map): Revert previous fix. * lisp/woman.el (woman-dired-define-keys): Ditto. * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Downcase the menu name for greater backwards compatibility.
| * * lisp/emacs-lisp/pcase.el: Fix bug#46786Stefan Monnier2021-03-011-24/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit a218c9861573b5ec4979ff2662f5c0343397e3ff, but in order to avoid the spurious warnings that this commit tried to squash, keep track of the vars used during the match so as to add corresponding annotations to explicitly silence the spurious warnings. To do this, we change the VARS used in `pcase-u` (and throughout the pcase code): they used to hold elements of the form (NAME . VAL) and now they hold elements of the form (NAME VAL . USED). (pcase--expand): Bind all vars instead of only those found via fgrep. (pcase-codegen): Silence "unused var" warnings for those vars that have already been referenced during the match itself. (pcase--funcall, pcase--eval): Record the vars that are used. (pcase--u1): Record the vars that are used via non-linear patterns. * lisp/textmodes/mhtml-mode.el (mhtml-forward): * lisp/vc/diff-mode.el (diff-goto-source): Silence newly discovered warnings. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-bug46786): New test.
| * * lisp/emacs-lisp/pcase.el (pcase--split-pred): Re-fix bug#14773Stefan Monnier2021-03-011-1/+1
| | | | | | | | Adjust to calling convention of `macroexp--fgrep`.
| * Fix misuses of `byte-compile-macro-environment`Stefan Monnier2021-03-013-27/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These seem to be left overs from Emacs<24 when `macroexpand-all` was implemented in the CL library and hence the macros's evaluation environment could come from different places depending on the circumstance (either `byte-compile-macro-environment`, or `cl-macro-environment`, or ...). `byte-compile-macro-environment` contains definitions which expand to code that is only understood by the rest of the byte-compiler, so using it for code which isn't being byte-compiled leads to errors such as references to non-existing function `internal--with-suppressed-warnings`. * lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): Remove left-over binding from when `macroexpand-all` was implemented in the CL library. * lisp/emacs-lisp/ert.el (ert--expand-should-1): * lisp/emacs-lisp/cl-macs.el (cl--compile-time-too): Properly preserve the macroexpand-all-environment. (cl--macroexp-fboundp): Pay attention to `cl-macrolet` macros as well.
| * Convert various menus to easymenuStefan Kangas2021-03-011-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-mode-map): Move menu from here... (lisp-mode-menu): ...to here, and convert to easymenu. * lisp/progmodes/elisp-mode.el (lisp-interaction-mode-map): Move menu definition from here... (lisp-interaction-mode-menu): ...to here, and convert to easymenu. * lisp/replace.el (occur-menu-map): Convert to easymenu.
| * Declare more string predicates as pureMattias Engdegård2021-02-281-1/+2
| | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (pure-fns): Treat string>, string-greaterp, string-empty-p, string-blank-p, string-prefix-p and string-suffix-p as pure functions in the compiler.
| * Fix pcase 'rx' pattern match-data bugMattias Engdegård2021-02-281-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pcase 'rx' pattern would in some cases allow the match data to be clobbered before it is read. For example: (pcase "PQR" ((and (rx (let a nonl)) (rx ?z)) (list 'one a)) ((rx (let b ?Q)) (list 'two b))) The above returned (two "P") instead of the correct (two "Q"). This occurred because the calls to string-match and match-string were presented as separate patterns to pcase, which would interleave them with other patterns. As a remedy, combine string matching and match-data extraction into a single pcase pattern. This introduces a slight inefficiency for two or more submatches as they are grouped into a list structure which then has to be destructured. Found by Stefan Monnier. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg02010.html * lisp/emacs-lisp/rx.el (rx--reduce-right): New helper. (rx [pcase macro]): Combine string-match and match-string calls into a single pcase pattern. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test cases.
| * * lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...)Stefan Monnier2021-02-271-27/+34
| | | | | | | | | | | | (macroexp--expand-all): Use `pcase--dontcare` so pcase generates slightly better code. Don't hardcode which functions takes function arguments; rely on a new `funarg-positions` symbol property instead.
| * * lisp/emacs-lisp/bytecomp.el: Fix minor regression introduced by pdumpStefan Monnier2021-02-271-2/+3
| | | | | | | | | | | | | | | | After `rm **/*.elc; make` we'd sometimes get loads and loads of unnecessary "Reloading ...". (byte-compile-refresh-preloaded): Don't reload files that are more recent than `temacs` but older than the `.pdmp` file.
| * * lisp/emacs-lisp/cconv.el: Fix uncaught brain farts in last changeStefan Monnier2021-02-271-2/+2
| | | | | | | | (cconv--convert-funcbody, cconv-convert): Use `macroexp--warn-wrap` properly.
| * Convert emacs-lisp-mode menu to easy-menu-defineStefan Kangas2021-02-271-4/+0
| | | | | | | | | | | | | | * lisp/loadup.el: Preload easymenu. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-map): Convert menu to use easy-menu-define (bug#24774).
| * * lisp/emacs-lisp/cconv.el: Improve line-nb info of unused var warningsStefan Monnier2021-02-2611-137/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of warning about unused vars during the analysis phase of closure conversion, do it in the actual closure conversion by annotating the code with "unused" warnings, so that the warnings get emitted later by the bytecomp phase, like all other warnings, at which point the line-number info is a bit less imprecise. Take advantage of this change to wrap the expressions of unused let-bound vars inside (ignore ...) so the byte-compiler can better optimize them away. Finally, promote `macroexp--warn-and-return` to "official" status by removing its "--" marker. (cconv-captured+mutated, cconv-lambda-candidates): Remove vars. (cconv-var-classification): New var to replace them. (cconv-warnings-only): Delete function. (cconv--warn-unused-msg, cconv--var-classification): New functions. (cconv--convert-funcbody): Add warnings for unused args. (cconv-convert): Add warnings for unused vars in `let` and `condition-case`. (cconv--analyze-use): Don't emit an "unused var" warning any more, but instead remember the fact in `cconv-var-classification`. * lisp/emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): Remove variable. (byte-compile-preprocess): Remove corresponding case. * lisp/emacs-lisp/pcase.el (pcase--if): Don't throw away `test` effects. (\`): * lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Use `car-safe` instead of `car`, so it can more easily be removed by the optimizer if the result is not used. * lisp/emacs-lisp/macroexp.el (macroexp--warn-wrap): New function. (macroexp-warn-and-return): Rename from `macroexp--warn-and-return`.
* | Use `length=' and family where possible in native comp codeAndrea Corallo2021-03-072-5/+5
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-intersect-typesets) (comp-cstr-imm): Use Use `length=' and family where possible. * lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-target-block) (comp-compute-dominator-frontiers) (batch-byte-native-compile-for-bootstrap): Likewise.
* | * lisp/emacs-lisp/comp.el (w32-get-nproc): Suppress warning declaring it.Andrea Corallo2021-03-071-0/+1
| | | | | | | | For non Windows system.
* | Allow for `comp-native-driver-options' to work as a file-local variable.Andrea Corallo2021-03-072-1/+8
| |
* | Use MS-Windows system APIs to get number of processorsEli Zaretskii2021-03-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el: Use 'w32-get-nproc' instead of the environment variable NUMBER_OF_PROCESSORS. * src/w32proc.c (Fw32_get_nproc): New primitive. * src/w32.c (w32_get_nproc): New function. (sample_system_load): Call w32_get_nproc to initialize the number of processors on this system. * src/w32.h (w32_get_nproc): Add prototype.
* | Fix `comp-cstr-intersection-no-hashcons' for negated result cstrAndrea Corallo2021-03-061-13/+19
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-hashcons): When negated and necessary relax dst to t. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
* | Fix miscompilation of funcall forms in some cases (bug#46974)Pip Cet2021-03-061-2/+4
| | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-call-optim-func): Call comp-cstr-imm-vld-p before relying on comp-cstr-imm to return the right value.
* | * lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-simple): Suppress warning.Andrea Corallo2021-03-061-2/+1
| |
* | Fix `=' propagation to handle -0.0 0.0 caseAndrea Corallo2021-03-061-2/+6
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-homogeneous): Fix indent + use `memql'. (comp-cstr-=): Handle 0.0 -0.0 idiosyncrasy * test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests and fix enumeration.
* | Fix typos and doc strings in native-compilation filesEli Zaretskii2021-03-041-103/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-speed, comp-debug, comp-verbose) (comp-always-compile, comp-deferred-compilation-deny-list) (comp-bootstrap-deny-list, comp-never-optimize-functions) (comp-async-jobs-number, comp-async-cu-done-hook) (comp-async-all-done-hook, comp-async-env-modifier-form) (comp-pass, comp-native-compiling, comp-post-pass-hooks) (comp-known-predicate-p, comp-pred-to-cstr) (comp-symbol-values-optimizable, comp-limple-assignments) (comp-limple-calls, comp-limple-branches, comp-block) (comp-vec--verify-idx, comp-vec-aref, comp-vec-append) (comp-vec-prepend, comp-block-preds) (comp-ensure-native-compiler, comp-log, comp-log-func) (comp-loop-insn-in-block, comp-byte-frame-size) (comp-add-func-to-ctxt, comp-spill-lap-function, comp-spill-lap) (comp-lap-fall-through-p, comp-new-frame, comp-emit-set-call) (comp-copy-slot, comp-latch-make-fill, comp-emit-cond-jump) (comp-body-eff, comp-op-case, comp-prepare-args-for-top-level) (comp-limplify-top-level, comp-negate-arithm-cmp-fun) (comp-emit-assume, comp-cond-cstrs-target-mvar) (comp-function-foldable-p, comp-function-call-maybe-fold) (comp-form-tco-call-seq, comp-clean-up-stale-eln) (comp-delete-or-replace-file, comp--native-compile) (native--compile-async, native-compile) (batch-byte-native-compile-for-bootstrap): Fix typos, wording, and punctuation in doc strings. * lisp/loadup.el: Fix typos. * src/lread.c (syms_of_lread): Doc fix.
* | Fix two compiler ICEs dealing with nan and infinityAndrea Corallo2021-03-031-3/+6
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Don't crash when truncate fails. * test/src/comp-test-funcs.el (comp-test-=-nan): Add two functions to be compiled.
* | Fix = propagation semantic for constrained inputsAndrea Corallo2021-03-021-11/+30
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr): Synthesize `comp-cstr-shallow-copy'. (comp-cstr-=): Relax inputs before intersecting them. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add three tests.
* | Fix `eql' `equal' propagation of non hash consed values (bug#46843)Andrea Corallo2021-03-012-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend assumes allowing the following form: (assume dst (and-nhc src1 src2)) `and-nhc' assume operator allow for constraining correctly intersections where non hash consed values are not propagated as values but rather promoted to their types. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-hashcons): New function. * lisp/emacs-lisp/comp.el (comp-emit-assume): Logic update to emit `and-nhc' operator (implemented in fwprop by `comp-cstr-intersection-no-hashcons'). (comp-add-cond-cstrs): Map `eq' to `and' assume operator and `equal' `eql' into `and-nhc'. (comp-fwprop-insn): Update to handle `and-nhc'. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests covering `eql' and `equal' propagation of non hash consed values.
* | Don't treat '=' as simple equality emitting constraints (bug#46812)Andrea Corallo2021-02-282-15/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend assumes allowing the following form (assume dst (= src1 src2)) to caputure '=' semanting during fwprop handling float integer conversions. * lisp/emacs-lisp/comp.el (comp-equality-fun-p): Don't treat '=' as simple equality. (comp-arithm-cmp-fun-p, comp-negate-arithm-cmp-fun) (comp-reverse-arithm-fun): Rename and add '=' '!='. (comp-emit-assume, comp-add-cond-cstrs, comp-fwprop-insn): Update for new function nameing and to handle '='. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): New function. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a bunch of '=' specific tests.
* | Migrate and rename a bunch of functions from comp.el to comp-cstr.elAndrea Corallo2021-02-282-83/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-imm-vld-p) (comp-cstr-imm, comp-cstr-fixnum-p, comp-cstr-symbol-p) (comp-cstr-cons-p): Move and rename from 'comp.el'. * lisp/emacs-lisp/comp.el (comp-mvar-type-hint-match-p) (make-comp-mvar, comp-emit-assume, comp-fwprop-prologue) (comp-function-foldable-p, comp-function-call-maybe-fold) (comp-fwprop-call, comp-fwprop-insn, comp-call-optim-func) (comp-compute-function-type): Update for renamed functions. * src/comp.c (emit_mvar_rval): Likewise. * test/src/comp-tests.el (comp-tests-mentioned-p-1) (comp-tests-cond-rw-checker-val): Likewise.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-02-2617-89/+103
|\|
| * Fix syntax highlighting of easy-menu-define docstringsStefan Kangas2021-02-261-1/+1
| | | | | | | | | | * lisp/emacs-lisp/easymenu.el (easy-menu-define): Add doc-string declaration for correct syntax highlighting.
| * Remove redundant requires of easymenuStefan Kangas2021-02-262-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/allout.el: * lisp/emacs-lisp/edebug.el: * lisp/emacs-lisp/ert.el: * lisp/erc/erc-menu.el: * lisp/help-mode.el: * lisp/net/dictionary.el: * lisp/nxml/rng-nxml.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/meta-mode.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/vera-mode.el: * lisp/wid-browse.el: Remove redundant require of easymenu. We only use the autoloaded macro 'easy-menu-define' here.
| * Function-quote completion property of declare formBasil L. Contovounesios2021-02-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For discussion, see the following thread: https://lists.gnu.org/r/emacs-devel/2021-02/msg01666.html * lisp/emacs-lisp/byte-run.el (byte-run--set-completion): Quote with 'function' for syntactical consistency with other declare form properties. This allows writing (declare (completion foo)) instead of (declare (completion 'foo)). * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): * lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Prefer function-put over put for function symbols. * lisp/subr.el (ignore, undefined): Remove #'-quoting from declare form; it is no longer needed.