summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Use pcaseStefan Monnier2021-01-161-176/+175
|
* * lisp/emacs-lisp/pcase.el: Add support for `not` to `pred`Stefan Monnier2021-01-163-14/+43
| | | | | | | | | | | | | (pcase--split-pred, pcase--funcall): Adjust for `not`. (pcase--get-macroexpander): New function. (pcase--edebug-match-macro, pcase--make-docstring) (pcase--macroexpand): Use it. * lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Use it! * doc/lispref/control.texi (The @code{pcase} macro): Document it. * lisp/emacs-lisp/ert.el (ert--explain-equal-rec): Remove redundant test.
* * lisp/emacs-lisp/seq.el (seq-concatenate): Unautoload (merge fix).Glenn Morris2021-01-151-3/+0
| | | | gitmerge-skip-regexp does not handle line breaks.
* Merge from origin/emacs-27Glenn Morris2021-01-141-0/+3
|\ | | | | | | | | | | | | | | 488204cdc6 (origin/emacs-27) Remove one of recently added warnings ab... 55bc1560ac Fix assertion failure in window_box_height (Bug#45737) 27743e9e70 Fix cl-concatenate inlining 32a3758c84 Fix infloop in 'pixel-scroll-mode' 74d18957b8 Fix inhibiting the default.el loading in user init file
| * Fix cl-concatenate inliningEli Zaretskii2021-01-091-0/+3
| | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-concatenate): Auto-load it. Do not merge to master. (Bug#45610)
* | * lisp/emacs-lisp/eieio-base.el: Silence warnings in last changeStefan Monnier2021-01-111-54/+54
| | | | | | | | | | (eieio-persistent-make-instance): Quote the `eieio-named` class name. (eieio-named): Move before `eieio-persistent`.
* | eieio-base.el:Eric Ludlam2021-01-111-7/+22
| | | | | | | | | | | | | | (eieio-persistent-make-instance): Save the backward compatible 'name' of objects saved in the file, and if the newly loaded class inherits from 'eieio-named', restore the name of the object. Author: Eric Ludlam <zappo@gnu.org>
* | Hyperlink symbol names without word syntax in HelpBasil L. Contovounesios2021-01-101-4/+2
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2) (lisp-cl-font-lock-keywords-2): Allow single-character symbol names. * lisp/help-mode.el (help-xref-symbol-regexp): Also match symbol names starting with symbol syntax (bug#6601, bug#24309). * test/lisp/help-mode-tests.el (help-mode-tests-xref-button): Test hyperlink creation for function names without symbol syntax.
* | Minor shortdoc link improvementsDaniel Martín2021-01-101-2/+11
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Use describe-function as a fallback link when a function is not documented in any Info manual. Also make the link respond to mouse-1, like the rest of *Help* links, and add a proper help-echo property. * lisp/help-fns.el (help-fns--mention-shortdoc-groups): Same link improvement as described before, this time for the shortdoc groups (bug#45750).
* | * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Fix build of gnus-agent.elStefan Monnier2021-01-091-1/+2
| | | | | | | | Don't burp on "naked" variable let bindings.
* | Fix cl-concatenate use in macrosEli Zaretskii2021-01-091-2/+2
| | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (inline): Remove cl-concatenate. (Bug#45610)
* | * lisp/emacs-lisp/cl-macs.el: Optimize self-calls in tail positionStefan Monnier2021-01-081-7/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a limited form of tail-call optimization for the special case of recursive functions defined with `cl-labels`. Only self-recursion is optimized, no attempt is made to handle more complex cases such a mutual recursion. The main benefit is to reduce the use of the stack, tho in my limited tests, this can also improve performance (about half of the way to a hand-written `while` loop). (cl--self-tco): New function. (cl-labels): Use it. * lisp/subr.el (letrec): Optimize single-binding corner case. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add tests to check that TCO is working.
* | * lisp/subr.el (letrec): Optimize some non-recursive bindingsStefan Monnier2021-01-081-1/+1
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Look inside bytecode objects as well. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): * test/lisp/subr-tests.el (subr--tests-letrec): New tests.
* | * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Fix last changeStefan Monnier2021-01-081-1/+1
| |
* | * lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Rename from `pcase--fgrep`Stefan Monnier2021-01-083-38/+42
| | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl--generic-fgrep): Delete. (cl--generic-lambda): Use `macroexp--pacse` instead. * lisp/emacs-lisp/pcase.el (pcase--fgrep): Rename to `macroexp--fgrep`.
* | Fix obsolete variable warnings about class namesMichael Heerdegen2021-01-062-5/+7
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload): Try to make the wording of the warning about the obsoleted variable less confusing. * lisp/emacs-lisp/bytecomp.el (byte-compile-check-variable): Don't warn for lexical variables (Bug#39169). Fix spurious `or'. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp/warn-obsolete-variable-bound\.el): New test. * test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-bound.el: New file.
* | * lisp/emacs-lisp/package.el (package-activate-all): Another tweakStefan Monnier2021-01-051-0/+2
| | | | | | | | | | | | `package-quickstart.el` files presume `package-activated-list` is a bound variable, so make sure this is the case even when `package.el` is not yet loaded.
* | * lisp/emacs-lisp/autoload.el: Improve last changeStefan Monnier2021-01-051-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out there were other places that used `custom-initialize-delay` on autoloaded variables and used various hacks to make it work with `autoload.el`. The new code makes those hacks unneeded. Also, there's no point trying to "optimize" those rare cases anyway, so I simplified the `autoload.el` code for those cases. (make-autoload): For non-trivial cases, just include the whole `defcustom` instead of trying to mimic it. * lisp/mail/rmail.el (rmail-spool-directory): Remove hacks. * lisp/info.el (Info-default-directory-list): Remove `progn` hack. * lisp/custom.el (custom-declare-variable) (custom-handle-all-keywords): Don't use pseudo-group `nil`.
* | * lisp/emacs-lisp/package.el: Load package-quickstart without package.elStefan Monnier2021-01-052-31/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed up startup when `package-quickstart` is in use by making it possible to load the quickstart file without having to load `package.el` at all. (package-user-dir, package-directory-list, package-quickstart-file): Preload those variables. (package--get-activatable-pkg): New fun, extracted from `package-activate`. (package-activate): Use it. (package--activate-all): New function, extracted from `package-activate-all`. (package-activate-all): Use it and make the function preloaded. (package--archives-initialize): New function. (package-install): Use it. (list-packages): Avoid `switch-to-buffer`. (package-get-descriptor): New function. * lisp/startup.el (command-line): Simplify the code now that package-user-dir and package-directory-list are preloaded. * lisp/emacs-lisp/autoload.el (make-autoload): Add support for `:initialize #'custom-initialize-delay` in `defcustom`.
* | * lisp/emacs-lisp/byte-run.el (make-obsolete): Make `when` mandatoryStefan Monnier2021-01-031-20/+9
| | | | | | | | | | (define-obsolete-function-alias, make-obsolete-variable) (define-obsolete-variable-alias): Adjust similarly.
* | Merge from origin/emacs-27Paul Eggert2021-01-011-1/+1
|\| | | | | | | 33d159c36f Fix copyright years by hand
| * Fix copyright years by handPaul Eggert2021-01-011-1/+1
| | | | | | | | These are dates that admin/update-copyright did not update.
| * Update copyright year to 2021Paul Eggert2021-01-0188-88/+88
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Update copyright year to 2021Paul Eggert2021-01-0190-90/+90
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | Add lexical-binding cookie to autoload filesStefan Kangas2020-12-311-1/+2
| | | | | | | | | | | | * build-aux/update-subdirs: * lisp/emacs-lisp/autoload.el (autoload-rubric): Add lexical-binding cookie to generated files (bug#44854).
* | Fix some over-wide docstringsStefan Kangas2020-12-303-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/analyze/refs.el (semantic-analyze-refs-proto) (semantic-analyze-refs-impl): * lisp/cedet/semantic/symref.el (semantic-symref-hit-to-tag-via-buffer): * lisp/emacs-lisp/chart.el (chart-axis-draw): * lisp/emacs-lisp/cl-macs.el (cl-defstruct, cl-loop): * lisp/emacs-lisp/eieio-core.el (eieio--add-new-slot): * lisp/eshell/em-unix.el (eshell/info): * lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): * lisp/gnus/gnus-agent.el (gnus-agent-read-article-number): * lisp/gnus/gnus-util.el (gnus-put-overlay-excluding-newlines) (gnus-put-text-property-excluding-newlines): * lisp/gnus/message.el (message-sort-headers): * lisp/gnus/nntp.el (nntp-with-open-group) (nntp-with-open-group-function): * lisp/gnus/nnvirtual.el (nnvirtual-create-mapping): * lisp/mail/feedmail.el (feedmail-fiddle-list-of-fiddle-plexes) (feedmail-queue-reminder, feedmail-mail-send-hook-splitter): * lisp/net/dictionary.el (dictionary-do-matching): * lisp/obsolete/longlines.el (longlines-auto-wrap): * lisp/org/ob-sql.el (org-babel-sql-dbstring-vertica): * lisp/org/ol-bbdb.el (org-bbdb-date-list): * lisp/progmodes/cc-cmds.el (c-mark-function): * lisp/progmodes/cperl-mode.el (cperl-add-tags-recurse) (cperl-add-tags-recurse-noxs-fullpath) (cperl-add-tags-recurse-noxs): * lisp/progmodes/etags.el (tags-search): * lisp/progmodes/verilog-mode.el (verilog-delete-auto-buffer) (verilog-auto-re-search-do, verilog-expand-vector-internal): * lisp/textmodes/reftex-parse.el (reftex-init-section-numbers): * lisp/textmodes/reftex-toc.el (reftex-toc-load-all-files-for-promotion): * lisp/textmodes/sgml-mode.el (html-mode): * lisp/textmodes/table.el (table--transcoord-cache-to-table) (table--transcoord-table-to-cache, table--remove-eol-spaces) (table--region-in-cell-p, table-goto-bottom-right-corner) (table-split-cell-horizontally): * lisp/url/url-handlers.el (url-insert): * lisp/vc/ediff-util.el (ediff-inferior-compare-regions): Fix doc strings to not exceed 80-column limits. (Bug#44858)
* | Also count symbol plists in memory-reportLars Ingebrigtsen2020-12-301-0/+12
| | | | | | | | | | | | * lisp/emacs-lisp/memory-report.el (memory-report--symbol-plist): New function. (memory-report): Use it.
* | Fill some auto-generated docstringsStefan Kangas2020-12-282-38/+43
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode) (define-globalized-minor-mode): Fill auto-generated documentation strings. (Bug#44858) * lisp/subr.el (internal--fill-string-single-line) (internal--format-docstring-line): New functions.
* | Make byte-compiler warn about wide docstringsStefan Kangas2020-12-281-2/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): (byte-compile-docstring-length-warn): New defuns. (byte-compile-docstring-max-column): New defcustom. (byte-compile--wide-docstring-substitution-len): New variable. (byte-compile-warning-types, byte-compile-warnings): New value 'docstrings'. (byte-compile-file-form-autoload, byte-compile-file-form-defvar): (byte-compile-file-form-defvar-function, byte-compile-lambda): (byte-compile-defvar, byte-compile-file-form-defalias): Warn about too wide docstrings. (Bug#44858) * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn-wide-docstring/defconst) (bytecomp-warn-wide-docstring/defvar): New tests. (bytecomp--define-warning-file-test): New macro. (bytecomp/warn-wide-docstring-autoload\.el) (bytecomp/warn-wide-docstring-custom-declare-variable\.el) (bytecomp/warn-wide-docstring-defalias\.el) (bytecomp/warn-wide-docstring-defconst\.el) (bytecomp/warn-wide-docstring-define-abbrev-table\.el) (bytecomp/warn-wide-docstring-define-obsolete-function-alias\.el) (bytecomp/warn-wide-docstring-define-obsolete-variable-alias\.el) (bytecomp/warn-wide-docstring-defun\.el) (bytecomp/warn-wide-docstring-defvar\.el) (bytecomp/warn-wide-docstring-defvaralias\.el) (bytecomp/warn-wide-docstring-ignore-fill-column\.el) (bytecomp/warn-wide-docstring-ignore-override\.el) (bytecomp/warn-wide-docstring-ignore\.el) (bytecomp/warn-wide-docstring-multiline-first\.el) (bytecomp/warn-wide-docstring-multiline\.el): New tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-autoload.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-custom-declare-variable.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defalias.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-abbrev-table.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-function-alias.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-define-obsolete-variable-alias.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvar.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defvaralias.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-fill-column.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-override.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline-first.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-multiline.el: New files.
* | Do not output two spaces for non-autoloaded ieieo constructor functionsTim Landscheidt2020-12-281-2/+2
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor): Amend format to avoid two spaces for non-autoloaded object constructor functions (bug#45454). Copyright-paperwork-exempt: yes
* | * lisp/emacs-lisp/package.el (package-archives): Add NonGNU ELPAStefan Monnier2020-12-271-0/+3
| |
* | ; Fix recent shortdoc.el and fns.c additionsBasil L. Contovounesios2020-12-271-3/+3
| | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (list): Fix typos. * src/fns.c (Flength_equal): Fix docstring.
* | Improve "find definition" in *Help* buffersDaniel Martín2020-12-271-1/+64
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol): If our regexp algorithm could not find a location for the symbol definition, resort to find-function--search-by-expanding-macros. * test/lisp/emacs-lisp/find-func-tests.el: Add a automatic test for a function and variable generated by a macro. * etc/NEWS: Advertise the improved functionality (bug#45443).
* | Add new predicates for sequence lengthsLars Ingebrigtsen2020-12-272-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document them. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark them as side-effect-free. * lisp/emacs-lisp/shortdoc.el (list): Mention them. * src/fns.c (Flength): Mention them in the doc string. (length_internal): New function. (Flength_less, Flength_greater, Flength_equal): New defuns. (syms_of_fns): Sym them.
* | Improve the edebug-form-data doc stringLars Ingebrigtsen2020-12-261-1/+1
| | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-form-data): Doc string clarification (bug#42776).
* | Fix infloop in memory-reportLars Ingebrigtsen2020-12-261-1/+3
| | | | | | | | | | * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Fix infloop on circular lists.
* | Fix package reloading problems on systems with symlinksLars Ingebrigtsen2020-12-251-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/package.el (package--files-load-history): We're comparing the truenames, so ensure that we've using that everywhere. This fixes problems when there's symlinks in the paths.
* | Refactor package--list-loaded-files for easier debuggabilityLars Ingebrigtsen2020-12-251-24/+29
| | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package--files-load-history) (package--list-of-conflicts): Factor out from... (package--list-loaded-files): ... this function for easier debuggability.
* | Allow `string-limit' to work on encoded stringsLars Ingebrigtsen2020-12-252-6/+31
| | | | | | | | | | | | | | * doc/lispref/strings.texi (Creating Strings): Document it. * lisp/emacs-lisp/subr-x.el (string-limit): Allow limiting on encoded strings.
* | Remove `string-slice' -- it's not very well definedLars Ingebrigtsen2020-12-252-16/+0
| | | | | | | | | | | | * doc/lispref/strings.texi (Creating Strings): Ditto. * lisp/emacs-lisp/subr-x.el (string-slice): Remove.
* | * lisp/emacs-lisp/lisp-mnt.el (lm-section-end): Stop at the right headingStefan Monnier2020-12-231-0/+2
| | | | | | | | | | `lisp-outline-level` assumes the match-data is that set by `outline-regexp`.
* | Improve the string-limit doc stringLars Ingebrigtsen2020-12-232-1/+8
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-limit): Mention truncate-string-to-width in the doc string.
* | Allow string-slice to take zero-length matchesLars Ingebrigtsen2020-12-231-13/+10
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-slice): Allow zero-length matches. Code adapted from s.el by Magnar Sveen.
* | ; Fix docstrings in last change to subr-x.elBasil L. Contovounesios2020-12-221-3/+3
| |
* | Make string-pad take an optional START parameterLars Ingebrigtsen2020-12-222-7/+9
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-pad): Alter the calling convention.
* | Change the string-limit parameter semanticsLars Ingebrigtsen2020-12-222-9/+12
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-limit): Alter the calling convention.
* | Further string-clean-whitespace tweaksLars Ingebrigtsen2020-12-221-1/+1
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Put \r back, which was mistakenly removed.
* | Tiny string-clean-whitespace simplificationBasil L. Contovounesios2020-12-211-1/+1
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Streamline by treating replacement string as being literal and having fixed case.
* | Make string-chop-newline more efficientLars Ingebrigtsen2020-12-211-1/+1
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more efficient.
* | Make string-clean-whitespace work on non-ASCII whitespace, tooLars Ingebrigtsen2020-12-211-1/+3
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Also clean up non-ASCII whitespace.