summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Make "eager macro-expansion" warning into an errorLars Ingebrigtsen2022-06-301-3/+3
| | | | | | | | | | | | | | | | | | | | * doc/lispref/loading.texi (How Programs Do Loading): Update documentation. * lisp/emacs-lisp/macroexp.el: (internal-macroexpand-for-load): We've been warning about eager macro expansion for many years, so finally change that into an error (bug#18154).
* | Add find-function-setup-keys bindings for find-library commandsLars Ingebrigtsen2022-06-301-1/+4
| | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-setup-keys): Add `L' bindings for the find-library family of commands (bug#51240).
* | Add provide to testcoverLars Ingebrigtsen2022-06-301-0/+2
| | | | | | | | * lisp/emacs-lisp/testcover.el (testcover): Provide (bug#55388).
* | * lisp/emacs-lisp/rx.el: Indent some rx constructs correctly.Mattias Engdegård2022-06-291-0/+8
| | | | | | | | | | This includes group-n, submatch-n, =, >=, ** and repeat, whose first 1 or 2 arguments are special.
* | (cl--generic-compiler): Revert last changeStefan Monnier2022-06-291-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That change (introduced to circumvent an error now that `seq.el` is preloaded) caused all dispatchers to be left uncompiled, which slows down method dispatch very significantly. Fix the problem in the old way, i.e. by adding an explicit call to `cl--generic-prefill-dispatchers`. * lisp/emacs-lisp/cl-generic.el (cl--generic-compiler): Revert last change. Add (cl--generic-prefill-dispatchers 1 integer) instead to handle the new dispatchers needed for `seq.el`. (cl--generic-prefill-generalizer-sample): New function. (cl--generic-get-dispatcher): Use it to signal an error giving precise instructions for what to do if we're about the load the byte-compiler during the preload. (cl--generic-oclosure-generalizer): Rename from `cl-generic--oclosure-generalizer` for consistency with all other generalizers.
* | Allow using define-short-documentation-group without loading shortdocLars Ingebrigtsen2022-06-281-12/+12
| | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): Allow using without loading shortdoc.el (bug#56260).
* | Allow plist-get/plist-put/plist-member to take a comparison functionLars Ingebrigtsen2022-06-273-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/lists.texi (Plist Access): Document it. * lisp/filesets.el (filesets-reset-fileset) (filesets-ingroup-cache-get): (filesets-ingroup-cache-put): (filesets-build-menu-now): Don't use lax-plist functions. * lisp/simple.el (lax-plist-put, lax-plist-get): Moved here from fns.c and make obsolete. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Don't mark plist functions as side-effect-free or pure. * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Adjust type. * lisp/emacs-lisp/shortdoc.el (list): Don't document deprecated functions. * src/xdisp.c (build_desired_tool_bar_string): (display_mode_element): (store_mode_line_string): (display_string): (produce_stretch_glyph): (note_mode_line_or_margin_highlight): (note_mouse_highlight): * src/w32.c (serial_configure): * src/sysdep.c (serial_configure): * src/sound.c (parse_sound): * src/process.c (Fset_process_buffer): (Fset_process_sentinel): (Fprocess_contact): (Fmake_process): (Fmake_pipe_process): (Fset_network_process_option): (Fserial_process_configure): (Fmake_serial_process): (set_network_socket_coding_system): (finish_after_tls_connection): (connect_network_socket): (Fmake_network_process): (server_accept_connection): * src/lread.c (ADDPARAM): (hash_table_from_plist): * src/keyboard.c (make_lispy_position): * src/indent.c (check_display_width): * src/image.c (postprocess_image): * src/gnutls.c (gnutls_verify_boot): (Fgnutls_boot): (gnutls_symmetric): (Fgnutls_hash_mac): (Fgnutls_hash_digest): * src/dired.c (filter): * src/data.c (add_to_function_history): * src/coding.c (Fcoding_system_put): Adjust callers from Fplist_put (etc) to plist_put. * src/fns.c (plist_get): (plist_put): (plist_member): New functions (without optional third parameter) to be used in C code. * src/fns.c (Fplist_get, Fplist_put, Fplist_member): Take an optional predicate parameter (bug#47425). * src/lisp.h: Declare new plist_put, plist_get and plist_member functions. * test/lisp/json-tests.el (test-json-add-to-plist): Use plist-get. * test/src/fns-tests.el (test-cycle-lax-plist-get): (test-cycle-lax-plist-put): (lax-plist-get/odd-number-of-elements): (test-plist): Remove lax-plist tests, since semantics have changed (they no longer error out on cycles).
* | Optimise away functions in for-effect contextMattias Engdegård2022-06-261-17/+17
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Turn functions into nil when compiled for-effect since they have no side-effects on their own. This may enable further improvements such as the elimination of variable bindings. `unwind-protect` forms can be treated as plain function call at this point. In particular, their unwind function argument should be not optimised for effect since it's a function.
* | Fix a recent Lisp mode filling test failureLars Ingebrigtsen2022-06-261-0/+12
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Restore the "fill first line separately" logic.
* | * lisp/emacs-lisp/syntax.el: Rework the handling of nested calls.Stefan Monnier2022-06-261-23/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nested calls to `syntax-ppss` and `syntax-propertize` can easily happen unexpectedly via ondemand propertizing or `forward-sexp`. Refine the handling of nested calls so we detect them more reliably (e.g. also within `syntax-propertize-extend-region-functions`) and so that the `syntax-ppss` cache is automatically flushed in case it might have been filled with data that's become obsolete since. (syntax-propertize--inhibit-flush): Delete var. (syntax-propertize--in-process-p): New function to replace it. (syntax-ppss-flush-cache): Use it. (syntax-ppss--updated-cache): New var. (syntax-propertize): Make `syntax-propertize--done` binding apply to `syntax-propertize-extend-region-functions` as well, as intended (fixes bug#46713). Use `syntax-ppss--updated-cache` to flush syntax-ppss cache at the end when needed. Don't bind `syntax-propertize--inhibit-flush` any more. (syntax-ppss): Set `syntax-ppss--updated-cache` when applicable.
* | Make `M-q' work on the first line of a multi-line string againLars Ingebrigtsen2022-06-251-2/+2
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Exclude the quote marks from the region so that filling works (bug#56197).
* | Re-fix build warnings about subr-x defsubstsLars Ingebrigtsen2022-06-251-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (require): * lisp/progmodes/elisp-mode.el (require): * lisp/isearch.el (require): Require subr-x at compile time, since these use defsubsts/macros from there. * lisp/emacs-lisp/subr-x.el (string-empty-p): Move from here... * lisp/simple.el (string-empty-p): ... to here. This is to help with a build problem where files.el is using the defsubst, but requiring subr-x.el at compile time leads to load errors.
* | Bytecode opcode comments updateMattias Engdegård2022-06-241-13/+14
| | | | | | | | | | | | | | | | | | | | | | This is a cosmetic change only; there is no change in behaviour. * lisp/emacs-lisp/bytecomp.el: * src/bytecode.c (BYTE_CODES, exec_byte_code): Update and/or remove incorrect, outdated or useless comments. Clarify. Reorder where appropriate. Rename Bsave_current_buffer to Bsave_current_buffer_OBSOLETE and Bsave_current_buffer_1 to Bsave_current_buffer, reflecting the state since 1996.
* | Update seq.el commentLars Ingebrigtsen2022-06-241-2/+2
| | | | | | | | * lisp/emacs-lisp/seq.el: Update comment.
* | Allow read-multiple-choice to do long-form answersLars Ingebrigtsen2022-06-241-3/+22
| | | | | | | | | | | | | | | | | | | | * doc/lispref/commands.texi (Reading One Event): Document it. * lisp/emacs-lisp/rmc.el (read-multiple-choice): Allow using long-form answers instead of single character ones. (read-multiple-choice--long-answers): New function. (read-multiple-choice--short-answers): Refactored out from the main function.
* | Fix cl-generic bootstrap problemsLars Ingebrigtsen2022-06-242-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/sqlite-mode.el (require): * lisp/net/eudc.el (require): * lisp/arc-mode.el (require): Require subr-x, since these files are using macros from there. * lisp/emacs-lisp/subr-x.el (with-memoization): Move from here... * lisp/subr.el (with-memoization): ... to here, as it's used from the preloaded cl-generic.el file. * lisp/emacs-lisp/cl-generic.el (cl--generic-compiler): Don't use the autoloaded `byte-compile' function during bootstrap. (cl--generic-get-dispatcher): Don't require subr-x, either. cl-generic has been preloaded since 2015, and most usages of it (in preloaded files) work fine. In particular, using `cl-defgeneric' is unproblematic. However, `cl-defmethod' would end up pulling in the byte compiler (at load time), which would make it impossible to use `cl-defmethod' in pre-loaded files, and this change fixes that (but possibly not in the most self-evidently correct way).
* | Make debug-early-backtrace more resilientLars Ingebrigtsen2022-06-241-1/+7
| | | | | | | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Allow outputting backtraces during bootstrap.
* | Remove unused function in bytecomp.elMattias Engdegård2022-06-231-12/+0
| | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-delete-first): Remove.
* | bindat (strz): Null terminate fixed-length strings if there is roomRichard Hansen2022-06-221-7/+6
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (bindat--pack-strz): For fixed-length strz fields, explicitly write a null terminator after the packed string if there is room (bug#56048). * doc/lispref/processes.texi (Bindat Types): Update documentation. * test/lisp/emacs-lisp/bindat-tests.el (bindat-test--str-strz-prealloc): Update tests.
* | ; bindat (strz): Move all pack logic to pack function (bug#56048)Richard Hansen2022-06-221-26/+23
| | | | | | | | | | | | | | | | | | | | Motivation/rationale: * Improve code readability. Now `bindat--pack-strz` is used for all `strz` packing, not just variable-length `strz` packing. * Make it easier to change the behavior of fixed-length `strz` packing without also affecting the behavior of `str` packing. (A future commit will modify `strz` to write a null terminator if there is room.)
* | Fix autoload generation of iter-defun formsMichael Heerdegen2022-06-211-1/+1
| | | | | | | | | | | | | | | | This fixes Bug#54648. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Add `iter-defun' and `cl-iter-defun' to the list of "complex cases" that are macro-expanded and recursed on.
* | Document and test 'no-byte-compile' behavior.Philipp Stephani2022-06-211-0/+3
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Document behavior if 'no-byte-compile' is set. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-compile-file/no-byte-compile): New unit test. * test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el: New test file.
* | Check defface doc stringsLars Ingebrigtsen2022-06-211-6/+6
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-custom-declare-variable): We already warn about missing groups from byte-compile-normal-call, so this would be a double warning. (custom-declare-face) (byte-compile-file-form-custom-declare-face): Add doc string checking for defface.
* | Fix potential (goto-char nil) in byte-compile-warning-prefixAlan Mackenzie2022-06-201-2/+1
| | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Replace a wrong 'or' form involving OFFSET with simply OFFSET. This prevents OFFSET from possibly being nil in the first branch of the containing `if' form.
* | Fix bytecompiler infloop compiling infloopsPip Cet2022-06-201-3/+3
| | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Don't apply optimization if we can't change anything (bug#46906).
* | Fix edebug parsing of .,Lars Ingebrigtsen2022-06-191-1/+1
| | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-next-token-class): Parse ., correctly (bug#37653).
* | Make checkdoc-defun-info parsing slightly less wrongLars Ingebrigtsen2022-06-191-5/+12
| | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info): Disregard `interactive' in nested parts of the defun (bug#56052).
* | Add mechanism for gradually phasing in new byte compilation warningsLars Ingebrigtsen2022-06-191-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/Makefile.in (BYTE_COMPILE_FLAGS): Enable all byte compilation warnings. * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types): Add docstrings-non-ascii-quotes and document new semantics for `all' and t. (byte-compile--emacs-build-warning-types): New constant. (byte-compile-warning-enabled-p): Implement the new semantics. (byte-compile-docstring-style-warn): Reinstate the Unicode quote warning.
* | Merge from origin/emacs-28Stefan Kangas2022-06-191-1/+1
|\| | | | | | | 422f958030 Fix invalid defcustom :group when :predicate is used
| * Fix invalid defcustom :group when :predicate is usedRichard Hansen2022-06-181-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix invalid `:group' argument for the `-modes' defcustom that is created when `:predicate' is used (bug#56049).
* | More aggressive bytecode split between top-level forms (bug#55972)Mattias Engdegård2022-06-181-5/+4
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-keep-pending): Allow bytecode split between all kinds of top-level forms, not just those with chunk handlers, to prevent individual chunks from growing too large. In particular this helps compilation of package-quickstart.el.
* | Fix checkdoc--fix-y-or-n-p queryLars Ingebrigtsen2022-06-181-1/+1
| | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc--fix-y-or-n-p): Fix the query to match what's done (bug#56053).
* | Allow pretty-printing results from `C-x C-e' in edebugLars Ingebrigtsen2022-06-181-12/+16
| | | | | | | | | | | | | | * doc/lispref/edebug.texi (Edebug Eval): Document it. * lisp/emacs-lisp/edebug.el (edebug-eval-expression): Allow displaying the full value in a different buffer.
* | Merge from origin/emacs-28Stefan Kangas2022-06-181-2/+3
|\| | | | | | | | | | | | | d671cd57c4 Update cl-struct-sequence-type doc string 017bdb1611 Fix a tagging problem in tramp.texi e0bac17bbc Mention face quirks after the final line in the lispref ma... ad74677cf3 Delete reference to obsolete library complete.el
| * Update cl-struct-sequence-type doc stringLars Ingebrigtsen2022-06-171-2/+3
| | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-struct-sequence-type): Fix doc string to reflect what it does (bug#46523).
* | Extend 'e' in edebug to pretty-print the valuesLars Ingebrigtsen2022-06-181-20/+34
| | | | | | | | | | | | | | * doc/lispref/edebug.texi (Edebug Eval): Document it. * lisp/emacs-lisp/edebug.el (edebug-eval-expression): Allow displaying the full value in a different buffer.
* | Slightly faster hash-table-keys and hash-table-valuesMattias Engdegård2022-06-171-2/+6
| | | | | | | | | | | | | | * lisp/emacs-lisp/subr-x.el (hash-table-keys, hash-table-values): Omit the reversal of the returned list. It is not ordered anyway. * test/lisp/emacs-lisp/subr-x-tests.el (subr-x--hash-table-keys-and-values): New test.
* | Don't quote numbers in byte-run--set-*Lars Ingebrigtsen2022-06-171-2/+6
| | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-run--set-doc-string) (byte-run--set-indent): Don't quote numbers (bug#48145).
* | Don't quote the `when' form in obsoletionsLars Ingebrigtsen2022-06-172-1/+2
| | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-run--set-obsolete): The `when' is a string (or nil), so don't quote it (bug#48145). * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form): Adjust folding.
* | Warn about misplaced or duplicated function/macro declarationsMattias Engdegård2022-06-171-91/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doc strings, `declare` and `interactive` forms must appear in that order and at most once each. Complain if they don't, instead of silently ignoring the problem (bug#55905). * lisp/emacs-lisp/byte-run.el (byte-run--parse-body) (byte-run--parse-declarations): New. (defmacro, defun): Check for declaration well-formedness as described above. Clarify doc strings. Refactor some common code. * test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el: * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-fun-attr-warn): New test.
* | Make package-recompile delete all .elc files firstLars Ingebrigtsen2022-06-161-1/+2
| | | | | | | | | | * lisp/emacs-lisp/package.el (package-recompile): Delete all .elc files under the package directory.
* | Add new package.el commands for recompilationLars Ingebrigtsen2022-06-161-0/+28
| | | | | | | | | | | | | | * doc/emacs/package.texi (Package Installation): Document them. * lisp/emacs-lisp/package.el (package-recompile): (package-recompile-all): New commands (bug#27253).
* | bindat (strz): Write null terminator after variable length stringRichard Hansen2022-06-161-0/+3
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (bindat--pack-strz): Explicitly write a null byte after packing a variable-length string to ensure proper termination when packing to a pre-allocated string. * doc/lispref/processes.texi (Bindat Types): Update documentation. * test/lisp/emacs-lisp/bindat-tests.el (bindat-test--str-strz-prealloc): Update tests.
* | Fix ;;;###autoload scanning from (some) packagesLars Ingebrigtsen2022-06-151-1/+5
| | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file): Fix autoloads scanning from packages.
* | Simplify byte-compiler assuming cconv normalisationsMattias Engdegård2022-06-142-36/+11
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker) (byte-optimize-let-form, byte-optimize-letX): * lisp/emacs-lisp/bytecomp.el (byte-compile-unwind-protect): Simplify source optimisation and codegen code that can now rely on normalised let/let* and unwind-protect forms.
* | Run cconv for dynbound code as wellMattias Engdegård2022-06-142-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | Make cconv work for dynamically bound code and always run it. This allows later stages to benefit from transformations and normalisations in cconv. * lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): Always run cconv. * lisp/emacs-lisp/cconv.el (cconv--analyze-function) (cconv-analyze-form): In dynbound code, treat all variable bindings as dynamic (lambda, let, let* and condition-case).
* | Normalise setq during macro-expansionMattias Engdegård2022-06-144-74/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Early normalisation of setq during macroexpand-all allows later stages, cconv, byte-opt and codegen, to be simplified and duplicated checks to be eliminated. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Normalise all setq forms to a sequence of (setq VAR EXPR). Emit warnings if necessary. * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form): * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): * lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Simplify. * test/lisp/emacs-lisp/bytecomp-tests.el: Adapt and add tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el; * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el: New files.
* | Leave the contents on the *Backtrace* buffer on `q'Lars Ingebrigtsen2022-06-141-6/+5
| | | | | | | | | | * lisp/emacs-lisp/debug.el (debug): Don't clear the contents of the buffer on `q' (bug#55863).
* | ; * lisp/emacs-lisp/cconv.el: Fix outdated comments.Mattias Engdegård2022-06-141-8/+5
| |
* | bindat (strz): Error on null byte if packing variable-length stringRichard Hansen2022-06-131-0/+5
| | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (strz): Signal an error if a null byte is encountered while packing a string to a variable-length strz field. * test/lisp/emacs-lisp/bindat-tests.el (strz): Add tests (bug#55938).