summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* Warn about arity errors in inlining calls (bug#12299)Mattias Engdegård2021-07-232-11/+31
| | | | | | | | | | | | | | | Wrong number of arguments in inlining function calls (to `defsubst` or explicitly using `inline`) did not result in warnings, or in very cryptic ones. * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Add calls to `byte-compile--check-arity-bytecode`. * lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn) (byte-compile--check-arity-bytecode): New functions. (byte-compile-callargs-warn): Use factored-out function. * test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el: * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-callargs-defsubst.el"): New test case.
* ; * lisp/emacs-lisp/macroexp.el (macroexp-warn-and-return): Doc fix.Eli Zaretskii2021-07-221-3/+3
|
* Move generalized variable specs from cl-lib.el to gv.elLars Ingebrigtsen2021-07-222-105/+100
| | | | | | | | * lisp/emacs-lisp/cl-lib.el: Move all the generalized variable specifications from cl-lib.el... * lisp/emacs-lisp/gv.el: ... to gv.el. This will make things like `(setf (getenv "FOO") "BAR")' work without requiring anything, since `setf' lives in gv.el (bug#49651).
* * lisp/emacs-lisp/macroexp.el (macroexp-warn-and-return): Add arg `category`Stefan Monnier2021-07-214-26/+34
| | | | | | | | | | | | | | Use it to obey `byte-compile-warnings`. (macroexp--warn-wrap): Add arg `category`. (macroexp-macroexpand, macroexp--expand-all): Use it. * lisp/emacs-lisp/cconv.el (cconv--convert-funcbody, cconv-convert): Mark the warnings as `lexical`. * lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default) (eieio-oset-default): * lisp/emacs-lisp/eieio.el (defclass): Adjust to new calling convention.
* Fix mistake in `quote` optimiserMattias Engdegård2021-07-211-4/+3
| | | | | | | | | | Found by Pip Cet. * lisp/emacs-lisp/byte-opt.el (byte-optimize-quote): Fix mistake that made this optimiser ineffective at removing quoting of nil, t, and keywords. The only obvious consequence is that we no longer need... (byte-optimize-form): ...a 'nil => nil normalising step here; remove. (byte-optimize-form-code-walker): Make the compiler warn about (quote).
* ; * lisp/emacs-lisp/byte-opt.el (byte-optimize-eq): Fix last change.Mattias Engdegård2021-07-201-4/+3
|
* Strength-reduce (eq X nil) to (not X)Mattias Engdegård2021-07-201-1/+7
| | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-eq): New optimisation, which results in better test and branch code generation where it applies.
* Count (not X) as a switch conditionMattias Engdegård2021-07-201-0/+10
| | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix): Treat (not VAR) and (null VAR) as (eq VAR nil) when computing the extent of switch ops.
* Allow installing packages with DOS line endingsIoannis Kappas2021-07-201-2/+19
| | | | | | * lisp/emacs-lisp/package.el (package-install-from-buffer): Allow installing files with different line ending conventions (Unix, DOS and Macos) (bug#48137).
* Use make-separator-line in shortdocLars Ingebrigtsen2021-07-191-9/+1
| | | | | | | | * lisp/simple.el (separator-line): Tweak definition to not be so overwhelming. * lisp/emacs-lisp/shortdoc.el (shortdoc-separator): Removed. (shortdoc-display-group): Use make-separator-line.
* Fix an unlikely `copyright-find-copyright' problemLars Ingebrigtsen2021-07-181-5/+10
| | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the copyright matcher more robust (bug#7179).
* Make 'n'/'p' work again in shortdoc after previous changesLars Ingebrigtsen2021-07-171-10/+9
| | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc--goto-section): Adjust to changes in how the text properties are inserted in 22a5482ab6 (bug#49605). Also make into a regular function.
* EIEIO: Prevent excessive evaluation of :initformakater2021-07-161-14/+21
| | | | | | | | | | | | | | * lisp/emacs-lisp/eieio.el (initialize-instance): Do not evaluate initform of a slot when initarg for the slot is provided, according to the following secitons of CLHS: - Object Creation and Initialization - Initialization Arguments - Defaulting of Initialization Arguments - Rules for Initialization Arguments * test/lisp/emacs-lisp/eieio-etests/eieio-tests.el: Add corresponding tests Fix a typo
* Define revert-buffer-function for *Memory Report*Mattias Engdegård2021-07-161-0/+2
| | | | | * lisp/emacs-lisp/memory-report.el (memory-report): Allow the memory report buffer to be updated by pressing 'g'.
* Add more car/cdr examples to shortdocLars Ingebrigtsen2021-07-151-2/+6
| | | | * lisp/emacs-lisp/shortdoc.el (list): Add more car/cdr examples.
* Improve the shortdoc link action in *Help* buffersLars Ingebrigtsen2021-07-151-5/+8
| | | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Allow taking an optional parameter to place point on a specific function. (shortdoc--display-function): Go to the function in question in the shortdoc buffer.
* Allow restoring the original order in 'tabulated-list-mode'Lars Ingebrigtsen2021-07-151-8/+36
| | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort): Allow restoring the original order (bug#13411). (tabulated-list--sort-by-column-name): Store the original order. (tabulated-list--original-order): New buffer-local variable.
* Mention more split-string-* functions in shortdocLars Ingebrigtsen2021-07-151-0/+4
| | | | | * lisp/emacs-lisp/shortdoc.el (string): Mention split-string-and-unquote and split-string-shell-command.
* Make package-menu-filter-by-status work as documentedLars Ingebrigtsen2021-07-101-3/+8
| | | | | * lisp/emacs-lisp/package.el (package-menu-filter-by-status): Work as documented (bug#49474).
* Use display-buffer with re-builder (bug#49069)pillule2021-07-081-5/+10
| | | | | | | * lisp/emacs-lisp/re-builder.el (re-builder): Uses 'display-buffer' with 'display-buffer-in-direction' to display the reb-buffer. This allow user-customizations and using it on not splitables windows. Add a dedication to its window so killing this buffer quit the window.
* Make previous empty-body warning disabling more robustLars Ingebrigtsen2021-07-061-12/+14
| | | | | * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): `byte-compile-warning-enabled-p' may not be defined here.
* Avoid invalid regexp in wide docstring checkBasil L. Contovounesios2021-07-061-1/+1
| | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Avoid constructing an invalid regexp during byte-compilation by limiting the number of columns to the current RE_DUP_MAX of 65535. This protects against pathological values of fill-column, for example (bug#49426).
* Allow inhibiting warnings about unused variables and empty bodiesLars Ingebrigtsen2021-07-062-9/+12
| | | | | | | | * lisp/emacs-lisp/cconv.el (cconv--warn-unused-msg): Allow inhibiting warnings about unbound variables (bug#26486). * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Allow inhibiting warnings about empty bodies.
* Propagate :safe properties when autoloading defcustomsLars Ingebrigtsen2021-07-051-1/+4
| | | | | * lisp/emacs-lisp/autoload.el (make-autoload): Propagate the :safe property to the loaddefs file (bug#28104).
* Ignore .dir-locals-2.el files moreLars Ingebrigtsen2021-07-042-5/+7
| | | | | | * lisp/emacs-lisp/shadow.el (load-path-shadows-find): * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Ignore .dir-locals-2.el, too (bug#23257).
* Handle test environment variablesMichael Albinus2021-07-011-3/+3
| | | | | | | | | * lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): Check also for EMACS_EMBA_CI. * test/README (SELECTOR): Mention EMACS_TEST_VERBOSE. * test/infra/gitlab-ci.yml (variables): Set EMACS_TEST_VERBOSE.
* Add new function lm-maintainers (bug#48592)Jonas Bernoulli2021-06-301-7/+15
| | | | | | | | * doc/lispref/tips.texi (Library Headers): Improve wording. * lisp/emacs-lisp/lisp-mnt.el (lm-maintainers): New function. (lm-maintainer): Make obsolete in favor of lm-maintainer. (lm-verify): Use lm-maintainers. (lm-report-bug): Use lm-maintainers.
* * lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Right-trim name.Jonas Bernoulli2021-06-301-2/+2
| | | | | The addresses might be aligned in which case we have to trim the extra whitespace at the end of the names.
* Adjust docstring of lisp-mode (bug#49278)João Távora2021-06-301-1/+1
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-mode): Mention that this mode is primarily for Common Lisp.
* Make the minor mode doc strings say that they're minor modesLars Ingebrigtsen2021-06-301-3/+3
| | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Mention that this is a minor mode (bug#20462).
* Add new function file-name-with-extensionColin Woodbury2021-06-301-0/+3
| | | | | | | * doc/lispref/files.texi (File Name Components): Document it. * lisp/emacs-lisp/shortdoc.el (file-name): Ditto. * lisp/files.el (file-name-with-extension): New function.
* * lisp/minibuffer.el (completion-in-region--single-word): SimplifyStefan Monnier2021-06-261-2/+1
| | | | | | | | | Remove redundant args `collection` and `predicate` which were always equal to `minibuffer-completion-table` and `minibuffer-completion-predicate` anyway. (minibuffer-complete-word): * lisp/emacs-lisp/crm.el (crm-complete-word): Simplify accordingly.
* * lisp/emacs-lisp/cl-macs.el: Fix test regressionStefan Monnier2021-06-261-1/+8
| | | | | (cl--alist-to-plist): New function. (cl-struct-slot-info): Use it.
* Print newlines as \n instead of \12 in ERT resultsMattias Engdegård2021-06-251-1/+1
| | | | | | | | This makes test errors unquestionably more readable. The change also makes FF print as \f; other controls still use octal escapes. * lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline): Run `pp` with `pp-escape-newlines` set to `t`.
* Make (find-face-definition 'default) work more reliablyLars Ingebrigtsen2021-06-251-1/+9
| | | | | | | * lisp/emacs-lisp/find-func.el (find-function--defface): New function (bug#30230). (find-function-regexp-alist): Use it to skip past definitions inside comments and strings.
* * lisp/emacs-lisp/cl-preloaded.el: Fix the format of props in slot-descsStefan Monnier2021-06-242-18/+13
| | | | | | | | | | (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.
* Don't call ERT explainer on errorMattias Engdegård2021-06-241-6/+7
| | | | | | | * lisp/emacs-lisp/ert.el (ert--expand-should-1): If the predicate form signals an error, don't call an explainer because the arguments passed (the error and error argument, respectively) do not make any sense to the explainer at all.
* Attempt to make defclass documentation more legibleLars Ingebrigtsen2021-06-242-4/+8
| | | | | | * lisp/emacs-lisp/cl-extra.el (cl--print-table): Attempt to make defclass documentation more readable (bug#30998). (cl--describe-class-slots): Ditto.
* Fix printing of defclass documentation slots againLars Ingebrigtsen2021-06-241-2/+8
| | | | | | * lisp/emacs-lisp/cl-extra.el (cl--describe-class-slots): Fix printing defclass slots, and retain printing of defstruct slots (bug#30998 and bug#46662).
* Clarify the help in the package buffersLars Ingebrigtsen2021-06-241-1/+2
| | | | | * lisp/emacs-lisp/package.el (package--quick-help-keys): Clarify marking help (bug#40457).
* Make minor mode docstrings say what the mode "variable" isLars Ingebrigtsen2021-06-221-3/+9
| | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Add the mode variable (bug#36500). (easy-mmode--mode-docstring): (define-minor-mode): Pass in the getter.
* 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.