summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Allow showing show-paren context in an overlayTassilo Horn2022-02-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/paren.el (show-paren-context-when-offscreen): Add new possibility `overlay'. (show-paren--context-overlay): New defvar. (show-paren--delete-context-overlay): New function. (show-paren--show-context-in-overlay): New function. (show-paren-function): Handle the new `overlay' case. * lisp/emacs-lisp/eldoc.el (eldoc-display-message-no-interference-p): There's no interference if `show-paren-context-when-offscreen' is overlay or child-frame.
* | lisp-mnt, checkdoc: Reduce run-time dependenciesStefan Monnier2022-02-072-29/+37
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mnt.el: Don't require `mail-parse` at top-level. (lm-crack-address): Require it here instead. * lisp/emacs-lisp/checkdoc.el (dired): Don't load at run-time. (checkdoc-dired): Add corresponding `declare-function`.
* | Fix eval-tests/backtrace-in-batch-mode testStefan Monnier2022-02-061-4/+5
| | | | | | | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix the zero-arg case.
* | (debug-early-backtrace): Tweak the non-evald outputStefan Monnier2022-02-061-0/+2
| | | | | | | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Make the non-evald output more like what is used in `debug.el`.
* | (debug-early-backtrace): Tweak the non-evald outputStefan Monnier2022-02-061-12/+9
| | | | | | | | | | * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Make the non-evald output more like what is used in `debug.el`.
* | Improve the elp-instrument-package doc stringLars Ingebrigtsen2022-02-061-1/+6
| | | | | | | | | | * lisp/emacs-lisp/elp.el (elp-instrument-package): Note the effect of loading further files (bug#13252).
* | Add new user option 'find-library-include-other-files'Lars Ingebrigtsen2022-02-061-7/+36
| | | | | | | | | | | | | | * lisp/emacs-lisp/find-func.el (read-library-name--find-files): New function (bug#15735). (read-library-name): Use it. (find-library-include-other-files): New user option.
* | * lisp/emacs-lisp/debug-early.el: Improve the documentationAlan Mackenzie2022-02-051-9/+19
| |
* | (with-demoted-errors): Warn on missing `format` argStefan Monnier2022-02-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `format` arg has been mandatory for a while, but the backward compatibility code that handled the case of a missing `format` arg made it hard to notice when using the old calling convention. * lisp/subr.el (with-demoted-errors): Warn on missing `format` arg. * lisp/emacs-lisp/smie.el (smie-indent--separator-outdent): Don't abuse `with-demoted-errors`. (smie-indent-line, smie-auto-fill): * test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors): * lisp/vc/vc-hooks.el (vc-refresh-state): * lisp/vc/vc-annotate.el (vc-annotate-background-mode): * lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): * lisp/textmodes/reftex-toc.el (reftex-re-enlarge): * lisp/progmodes/sh-script.el (sh-smie-sh-rules): * lisp/progmodes/octave.el (inferior-octave-startup): * lisp/pcmpl-gnu.el (pcmpl-gnu-make-all-targets): * lisp/org/org-refile.el (org-refile): * lisp/org/org-capture.el (org-capture-store-last-position): * lisp/nxml/nxml-mode.el (nxml-mode): * lisp/notifications.el (notifications-notify): * lisp/gnus/mm-view.el (mm-display-inline-fontify): * lisp/finder.el (finder-unload-function): * lisp/files.el (safe-local-variable-p, backup-buffer-copy * lisp/autorevert.el (auto-revert-notify-handler): Pass `format` arg to `with-demoted-errors`.
* | * Have `null' and `not' explicit in LIMPLE so we inline themAndrea Corallo2022-02-041-1/+3
| | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Generate explicit `eq' call in LIMPLE for LAP opcode 'not'.
* | New file lisp/emacs-lisp/debug-early.el for backtraces in early bootstrapAlan Mackenzie2022-02-021-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is also used in batch mode in general. * lisp/debug-early.el (debug-early-backtrace, debug-early): New functions. * lisp/loadup.el (top level): Load debug-early.el as first file. * src/eval.c (signal_or_quit): Remove the condition in the batch mode section of not being in dumping or bootstrap, since it is no longer needed. Test that 'debug-early's symbol-function is bound. Ensure there is enough working space in specpdl and eval_depth. (syms_of_eval): New DEFSYM for Qdebug_early. Initialise Vdebugger to Qdebug_early rather than Qnil.
* | Fix bug with M-x compile-defun in a defconst/defvarAlan Mackenzie2022-02-021-9/+9
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (compile-defun): Have symbols-with-pos-enabled bound to non-nil when the eval takes place.
* | Remove extra \= from obsoletion messageAndreas Schwab2022-02-012-5/+5
| | | | | | | | | | | | | | * lisp/emacs-lisp/eieio.el (defclass): Remove \= from obsoletion message. * lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload) (eieio-defclass-internal): Likewise.
* | (byte-compile-eval): Adjust to changes in `load-history`Stefan Monnier2022-01-312-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `function-history` patch introduced a regression which caused spurious compiler warnings. Fix it. The new code also fixes a bug in the old code, thus causing some new non-spurious warnings. Fix them as well. * lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Adjust to changes in `load-history`. * lisp/gnus/gnus-group.el (nnrss-discover-feed) (nnrss-save-server-data): Use `declare-function`. * lisp/cedet/semantic/wisent/comp.el (wisent-defcontext) (wisent-with-context): * lisp/emacs-lisp/comp.el (comp-op-case): Silence compiler warning.
* | Factor out function to check for clang in testsStefan Kangas2022-01-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also stops a flymake test from failing on my machine. * lisp/emacs-lisp/ert-x.el (ert-gcc-is-clang-p): New function factored out from ... * test/lisp/progmodes/flymake-tests.el (flymake-tests--gcc-is-clang): * test/lisp/cedet/semantic/bovine/gcc-tests.el (semantic-gcc-test-output-parser-this-machine): ... here. * test/lisp/progmodes/flymake-tests.el (different-diagnostic-types) (included-c-header-files): * test/lisp/cedet/semantic/bovine/gcc-tests.el (semantic-gcc-test-output-parser-this-machine): Use above new function.
* | Fix with-suppressed-warnings edebug specLars Ingebrigtsen2022-01-311-1/+1
| | | | | | | | | | * lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Fix edebug spec.
* | package.el: Fix bug#53529Stefan Monnier2022-01-291-1/+2
| | | | | | | | | | * lisp/emacs-lisp/package.el (package-autoload-ensure-default-file): Enforce Unix EOLs.
* | Reduce code duplication in parts of (auto)load&defaliasStefan Monnier2022-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/data.c (defalias): New function, extracted from `Fdefalias`. (Fdefalias): Use it. (Ffset): Don't handle `Vautoload_queue` here, handle it in `defalias` instead. * src/comp.c (comp--register-subr): Use `defalias` instead of duplicating its code. * src/eval.c (load_with_autoload_queue): New function, extracted from `Fautoload_do_load`. (Fautoload_do_load): Use it. (un_autoload): Mark it as static. * src/fns.c (Frequire): Use it as well. * src/lisp.h (defalias, load_with_autoload_queue): New declarations. (un_autoload): Remove declaration.
* | Fix copyright-fix-years, use a dash to separate years in a rangeLele Gaifax2022-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7a46fa9c751f7c3147cd9b27fe84c1ce25419d3b, allowing en-dash as years separator, changed the way the years range is composed taking the separator from the `sep' variable instead of always using an hardwired hyphen. Since the code explicitly avoid to touch (that is, extend) existing ranges, that `sep' variable is almost always a space, or whatever character precedes the last parsed year, thus generating a range like "2020 2022" instead of "2020-2022". * lisp/emacs-lisp/copyright.el (copyright-fix-years): Always use an dash to separate years in a range. * test/lisp/emacs-lisp/copyright-tests.el (with-copyright-fix-years-test): (copyright-fix-years-tests--data): (text-copyright-fix-years): New test cases (bug#53597).
* | * Have `benchmark-run-compiled' use the native compiler when availableAndrea Corallo2022-01-271-1/+5
| | | | | | | | | | * lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Use native compiler when available.
* | 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).
* | 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).
* | * `batch-byte+native-compile' produce .eln younger than .elc (bug#52912)Andrea Corallo2022-01-251-6/+11
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (batch-native-compile): Add return value. (batch-byte+native-compile): Touch the produced .eln after the corresponding .elc is produced.
* | * lisp/emacs-lisp/comp.el (batch-byte+native-compile): Fix unwind formAndrea Corallo2022-01-251-2/+2
| |
* | Don't mutate literals in tabulated-list-widen-current-columnLars Ingebrigtsen2022-01-251-0/+3
| | | | | | | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-widen-current-column): Avoid mutating constants (bug#53501).
* | Fix widening some columns in tabulated-list-widen-current-columnLars Ingebrigtsen2022-01-251-1/+4
| | | | | | | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-widen-current-column): Don't bug out on list-based columns (bug#53498).
* | Remove some dubious uses of `interactive-form`Stefan Monnier2022-01-241-3/+3
| | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): `commandp` and `interactive-form` are for function values, not for source code. * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym->tag): Prefer `commandp` over `interactive-form`.
* | Allow jumping to ert failure definitionsLars Ingebrigtsen2022-01-242-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-test): (ert-deftest): Store the file name. (ert-test-location): New function. (ert-run-tests-batch): Use it. * lisp/emacs-lisp/find-func.el (find-ert-deftest-regexp): New variable. (find-function-regexp-alist): Add ert-deftest (bug#22471). Based on code by Phillip Lord <phillip.lord@russet.org.uk>.
* | ; * lisp/emacs-lisp/byte-opt.el: Remove outdated commentsMattias EngdegÄrd2022-01-241-116/+2
| | | | | | | | | | These were optimisation ideas that have been implemented, have become irrelevant, or were impractical to begin with.
* | Remove the unused unbind-all bytecodeMattias EngdegÄrd2022-01-242-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It was implemented but never generated, originally intended for TCO in the pre-lexbind era (which was semantically dubious anyway). Removing it speeds up the interpreter because there is no longer any need for the outermost `count` variable unless checking is enabled. * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): * src/bytecode.c (BYTE_CODES, exec_byte_code): Remove definition and implementation of unbind-all, freeing up the opcode for other purposes.
* | Expunge read-with-symbol-position and read-symbol-positions-listAlan Mackenzie2022-01-241-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | These are remnants of the old way of determining byte compiler warning positions. * src/lread.c (read_internal_start, read1): Remove initializations amd manipulations of these variables. (syms_of_lread): Remove the declarations of the variables. * lisp/emacs-list/bytecomp.el (compile-defun, byte-compile-from-buffer): Remove bindings of the variables.
* | Bind print-symbols-bare to t in byte-compile-from-bufferAlan Mackenzie2022-01-231-6/+7
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Bind print-symbols-bare to t here for the benefit of non-defining forms in buffers.
* | Fix tabulated-list-widen-current-column widening wrong columnThuna2022-01-231-11/+11
| | | | | | | | | | | | | | | | * tabulated-list.el (tabulated-list-widen-current-column): Use correct comparison operation when checking if point is within the column bounds (bug#53375). Copyright-paperwork-exempt: yes
* | Fix position argument to macroexp--warn-wrap in cconv--convert-funcbodyAlan Mackenzie2022-01-231-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): Change the position argument to macroexp--warn-wrap from BODY to ARG, to give correct positions in warning messages.
* | Add new function to prompt a user for a process namePhil Sainty2022-01-231-0/+42
| | | | | | | | | | * lisp/emacs-lisp/subr-x.el (read-process-name): New function (bug#32640).
* | Don't use 'load-read-function' in byte-compile-from-bufferAlan Mackenzie2022-01-221-2/+5
| | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Call read-positioning-symbols directly, rather than binding load-read-function to it. This is so that a lower level use of load-read-function will not return a form containing symbols with position.
* | Merge branch 'scratch/correct-warning-pos'Alan Mackenzie2022-01-2214-498/+675
|\ \
| * \ Merge branch 'master' into scratch/correct-warning-posAlan Mackenzie2022-01-229-189/+687
| |\ \
| * | | Miscellaneous amendments to the scratch/correct-warning-pos branchAlan Mackenzie2022-01-221-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/fw.el (semantic-alias-obsolete) (semantic-varalias-obsolete): Replace calls to byte-compile-warn with calls to byte-compile-warn-x (when it exists). * lisp/emacs-lisp/bytecomp.el (byte-compile-log-warning-function) (byte-compile--log-warning-for-byte-compile): Make the POSITION parameter no longer &optional (for the benefit of flymake on *.el). (byte-compile-log-warning): Replace a nil POSITION argument with an actual position. (byte-compile-file-form-require): Push the required symbol onto byte-compile-form-stack, for the benefit of `do-after-load-evaluation'. * lisp/keymap.el (define-keymap--compile): Replace four calls to byte-compile-warn with byte-compile-warn-x. * doc/lispref/elisp.texi (master menu): Add entries for Shorthands and Symbols with position. * doc/lispref/streams.texi (Input Functions): Document read-positioning-symbols. * doc/lispref/symbols.texi (Symbols): Add new menu entry. (Symbols with Position): New @section.
| * | | Remove the remnants of old position mechanism from scratch/correct-warning-posAlan Mackenzie2022-01-153-123/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also correct one or two positions in macroexp-warn-and-return invocations. * lisp/emacs-lisp/bytecomp.el (byte-compile-read-position) (byte-compile-last-position, byte-compile-set-symbol-position): Remove. (byte-compile-warning-prefix, byte-compile-function-warn) (byte-compile-emit-callargs-warn, byte-compile-arglist-warn) (byte-compile-warn-about-unresolved-functions, compile-defun) (byte-compile-from-buffer, byte-compile-from-buffer) (byte-compile-file-form-defmumble, byte-compile-check-lambda-list) (byte-compile-lambda, byte-compile-form, byte-compile-normal-call) (byte-compile-check-variable, byte-compile-push-constant) (byte-compile-subr-wrong-args, byte-compile-negation-optimizer) (byte-compile-condition-case, byte-compile-defvar, byte-compile-autoload) (byte-compile-lambda-form): Remove the remnants of the old warning position mechanism. (byte-compile-function-warn): Replace byte-compile-last-position by a symbol-with-pos-pos call. (compile-defun): Use local variable start-read-position to fulfil purpose of old byte-compile-read-position. Push the just read FORM onto byte-compile-form-stack. * lisp/emacs-lisp/eieio.el (defclass): New mechanism to get the correct source warning position to macroexp-warn-and-return. * lisp/emacs-lisp/macroexp (macroexp--unfold-lambda): Correct the position argument given to macroexp-warn-and-return.
| * | | Merge branch 'master' into scratch/correct-warning-posAlan Mackenzie2022-01-145-11/+25
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge branch: commit d29291d665e808307126bf52c3e748fef78f0f9c (HEAD -> master, origin/master, origin/HEAD) Author: Stefan Monnier <monnier@iro.umontreal.ca> Date: Fri Jan 14 12:26:30 2022 -0500 (macroexp--expand-all): Fix bug#53227 and bug#46636
| * | | | Commit fixes and enhancements to the scratch/correct-warning-pos branchAlan Mackenzie2022-01-145-290/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer strip positions from symbols before each use of a form, instead relying on the low level C routines to do the right thing. Instead strip them from miscellaneous places where this is needed. Stip them alson in `function-put'. Push forms onto byte-compile-form-stack and pop them "by hand" rather than by binding the variable at each pushing, so that it will still have its data after an error has been thrown and caught by a condition case. This gives an source position to the ensuing error message. * lisp/emacs-lisp/byte-run.el (byte-run--ssp-seen, byte-run--circular-list-p) (byte-run--strip-s-p-1, byte-run-strip-symbol-positions): New functions and variables, which together implement stripping of symbol positions. The latest (?final) version modifies the argument in place rather than making a copy. (function-put): Strip symbol positions from all of the arguments before doing the `put'. * lisp/emacs-lisp/bytecomp.el (byte-compile--form-stack): has been renamed to byte-compile-form-stack and moved to macroexp.el. (byte-compile-initial-macro-environment (eval-and-compile)): Replace macroexpand-all-toplevel with macroexpand--all-toplevel. (displaying-byte-compile-warnings): bind byte-compile-form-stack here. (byte-compile-toplevel-file-form, byte-compile-form): Push the top level form onto byte-compile-form-stack (whereas formally the variable was bound at each pushing). Manually pop this from of the variable at the end of the function. * lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro): Remove the symbol stripping. * lisp/emacs-lisp/comp.el (comp--native-compile): Set max-specpdl-size to at least 5000 (previously it was 2500). Bind print-symbols-bare to t. * lisp/emacs-lisp/macroexp.el (byte-compile-form-stack): Definition move here from bytecomp.el for easier compilation. (byte-compile-strip-symbol-positions and associated functions): Removed. (macro--expand-all): push argument FORM onto byte-compile-form-stack at the start of this function, and pop it off at the end. (internal-macroexpand-for-load): No longer strip symbol positions. Bind symbols-with-pos-enabled and print-symbols-bare to t. * lisp/help.el (help--make-usage): Strip any position from argument ARG. * src/fns.c (Fput): No longer strip symbol positions from any of the arguments.