summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | * lisp/emacs-lisp/oclosure.el (oclosure--define): AutoloadStefan Monnier2022-03-291-0/+1
| |
* | Temporarily fix the oclosure bootstrapPo Lu2022-03-291-0/+2
| | | | | | | | | | | | * lisp/emacs-lisp/oclosure.el (oclosure-define): Load oclosure from source if `oclosure--define' is not defined during byte compilation.
* | Add OClosures, a cross between functions and structsStefan Monnier2022-03-282-2/+538
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We here just add the new type. It is not fully self-contained. It requires cooperation from `cconv.el` on the one hand, and it hijacks the docstring info to hold the type of OClosure objects. This does imply that OClosures can't have docstrings, tho this limitation will be lifted in subsequent patches. * lisp/emacs-lisp/oclosure.el: New file. * test/lisp/emacs-lisp/oclosure-tests.el: New file. * doc/lispref/functions.texi (OClosures): New section. * src/eval.c (Ffunction): Accept symbols instead of strings for docstrings. * src/doc.c (store_function_docstring): Avoid overwriting an OClosure type. * lisp/emacs-lisp/cconv.el (cconv--convert-function): Tweak ordering of captured variables. (cconv-convert): Add case for `oclosure--fix-type`.
* | Improve pp-last-sexp ergonomicsLars Ingebrigtsen2022-03-251-0/+4
| | | | | | | | | | | | * lisp/emacs-lisp/pp.el (pp-last-sexp): Ignore ,@? before a sexp, because eval-ing that will always lead to an error (bug#54537).
* | Handle invisible text in Eldoc when calculating sizeAugusto Stoffel2022-03-241-5/+8
| | | | | | | | | | | | | | | | | | Co-authored-by: João Távora <joaotavora@gmail.com> * lisp/emacs-lisp/eldoc.el (eldoc--echo-area-substring, eldoc-display-in-echo-area): Take invisible text into consideration when counting lines to crop an echo-area message. (Version): Bump.
* | Don't break autoload generation of `left-margin' isn't zeroLars Ingebrigtsen2022-03-211-0/+3
| | | | | | | | | | * lisp/emacs-lisp/autoload.el (make-directory-autoloads): Fix autoload generation breakage is left-margin isn't zero (bug#54491).
* | Make `command-modes' work for (native-compiled) subrs, tooLars Ingebrigtsen2022-03-191-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-func): Add a command-modes slot. (comp-spill-lap-function, comp-intern-func-in-ctxt): Fill it. (comp-emit-for-top-level, comp-emit-lambda-for-top-level): Use it. * src/alloc.c (mark_object): Mark the command_modes slot. * src/comp.c (make_subr): Add a command_modes parameter. (Fcomp__register_lambda): Use it. (Fcomp__register_subr): Ditto. * src/data.c (Fcommand_modes): Output the command_modes data for subrs (bug#54437). * src/lisp.h (GCALIGNED_STRUCT): Add a command_modes slot. * src/pdumper.c (dump_subr): Update hash. (dump_subr): Dump the command_modes slot.
* | * lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Minor optimizationStefan Monnier2022-03-181-2/+2
| |
* | Remove some early-bootstrap dependencies for `advice`Stefan Monnier2022-03-172-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dependencies between `advice`, cl-generic`, `bytecomp`, `cl-lib`, `simple`, `help`, ... were becoming unmanageable. Break the reliance on `advice` (which includes making sure the compiler is not needed during the early bootstrap). * lisp/simple.el (pre-redisplay-function): Set without using `add-function`. * lisp/loadup.el (advice, simple): Move to after `cl-generic`. * lisp/help.el (command-error-function): Set without using `add-function`. (help-command-error-confusable-suggestions): Explicitly call `command-error-default-function` instead. * lisp/emacs-lisp/cl-macs.el (pcase--mutually-exclusive-p): Don't optimize during early-bootstrap. * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Tiny simplification. (cl-defmethod): Label the obsolescence warning as it should. (cl--generic-compiler): New variable. (cl--generic-get-dispatcher): Use it. (cl--generic-prefill-dispatchers): Make freshly made dispatchers.
* | * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Warn suspicious argsStefan Monnier2022-03-171-0/+11
| |
* | (seq-contains-p): Refine the non-nil returned valueStefan Monnier2022-03-171-2/+3
| | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-contains-p): Like `cl-some` return the value returned by the test function rather than t.
* | Make `?' work again in read-multiple-choiceLars Ingebrigtsen2022-03-171-5/+6
| | | | | | | | | | * lisp/emacs-lisp/rmc.el (read-multiple-choice): Make the `?' key work again to show the help text.
* | Format long help texts better in read-multiple-choiceFelician Nemeth2022-03-171-3/+9
| | | | | | | | | | * lisp/emacs-lisp/rmc.el (rmc--show-help): Format long help texts better (bug#54430).
* | Strip positions from symbols before the eval in eval-{when,and}-compile.Alan Mackenzie2022-03-161-4/+6
| | | | | | | | | | | | | | | | | | This fixes bug #54079. * lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Change the position of 'byte-run-strip-symbol-positions' in the eval-when-compile entry. Add a call to `byte-run-strip-symbol-positions' in the eval-and-compile entry.
* | * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Simplify Edebug specStefan Monnier2022-03-141-12/+3
| |
* | Make Edebug specification for 'cl-defstruct' more lenient.Philipp Stephani2022-03-141-1/+2
| | | | | | | | | | | | | | | | | | For example, 'xref-item' uses the list form of ':noinline'. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Accept ':noinline' and ':named' with an argument. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/edebug): New unit test.
* | Really fix find-func for defgenericLars Ingebrigtsen2022-03-131-1/+1
| | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-regexp): Really add defgeneric.
* | Make vtable sorting stableLars Ingebrigtsen2022-03-131-10/+14
| | | | | | | | | | * lisp/emacs-lisp/vtable.el (vtable--sort): Make the sorting stable.
* | Add cl-defgeneric to find-func, tooLars Ingebrigtsen2022-03-131-1/+1
| | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-regexp): Add cl-defgeneric, too (bug#54343).
* | Make find-function-regexp also find cl-defun/defmethodLars Ingebrigtsen2022-03-121-0/+1
| | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-regexp): Also find cl-defun and cl-defmethod (bug#54343).
* | Fix regression in vtable-goto-objectLars Ingebrigtsen2022-03-091-1/+1
| | | | | | | | | | * lisp/emacs-lisp/vtable.el (vtable-goto-object): Fix moving to the object.
* | (cl-macro-list): Simplify by unifying the variantsStefan Monnier2022-03-071-25/+13
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-macro-list): Add the &whole and the dotted tail cases from `cl-macro-list1`. (cl-macro-list1, cl-define-compiler-macro-list): Delete edebug elem specs. (cl-destructuring-bind, cl-define-compiler-macro): Use `cl-macro-list` instead, now that it covers all the cases we need.
* | * lisp/emacs-lisp/seq.el (seq-concatenate): Accept non-`sequencep` sequencesStefan Monnier2022-03-071-0/+1
| |
* | Restore call to byte-run-strip-symbol-positions in byte-compile-outAlan Mackenzie2022-03-062-1/+7
| | | | | | | | | | | | | | | | | | | | Also increment a loop counter. This should fix bug #54248. * lisp/emacs-lisp/byte-run.el (byte-run--strip-vector/record): increment the loop counter 'i' in the main loop. * lisp/emacs-lisp/bytecomp.el (byte-compile-out): call byte-run-strip-symbol-positions on operands which are one-element lists.
* | Merge from origin/emacs-28Stefan Kangas2022-03-061-1/+1
|\| | | | | | | | | 0090318c61 * lib-src/seccomp-filter.c (main): Use faccessat2 only if ... 3bb01a499b Fix regression in derived-mode-init-mode-variables
| * Fix regression in derived-mode-init-mode-variablesLars Ingebrigtsen2022-03-041-1/+1
| | | | | | | | | | * lisp/emacs-lisp/derived.el (derived-mode-init-mode-variables): Fix regression caused by lexical-binding derived.el (bug#54240).
* | trace.el: Preserve the line structureStefan Monnier2022-03-041-4/+7
| | | | | | | | | | | | | | | | | | Print newlines appearing inside values (i.e. inside strings) as \n rather than actual newlines so as to avoid messing up the main structure of the trace buffer. * lisp/emacs-lisp/trace.el (trace-entry-message) (trace-exit-message, trace--read-args): Quote newlines
* | Teach Edebug about the special '&whole' syntax for compiler macros.Philipp Stephani2022-03-031-1/+8
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro-list): New Edebug element specification. (cl-define-compiler-macro): Use it. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-define-compiler-macro/edebug): New unit test.
* | Clean up byte-compile-arglist-warnMattias Engdegård2022-02-281-26/+25
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn): Remove unnecessary sort (only need min and max). Reduce mutation.
* | Amend byte-run-strip-symbol-positions so that an unexec build buildsAlan Mackenzie2022-02-242-44/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug #54098. * lisp/emacs-lisp/byte-run.el (byte-run--strip-list) (byte-run--strip-vector/record): New functions. These alter a list or vector/record structure only where a symbol with position gets replaced by a bare symbol. (byte-run-strip-symbol-positions): Reformulate to use the two new functions. (function-put): No longer strip positions from the second and third arguments. * lisp/emacs-lisp/bytecomp.el (byte-compile-out): Remove the senseless "stripping" of putative symbol positions from OPERAND, which is nil or a number.
* | Don't signal an error on re-builder startup with rx syntaxLars Ingebrigtsen2022-02-221-1/+4
| | | | | | | | | | * lisp/emacs-lisp/re-builder.el (reb-initialize-buffer): Make startup with rx syntax not signal an error (bug#54107).
* | Merge from origin/emacs-28Stefan Kangas2022-02-221-4/+4
|\| | | | | | | | | | | | | | | 666e40a109 Fix 'display-line-numbers-mode' in hide-show buffers 68d134cf0f Don't check whether a deleted window is deletable (Bug#54028) b38223a844 A friendlier error message from image-mode in an empty buffer b7a651ba37 Update to Org 9.5.2-17-gea6b74 3a8c3f7abd ; Don't reference obsolete variables in edebug.el
| * ; Don't reference obsolete variables in edebug.elRaffael Stocker2022-02-201-4/+4
| | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-mode, edebug-eval-mode): Don't reference obsolete variables in the doc strings. (Bug#54070)
* | Improve vtable :keymap handlingLars Ingebrigtsen2022-02-211-2/+9
| | | | | | | | | | * lisp/emacs-lisp/vtable.el (vtable-map, vtable--make-keymap): Don't alter keymaps passed in, and respect parent keymaps.
* | Make string-pixel-width about 40% fasterLars Ingebrigtsen2022-02-201-1/+4
| | | | | | | | * lisp/emacs-lisp/subr-x.el (string-pixel-width): Speed up.
* | (macroexp-warn-and-return): Fix bug#53618Stefan Monnier2022-02-1910-50/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/macroexp.el (macroexp-warn-and-return): Reorder arguments to preserve compatibility with that of Emacs-28. (macroexp--unfold-lambda, macroexp--expand-all): * lisp/emacs-lisp/pcase.el (pcase-compile-patterns, pcase--u1): * lisp/emacs-lisp/gv.el (gv-ref): * lisp/emacs-lisp/eieio.el (defclass): * lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default) (eieio-oset-default): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): * lisp/emacs-lisp/cl-macs.el (cl-symbol-macrolet, cl-defstruct): * lisp/emacs-lisp/cl-generic.el (cl-defmethod): * lisp/emacs-lisp/byte-run.el (defmacro, defun): * lisp/emacs-lisp/bindat.el (bindat--type): Adjust accordingly.
* | Add column sorting order indicators to vtableLars Ingebrigtsen2022-02-191-9/+29
| | | | | | | | | | | | * lisp/emacs-lisp/vtable.el (vtable--indicator): New function. (vtable--insert-header-line): Use it to display sorting order indicators.
* | Make string-pixel-width slightly speedierLars Ingebrigtsen2022-02-191-3/+5
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-pixel-width): Speed up string-pixel-width in the zero-length string case.
* | Add a new library to format variable-pitch tablesLars Ingebrigtsen2022-02-191-0/+731
| | | | | | | | | | | | * doc/misc/vtable.texi (Index): New manual. * lisp/emacs-lisp/vtable.el: New library.
* | Fix symbols with position appearing in the output of `compile-defun'Alan Mackenzie2022-02-192-69/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened with the tags of a condition-case. Also fix the detection of circular lists while stripping the positions from symbols with position. * lisp/emacs-lisp/byte-run.el (byte-run--circular-list-p): Remove. (byte-run--strip-s-p-1): Write a value of t into a hash table for each cons or vector/record encountered. (This is to prevent loops with circular structures.) This is now done for all arguments, not just those detected as circular lists. * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defvar) (byte-compile-form, byte-compile-dynamic-variable-op) (byte-compile-constant, byte-compile-push-constant): Remove redundant calls to `bare-symbol'. (byte-compile-lambda): call `byte-run-strip-symbol-positions' on the arglist. (byte-compile-out): call `byte-run-strip-symbol-positions' on the operand. This is the main call to this function in bytecomp.el. * src/fns.c (hashfn_eq): Strip the position from an argument which is a symbol with position. (hash_lookup): No longer strip a position from a symbol with position. (sxhash_obj): Add handling for symbols with position, substituting their bare symbols when symbols with position are enabled.
* | Resurrect innocent joke in byte-opt.elEli Zaretskii2022-02-171-1/+5
| | | | | | | | | | * lisp/emacs-lisp/byte-opt.el: Resurrect innocent joke in a comment.
* | Fix or remove outdated commentsMattias Engdegård2022-02-171-9/+0
| | | | | | | | | | | | | | | | * src/eval.c (funcall_lambda): Rewrite obsolete comment. * src/bytecode.c (exec_byte_code): Remove lying comment and unneeded #define. * lisp/emacs-lisp/byte-opt.el: Remove car. Keep pig. (byte-compile-log-lap-1): Remove obsolete and irrelevant comment.
* | Improve interaction between track-mouse and edebugLars Ingebrigtsen2022-02-121-0/+7
| | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug--display-1): Work around `track-mouse' oddity (bug#675).
* | Autoload package-installed-pCorwin Brust2022-02-101-0/+1
| | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package-installed-p): Add autoload cookie. (Bug#53885) Copyright-paperwork-exempt: yes
* | Merge from origin/emacs-28Stefan Kangas2022-02-101-12/+14
|\| | | | | | | | | 69e82968d7 Fix integer arithmetic miss-compilation (bug#53451) 31af9bca99 Mark flymake as compatible with emacs-26.1
| * Fix integer arithmetic miss-compilation (bug#53451)Andrea Corallo2022-02-091-12/+14
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-range-for-arithm): When one of the two sources is negated revert to set dst as number. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add test to verify this is effective.
| * Fix copyright-find-copyright when searching from the endLars Ingebrigtsen2022-01-261-1/+3
| | | | | | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the double check also work when searching from the end (bug#7179). Do not merge to master.
| * Fix copyright.el comment and add a testLars Ingebrigtsen2022-01-261-1/+1
| | | | | | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix comment (bug#7179). Do not merge to master.
| * Fix memory-report-object-size to initialize memory-report--type-sizeSergey Vinokurov2022-01-211-1/+1
| | | | | | | | | | | | | | * lisp/emacs-lisp/memory-report.el (memory-report-object-size): Allow using function directly (bug#53310). Do not merge to master.
| * * Fix native comp for non trivial function names (bug#52833)Andrea Corallo2022-01-171-1/+3
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-c-func-name): Fix native compilation for functions with function names containing non trivial characters (bug#52833). This commit is the backport of e7699bf290. Do not merge to master