summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix shortdoc-add-function section creationBasil L. Contovounesios2021-06-211-3/+3
| | | | | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc-add-function): Use nconc to actually append a new section to the list of groups while avoiding a previous OBOE. Push a new group to the front of shortdoc--groups without copying it, just like define-short-documentation-group does. (buffer): Fix copypasta in unlock-buffer example. * test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-examples): Also check that :no-value forms demonstrate the right function. * doc/lispref/help.texi (Documentation Groups): Clarify that @dots in the define-short-documentation-group arglist refer to whole key-value pairs. Fix typo in :eg-result-string description.
* * Do not attempt to write .elc files when not necessary (bug#49118)Andrea Corallo2021-06-211-67/+67
| | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Do not attempt to write .elc files when not necessary.
* * lisp/emacs-lisp/cl-generic.el: Fix bug#49053 and bug#47454Stefan Monnier2021-06-161-5/+5
| | | | | (cl-generic-define-method): Shorten the time window where the symbol is defined to `dummy`.
* Allow ERT tests to output the failure reasons, tooJulian Scheid2021-06-151-4/+27
| | | | | * lisp/emacs-lisp/ert.el (ert-reason-for-test-result): New function. (ert-run-tests-batch): Output failure or skip reason (bug#47071).
* Fix false positives in docstring width warning with (fn...) constructs.Lars Ingebrigtsen2021-06-151-1/+4
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Don't consider the function signature when determining whether the doc string is too wide (bug#49007). (The signature is folded later when displaying help.)
* * Do not produce .elc temporary file when unnecessary (bug#48978)Andrea Corallo2021-06-141-15/+14
| | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Produce .elc temporary files only when non native compiling or when native compiling but `byte+native-compile' is non nil.
* ;* lisp/emacs-lisp/bytecomp.el (byte-native-compiling): Typo fix.Andrea Corallo2021-06-141-1/+1
|
* * lisp/emacs-lisp/bytecomp.el (byte+native-compile): Update docstring.Andrea Corallo2021-06-141-5/+1
|
* EIEIO: Promote the CLOS behavior over the EIEIO-specific behaviorStefan Monnier2021-06-126-78/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change docs to advertize `slot-value` rather than `oref`. Change the implementation of `:initform` to better match the CLOS semantics, while preserving the EIEIO semantics, but warn when encountering cases where the two diverge. Demote the mostly unused special semantics of `oref-default` on non-class allocated slots. * doc/misc/eieio.texi (Quick Start): Use `slot-value`. (Accessing Slots): Move `slot-value` before `oref`. Fix paren-typo in example (reported by pillule <pillule@riseup.net>). (Introspection): Remove mention of `class-slot-initarg`. * lisp/transient.el (transient--parse-group, transient--parse-suffix): Don't use `oref-default` to get the default value. (transient-lisp-variable): Init forms are evaluated. * lisp/emacs-lisp/eieio.el (defclass): Warn about inapplicable `:initarg` and about uses of init forms that are ambiguous. (oref): Don't advertize the deprecated use of initargs as slot names. (oref-default): Don't advertize the deprecated case where it returns the initform's value. (initialize-instance): Use `macroexp-const-p`. * lisp/emacs-lisp/eieio-core.el (eieio--unbound): Rename from `eieio-unbound`. (eieio--unbound-form): New var. (eieio--slot-override): Use it. (eieio-defclass-internal): Use it. Change `init` so it should always be evaluated. (eieio--known-class-slot-names): New var. (eieio--eval-default-p): Rename from `eieio-eval-default-p`. (eieio--perform-slot-validation-for-default): Use `macroexp-const-p` to decide whether to skip the test. (eieio--add-new-slot): Register slot in `eieio--known-class-slot-names` when applicable. (eieio-oref-default, eieio-oset-default): Add warning for unknown slots and slots not known to be allocated to the class. (eieio-default-eval-maybe): Delete function. Use just `eval` instead. (eieio-declare-slots): Allow slots to specify their allocation class. * lisp/cedet/srecode/insert.el (point): Declare the slot instead of moving the class definition before the slot's first use. (srecode-template-inserter-point, srecode-insert-fcn): Use nil instead of unbound for the `point` slot. * lisp/cedet/srecode/compile.el (srecode-template-inserter): Declare the `key` slot that all children should have. * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar) (eieio-speedbar-directory-button, eieio-speedbar-file-button): * lisp/emacs-lisp/eieio-custom.el (eieio-widget-test-class): * lisp/emacs-lisp/chart.el (chart-bar): * lisp/cedet/semantic/ede-grammar.el (semantic-ede-proj-target-grammar): * lisp/cedet/semantic/db.el (semanticdb-project-database): * lisp/cedet/semantic/db-javascript.el (semanticdb-table-javascript) (semanticdb-project-database-javascript): * lisp/cedet/semantic/db-el.el (semanticdb-table-emacs-lisp) (semanticdb-project-database-emacs-lisp): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-table-ebrowse) (semanticdb-project-database-ebrowse): * lisp/cedet/ede/proj.el (ede-proj-project): * lisp/cedet/ede/proj-obj.el (ede-proj-target-makefile-objectcode): * lisp/cedet/ede/generic.el (ede-generic-project): * lisp/cedet/ede/config.el (ede-project-with-config): * lisp/cedet/ede/base.el (ede-target, ede-project): * lisp/auth-source.el (auth-source-backend): Init forms are evaluated, so quote them accordingly.
* * lisp/emacs-lisp/benchmark.el (benchmark-elapse): TweakStefan Monnier2021-06-111-2/+1
|
* Constant-propagate (function SYMBOL)Mattias Engdegård2021-06-031-1/+1
| | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize--substitutable-p): Consider #'SYMBOL a constant for compile-time propagation purposes.
* Optimise (cons X nil) to (list X)Mattias Engdegård2021-06-031-0/+8
| | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-cons): New function.
* ; End recently added sentences with a period.Basil L. Contovounesios2021-06-011-1/+1
|
* * Add `native-compile-target-directory' (bug#48743)Andrea Corallo2021-06-011-5/+9
| | | | | | * lisp/emacs-lisp/comp.el (native-compile-target-directory): New variable. (comp-spill-lap-function): Make use of.
* Rename batch-byte-native-compile-for-bootstrap (bug#48743)Andrea Corallo2021-06-012-7/+7
| | | | | | | | | | | | | | | | * lisp/Makefile.in : Rename `batch-byte-native-compile-for-bootstrap' -> `batch-byte+native-compile. * lisp/emacs-lisp/bytecomp.el (byte+native-compile) (byte-compile-file): Rename `batch-byte-native-compile-for-bootstrap' -> `batch-byte+native-compile + `byte-native-for-bootstrap' -> `byte+native-compile'. * lisp/emacs-lisp/comp.el (comp-spill-lap-function, comp-final) (batch-native-compile, batch-byte+native-compile): Likewise. * lisp/emacs-lisp/bytecomp.el (byte+native-compile) (byte-compile-file): Likewise. * test/src/comp-tests.el (comp-tests-bootstrap): Rename `byte-native-for-bootstrap' -> `byte+native-compile'.
* * Make *Async-native-compile-log* buffer read-only (bug#48763)Andrea Corallo2021-05-311-3/+8
| | | | | * lisp/emacs-lisp/comp.el (comp-run-async-workers): Make "*Async-native-compile-log*" read-only.
* Put ELP results in a special-mode bufferLars Ingebrigtsen2021-05-311-8/+10
| | | | | | * lisp/emacs-lisp/elp.el (elp-results): Make `q' work in ELP results buffer (bug#14104). (elp-results-mode): Define as an empty special mode derivation.
* Give 'syntax-propertize-wholelines' a docstring.Philipp Stephani2021-05-301-0/+4
| | | | | | | This function is generally useful. * lisp/emacs-lisp/syntax.el (syntax-propertize-wholelines): Add docstring.
* Add a new documentation group for overlaysDaniel Martín2021-05-301-0/+46
| | | | | * lisp/emacs-lisp/shortdoc.el (overlay): Add documentation group for buffer overlays(bug#48730).
* Improve the documentation of documentation groupsDaniel Martín2021-05-301-0/+2
| | | | | | | * doc/lispref/help.texi (Documentation Groups): Fix typos and add an example. * lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): Add :no-eval* and :result-string keywords to the docstring. (Bug#48730)
* ; * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander): slight rephraseMattias Engdegård2021-05-291-4/+3
|
* Fix shortdoc examplesMattias Engdegård2021-05-291-4/+4
| | | | | | | | | | Make sure that each example in shortdoc actually contains the function it illustrates, and add a test for it. * lisp/emacs-lisp/shortdoc.el (string, list, buffer, number): Use the right functions in examples for string-version-lessp, lax-plist-put, point-min and ffloor. * test/lisp/emacs-lisp/shortdoc-tests.el: New test file.
* Fix looking-at-p example in shortdoc.elDaniel Martín2021-05-281-1/+1
| | | | | * lisp/emacs-lisp/shortdoc.el (regexp): Use `looking-at-p' instead of `looking-at' (bug#48709).
* * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Silence warningsStefan Monnier2021-05-271-18/+28
| | | | | (byte-optimize--lexvars): Move before first use instead of using `dlet` on that first use.
* Don't propagate lexical variables into inlined functionsMattias Engdegård2021-05-271-1/+4
| | | | | | | | | | | | | | | | Functions compiled when inlined (thus from inside the optimiser) mustn't retain the lexical environment of the caller or there will be tears. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01227.html . Bug found by Stefan Monnier. * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Bind byte-optimize--lexvars to nil when re-entering the compiler recursively. * test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el: * test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el: New files. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-defsubst): New test.
* * lisp/emacs-lisp/byte-opt.el: Make the build more reproducibleStefan Monnier2021-05-251-27/+13
| | | | | | (byte-compile-inline-expand): When inlining code from another file, always inline the byte-code version of the function. (byte-optimize--pcase): Simplify edebug spec.
* Allow years in a copyright range to be separated by en dashes.Philipp Stephani2021-05-251-7/+7
| | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-regexp) (copyright-years-regexp, copyright-update-year) (copyright-fix-years): Also include en dash. * test/lisp/emacs-lisp/copyright-tests.el (copyright-tests--data): New test cases.
* * lisp/emacs-lisp/subr-x.el (if-let*, if-let): Use looser Edebug specStefan Monnier2021-05-221-12/+5
| | | | | | This makes the same spec work both for `if-let` and `when-let`. (when-let*, and-let*, when-let): Simplify accordingly.
* Fix native-comp-async-report-warnings-errors :typeBasil L. Contovounesios2021-05-221-1/+1
| | | | | | | | * doc/lispref/compile.texi (Native-Compilation Variables): Document 'silent' alternative of native-comp-async-report-warnings-errors. * lisp/emacs-lisp/comp.el (native-comp-async-report-warnings-errors): Fix quoting in :type expression (bug#48586).
* Give 'when-let' and 'when-let*' their own Edebug specification.Philipp Stephani2021-05-221-2/+7
| | | | | | | | | The Edebug specification of 'if-let' and 'if-let*' doesn't work if the body is empty. While that's a pathological case, it's not wrong per se, and could arguably happen due to macro expansion. * lisp/emacs-lisp/subr-x.el (when-let*, when-let): Don't reuse Edebug specification from 'if-let*' and 'if-let'.
* * lisp/emacs-lisp/cl-macs.el (cl-loop): Add missing 'when' to specPhilipp Stephani2021-05-221-1/+2
|
* * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Use a closureStefan Monnier2021-05-181-13/+14
|
* * lisp/emacs-lisp/lisp-mode.el (lisp-outline-level): Fix imprecise numbers.Juri Linkov2021-05-181-3/+9
| | | | | (lisp-outline-level): Return right levels starting from 1 instead of 5. Suggested by Howard Melman <hmelman@gmail.com> in bug#46878.
* Look for ElDoc buffer in all visible framesBasil L. Contovounesios2021-05-181-1/+1
| | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc--echo-area-prefer-doc-buffer-p): Look for a window displaying the ElDoc documentation buffer in all visible frames, as promised by the user option eldoc-echo-area-prefer-doc-buffer (bug#48278).
* Fix the length= shortdoc exampleAlexandr Vityazev2021-05-181-1/+1
| | | | | | | * lisp/emacs-lisp/shortdoc.el (list): Fix the length= example (bug#48495). Copyright-paperwork-exempt: yes
* Fix pcase 'rx' patterns with a single named submatch (bug#48477)Mattias Engdegård2021-05-181-5/+16
| | | | | | | | | | | | | | | pcase 'rx' patterns with a single named submatch, like (rx (let x "a")) would always succeed because of an over-optimistic transformation. Patterns with 0 or more than 1 named submatches were not affected. Reported by Philipp Stephani. * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander): Special case for a single named submatch. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add tests.
* * lisp/emacs-lisp/subr-x.el (if-let): Swap &or branches (Bug#48489)Philipp Stephani2021-05-181-2/+2
|
* Fix a few Edebug specifications where code is wrapped in lambdas.Philipp Stephani2021-05-177-8/+12
| | | | | | | | | | | | | | | | | | | | | | As the Info node `(elisp) Specification List' explains, it is not correct to use `body' or t for a piece of code that the macro wraps in a `lambda' form. These should use `def-body' instead. * lisp/info-xref.el (info-xref-with-file): * lisp/subr.el (subr--with-wrapper-hook-no-warnings, track-mouse) (combine-change-calls, with-eval-after-load): * lisp/emacs-lisp/bytecomp.el (displaying-byte-compile-warnings): * lisp/emacs-lisp/cl-macs.el (cl-do-symbols, cl-progv): * lisp/emacs-lisp/ert-x.el (ert-with-test-buffer): * lisp/emacs-lisp/gv.el (gv-letplace): * lisp/emacs-lisp/nadvice.el (define-advice): * lisp/emacs-lisp/thunk.el (thunk-delay): * lisp/vc/vc-dispatcher.el (vc-run-delayed): Use 'def-body' instead of t or 'body' where applicable. * lisp/emacs-lisp/package.el (package--with-response-buffer): Remove evaluation of the body altogether. I have no idea how to write it correctly in this case.
* Add a 'silent option for native-comp-async-report-warnings-errorsEric Abrahamsen2021-05-161-10/+19
| | | | | | | * lisp/emacs-lisp/comp.el (native-comp-async-report-warnings-errors): Set to 'silent to log warnings, but not pop up the *Warnings* buffer. * lisp/emacs-lisp/comp.el (comp-accept-and-process-async-output): Check value.
* Optimize calls to 'eql', 'memql' and similar for fixnums.Philipp Stephani2021-05-161-6/+20
| | | | | | | | | | | | | It's good practice to compare integers using 'eql' because two bignum objects representing the same integer might not be 'eq'. However, 'eql' is slower and doesn't have its own byte code. Therefore, replace it with 'eq' if one argument is guaranteed to be a fixnum on all platforms. * lisp/emacs-lisp/byte-opt.el (byte-optimize--fixnump): New helper function. (byte-optimize-equal, byte-optimize-member, byte-optimize-assoc): Use it to optimize 'eql' etc. to 'eq' if it will always compare fixnums.
* Even further `text-property-search-forward' clarificationsLars Ingebrigtsen2021-05-121-6/+8
| | | | | * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): Further doc string clarifications.
* Further corrections for the text-property-search doc stringsLars Ingebrigtsen2021-05-121-4/+5
| | | | | | * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): Correct doc string. (text-property-search-backward): Ditto.
* Fix the tests for 'string-limit'Eli Zaretskii2021-05-121-0/+12
| | | | | | | | | * test/lisp/emacs-lisp/subr-x-tests.el (subr-string-limit-coding): Fix the expected results of string-limit when encoding with UTF-16. Add tests for UTF-8 with BOM. (Bug#48324) * lisp/emacs-lisp/subr-x.el (string-limit): Add FIXME comment about the current implementation, which is faulty by design.
* * Rename comp-deferred-compilation-deny-listAndrea Corallo2021-05-111-3/+3
| | | | | | | * lisp/emacs-lisp/comp.el (native-comp-deferred-compilation-deny-list) (native-compile-async-skip-p): Rename comp-deferred-compilation-deny-list -> native-comp-deferred-compilation-deny-list.
* `text-property-search-forward' doc string improvementLars Ingebrigtsen2021-05-111-13/+22
| | | | | | * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): Correct and clarify the doc string (bug#48317).
* Reintroduce autoloads for edebug-all-defs/edebug-all-formsLars Ingebrigtsen2021-05-091-0/+2
| | | | | | | * lisp/emacs-lisp/edebug.el (edebug-all-defs, edebug-all-forms): Reintroduce ;;;###autoload of these user options that were removed in bae2cfe63c, because this leads to errors in a common (and recommended) use case (bug#47516).
* ; Fix recent re-builder doc changes.Basil L. Contovounesios2021-05-081-1/+1
|
* Mention that Emacs is usually case-insensitive in a couple of placesdalanicolai2021-05-081-1/+6
| | | | | | | | | | * doc/lispref/searching.texi (Regular Expressions): Mention `case-fold-search'. * lisp/emacs-lisp/re-builder.el (re-builder): Mention case sensitivity toggles (bug#47534). Copyright-paperwork-exempt: yes
* Fix a recent change in rmc.elEli Zaretskii2021-05-071-28/+29
| | | | | * lisp/emacs-lisp/rmc.el (read-multiple-choice): Doc fix. Improve the message when entering recursive-edit.
* Rename comp-eln-load-path → native-comp-eln-load-pathAndrea Corallo2021-05-061-10/+10
| | | | | | | | | | | | * src/comp.c (Fcomp_el_to_eln_filename): Rename comp-eln-load-path → native-comp-eln-load-path. * src/lread.c (maybe_swap_for_eln): Likewise. * lisp/startup.el (native-comp-eln-load-path) (normal-top-level): Likewise. * lisp/emacs-lisp/comp.el (comp-spill-lap-function, comp-final) (comp-eln-load-path-eff, comp-trampoline-compile) (comp-clean-up-stale-eln, comp-run-async-workers) (comp-lookup-eln, batch-byte-native-compile-for-bootstrap): Likewise.