summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* Optimise prog1 betterMattias Engdegård2021-07-301-5/+8
| | | | | | | | | | Rewrite (prog1 CONST FORMS...) => (progn FORMS... CONST) where CONST is a compile-time constant, because putting the value last allows the lapcode peephole pass to do important improvements like branch elimination. Also use progn instead of prog1 for `ignore`. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): New `prog1` and `ignore` transforms.
* Elide lexical variables in for-effect context in source optimiserMattias Engdegård2021-07-301-10/+15
| | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove for-effect uses of lexical variables. We previously relied on this being done by the lapcode peephole optimiser but at source level it enables more optimisation opportunities. Keywords are elided for the same reason.
* Single source optimiser entry pointMattias Engdegård2021-07-302-4/+11
| | | | | | | | | | | | Make the optimiser aware of lexical arguments. Otherwise we cannot know for sure whether a variable is lexical or dynamic during traversal. * lisp/emacs-lisp/byte-opt.el (byte-optimize-one-form): New optimiser entry point, replacing the recursive byte-optimize-form. * lisp/emacs-lisp/bytecomp.el (byte-optimize-one-form): Autoload. (byte-compile-keep-pending, byte-compile-top-level): Use byte-optimize-one-form.
* Make byte-recompile-directory less brittleLars Ingebrigtsen2021-07-281-2/+2
| | | | | * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Don't interpret files named "~" as $HOME (bug#49758).
* Fix mistake in switch-case generation of `null` (bug#49746)Mattias Engdegård2021-07-271-1/+2
| | | | | | | | | Reported by Gregor Zattler. * lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix): Be more careful in the selection of equality. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* Add commands to move to next/previous column in tabulated-list-modePeter Feigl2021-07-251-0/+24
| | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode-map): Add keybindings M-left and M-right. (tabulated-list-previous-column tabulated-list-next-column): Implement commands (bug#44711).
* Rename directory-append to file-name-concatLars Ingebrigtsen2021-07-251-5/+5
| | | | | | | | * src/fileio.c (Ffile_name_concat): * lisp/files.el (move-file-to-trash): * lisp/emacs-lisp/shortdoc.el (file-name): * doc/lispref/files.texi (Directory Names): Rename `directory-append' to `file-name-concat'.
* Extend directory-append to take an arbitrary number of componentsLars Ingebrigtsen2021-07-241-0/+1
| | | | | | | | * doc/lispref/files.texi (Directory Names): Document it. * lisp/emacs-lisp/shortdoc.el (file-name): Add new example. * src/fileio.c (Fdirectory_append): Change the function to take an arbitrary number of components.
* Add new function `directory-append'Lars Ingebrigtsen2021-07-241-1/+8
| | | | | | | | | * doc/lispref/files.texi (Directory Names): Document it, and remove the concat-based file concatenation description. * lisp/emacs-lisp/shortdoc.el (file-name): Add. And add more expand-file-name examples. * src/fileio.c (Fdirectory_append): New function.
* 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.