Commit graph

7540 commits

Author SHA1 Message Date
Andrea Corallo
b064ddd3f6 Merge remote-tracking branch 'savannah/master' into native-comp 2021-04-13 12:06:23 +02:00
Andrea Corallo
70adc28e97 * lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): (not null) => t. 2021-04-13 12:05:33 +02:00
Andrea Corallo
3062480309 * lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Remove duplicates. 2021-04-13 12:05:33 +02:00
Stefan Monnier
214dfbfea0 Don't version-control generated file grammat-wy.el
This file is needed for CEDET's bootstrap, tho, so we now keep a copy of it
under version control in `gram-wy-boot.el`, very much like we do with
the `ldefs-boot.el` copy of `loaddefs.el`.

* lisp/cedet/semantic/grm-wy-boot.el: Rename from
`lisp/cedet/semantic/grammar-wy.el`.

* lisp/cedet/semantic/grammar.el: Load `grm-wy-boot.el` if
`grammar-wy.el` hasn't been generated yet.

* admin/update_autogen: Also refresh `grm-wy-boot.el`.

* admin/grammars/Makefile.in (WISENT): Add `grammar-wy.el` to the
generated files.

* .gitignore: Add `grammar-wy.el`.
2021-04-12 22:10:38 -04:00
Stefan Monnier
f63da590fd * lisp/emacs-lisp/smie.el: Fix URL. Remove redundant :group args
(smie-indent-forward-token): Improve error message.
(smie--funcall): New function.
(smie-indent-calculate): Use it.
2021-04-12 13:01:06 -04:00
Stefan Monnier
c42dc493d1 * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Simplify 2021-04-12 12:55:52 -04:00
Stefan Monnier
be75b08f82 * lisp/emacs-lisp/float-sup.el (pi): Actually mark it as obsolete 2021-04-12 12:53:53 -04:00
Stefan Monnier
0e2cf3b985 * lisp/emacs-lisp/edebug.el (edebug--frame): Move docstring where it belongs 2021-04-12 12:51:28 -04:00
Stefan Monnier
6bec60ad31 (define-minor-mode): Warn about use of pre-Emacs-21 style args
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
Use `advertised-calling-convention` to avoid promoting the old
style arguments.  Emit a wanring when old-style arguments are used.
Massage the docstring accordingly.
* doc/lispref/modes.texi (Defining Minor Modes): Document the keyword
arguments rather than the old-style positional arguments.
2021-04-12 11:08:19 -04:00
Stefan Monnier
c45bfd3c4a * lisp/**/*.el: Avoid positional args to define-minor-mode
Back in Emacs-21.1, `define-minor-mode` grew keywords arguments to
replace its old positional arguments.  Let's make sure we don't use
the old-style any more.

* lisp/org/ox-beamer.el (org-beamer-mode-map): Move initialization
into declaration.
(org-beamer-mode):
* lisp/textmodes/tildify.el (tildify-mode):
* lisp/textmodes/sgml-mode.el (html-autoview-mode):
* lisp/textmodes/rst.el (rst-minor-mode):
* lisp/textmodes/remember.el (remember-notes-mode):
* lisp/textmodes/ispell.el (ispell-minor-mode):
* lisp/tar-mode.el (tar-subfile-mode):
* lisp/strokes.el (strokes-mode):
* lisp/so-long.el (so-long-minor-mode):
* lisp/shell.el (shell-dirtrack-mode):
* lisp/scroll-all.el (scroll-all-mode):
* lisp/ruler-mode.el (ruler-mode):
* lisp/rect.el (rectangle-mark-mode):
* lisp/progmodes/sh-script.el (sh-electric-here-document-mode):
* lisp/outline.el (outline-minor-mode):
* lisp/org/org.el (org-cdlatex-mode):
* lisp/org/org-table.el (org-table-header-line-mode)
(org-table-follow-field-mode, orgtbl-mode):
* lisp/org/org-src.el (org-src-mode):
* lisp/org/org-list.el (org-list-checkbox-radio-mode):
* lisp/org/org-indent.el (org-indent-mode):
* lisp/org/org-capture.el (org-capture-mode):
* lisp/obsolete/pc-select.el (pc-selection-mode):
* lisp/obsolete/iswitchb.el (iswitchb-mode):
* lisp/net/rcirc.el (rcirc-omit-mode, rcirc-multiline-minor-mode)
(rcirc-track-minor-mode):
* lisp/net/goto-addr.el (goto-address-mode, goto-address-prog-mode):
* lisp/image-mode.el (image-minor-mode):
* lisp/ibuf-ext.el (ibuffer-auto-mode):
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode):
* lisp/font-core.el (font-lock-mode):
* lisp/erc/erc.el (define-erc-module):
* lisp/erc/erc-track.el (erc-track-minor-mode):
* lisp/erc/erc-fill.el (erc-fill-mode):
* lisp/epa-mail.el (epa-mail-mode):
* lisp/emacs-lisp/checkdoc.el (checkdoc-minor-mode):
* lisp/dirtrack.el (dirtrack-mode, dirtrack-debug-mode):
* lisp/dired-aux.el (dired-isearch-filenames-mode):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-mode):
* lisp/cedet/semantic/decorate/mode.el (semantic-decoration-mode):
* lisp/autoarg.el (autoarg-mode, autoarg-kp-mode):
* lisp/vc/pcvs.el (cvs-minor-mode):
Avoid old-style positional args to `define-minor-mode`.
2021-04-11 23:47:14 -04:00
Mattias Engdegård
01a513bf0b Fix typo in cconv
* lisp/emacs-lisp/cconv.el (cconv-convert): Typo.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
2021-04-11 12:41:21 +02:00
Philipp Stephani
53dfd85a7f Edebug: Disable backtracking when hitting a &define keyword.
Edebug doesn't deal well with backtracking out of definitions, see
Bug#41988.  Rather than trying to support this rare situation (e.g. by
implementing a multipass parser), prevent it by adding an implicit
gate.

* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Disable
backtracking when hitting a &define keyword.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-duplicate-&define): New unit test.
(edebug-tests--duplicate-&define): New helper macro.

* doc/lispref/edebug.texi (Backtracking): Mention &define in the list
of constructs that disable backtracking.

* etc/NEWS: Document new behavior.
2021-04-10 18:19:49 +02:00
Mattias Engdegård
59342f689e Fix condition-case optimiser bug
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't
perform incorrect optimisations when a condition-case variable shadows
another lexical variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
New test case.
2021-04-09 19:20:55 +02:00
Stefan Kangas
cdd72c5d89 Don't preserve window-line in tabulated-list-print
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Don't
try to preserve window-line.  (Bug#42747)
2021-04-09 18:25:08 +02:00
Mattias Engdegård
612d731676 Self-TCO in condition-case error handlers
* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognise
`condition-case` handlers as being in the tail position.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
Extend test.
2021-04-09 10:55:37 +02:00
Andrea Corallo
1f8d75160a * Improve some docstring in comp.el
* lisp/emacs-lisp/comp.el (comp--native-compile)
	(batch-native-compile, batch-byte-native-compile-for-bootstrap):
	Improve docstring.
2021-04-07 17:33:35 +02:00
Stefan Kangas
b66e2a7b66 Clarify obsoletion messages for easy-menu-{add,remove}
* lisp/emacs-lisp/easymenu.el (easy-menu-remove, easy-menu-add):
Clarify obsoletion messages.
2021-04-07 14:33:10 +02:00
Andrea Corallo
74b58f28ec Merge remote-tracking branch 'savannah/master' into native-comp 2021-04-05 21:00:18 +02:00
Stefan Kangas
6686a31591 Remove local uniquify functions in favour of seq-uniq
* lisp/emacs-lisp/seq.el (seq-uniq): Add autoload cookie.
* lisp/pcomplete.el: (pcomplete-uniquify-list): Use seq-uniq.
* lisp/eshell/esh-util.el (eshell-uniqify-list)
(eshell-uniquify-list):
* lisp/nxml/rng-util.el (rng-uniquify-equal):
* lisp/progmodes/idlwave.el (idlwave-uniquify):
* lisp/textmodes/artist.el (artist-uniq): Make into obsolete
function aliases for seq-uniq.  Update callers.
* lisp/nxml/rng-util.el (rng-uniquify-eq): Make obsolete in favor
of seq-uniq.  Update callers.
2021-04-05 15:14:19 +02:00
Stefan Kangas
20f7fa691b Obsolete local set difference functions in favor of seq-difference
* lisp/emacs-lisp/seq.el (seq-difference): Add autoload cookie.
* lisp/gnus/gnus-range.el (gnus-set-difference):
* lisp/gnus/spam.el (spam-set-difference): Make obsolete in favor
of seq-difference.  Update callers.
2021-04-05 14:24:00 +02:00
Andrea Corallo
1ad0ecea2b * lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all .eln dirs. 2021-04-04 22:51:24 +02:00
Stefan Kangas
cd5dfa086d Replace two functions with seq-subseq
* lisp/emacs-lisp/seq.el (seq-subseq): Add autoload cookie.
* lisp/eshell/esh-util.el (eshell-sublist): Redefine using seq-subseq
and make obsolete.  Update callers.
* lisp/wid-edit.el (widget-sublist): Redefine as obsolete function
alias for seq-subseq.  Update callers.
2021-04-03 03:11:35 +02:00
Andrea Corallo
dc393517ca Issue a warning when eln look-up fails due to missing .el source file.
* lisp/emacs-lisp/comp.el (comp-warning-on-missing-source): New
	customize.
	* src/lread.c (maybe_swap_for_eln): Issue a warning when eln
	look-up fails due to missing .el source file.
	* src/comp.c (syms_of_comp): Define
	'Qcomp_warning_on_missing_source'.
2021-04-01 21:49:38 +02:00
Stefan Kangas
c59dedcdf1 Use emacs-version instead of obsolete version variables
* lisp/calendar/icalendar.el (icalendar-version):
* lisp/dframe.el (dframe-version):
* lisp/emacs-lisp/checkdoc.el (checkdoc-version):
* lisp/emulation/edt.el (edt-version):
* lisp/international/mule.el (mule-version):
* lisp/linum.el (linum-version):
* lisp/play/bubbles.el (bubbles-version):
* lisp/textmodes/remember.el (remember-version):
* lisp/url/url-vars.el (url-version):
* lisp/woman.el (woman-version): Use emacs-version instead of obsolete
version variables.
2021-04-01 01:27:38 +02:00
Andrea Corallo
8e524f4591 * lisp/emacs-lisp/comp.el (comp-final): Clean-up temporary file. 2021-03-31 20:38:32 +02:00
Andrea Corallo
53ca0d9844 Rework native compilation `comp-debug' (bug#46495)
* lisp/emacs-lisp/comp.el (comp-debug): Update docstring and
	move default on Windows systems from 0 to 1.
	* src/comp.c (Fcomp__compile_ctxt_to_file): Tweak debug
	levels.
2021-03-31 20:25:08 +02:00
Andrea Corallo
aa159bf696 * lisp/emacs-lisp/comp.el (comp-debug): Fix docstring. 2021-03-31 10:24:55 +02:00
Andrea Corallo
c6c7b30e4b Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-25 16:29:07 +01:00
Andrea Corallo
92914ade6d Improve two native compiler related docstrings.
* lisp/emacs-lisp/comp.el (comp-eln-load-path-eff): Improve docstring.
	* src/comp.c (comp-eln-load-path): Likewise.
2021-03-24 17:02:40 +01:00
Stefan Kangas
8b07994e20 Convert many more links to use HTTPS 2021-03-24 10:20:18 +01:00
Lars Ingebrigtsen
a4ececf004 Move string-trim functions to subr.el
* doc/lispref/strings.texi (Creating Strings): Document them.

* lisp/faces.el: Don't require subr-x, because that leads to build
errors.

* lisp/subr.el (string-trim, string-trim-right)
(string-trim-left): Move here from subr-x.el.

* lisp/emacs-lisp/shortdoc.el (string): Adjust.
2021-03-24 09:22:44 +01:00
Andrea Corallo
7ba816ee1c * lisp/emacs-lisp/comp.el (comp-lookup-eln): Add autoload cookie. 2021-03-21 21:55:13 +01:00
Andrea Corallo
6351953dcd * lisp/emacs-lisp/comp.el (comp-lookup-eln): Add new function. 2021-03-21 21:50:22 +01:00
Andrea Corallo
d0280ce1b1 Revert "* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all..."
This reverts commit be22cda7be.

Older binaries might still need those .eln if they where preloaded.
2021-03-21 15:34:38 +01:00
Andrea Corallo
08682ccc31 ; Remove two unnecessary quotes
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Remove unnecessary
	quote.
	* lisp/emacs-lisp/comp.el (comp-compile-ctxt-to-file): Likewise.
2021-03-21 09:28:25 +01:00
Andrea Corallo
be22cda7be * lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all .eln dirs. 2021-03-21 09:15:25 +01:00
Toby Cubitt
e33c2bfbf3 Fix cl-progv binding order
* lisp/emacs-lisp/cl-macs.el (cl-progv): Bind variables in the
correct order (bug#47272).
2021-03-20 10:01:19 +01:00
Stefan Monnier
bf210251ea * lisp/emacs-lisp/bytecomp.el: Remember location of unresolved calls
I've gotten tired of seeing the "function foo not known to be defined"
warning without any line number information.  So this patch adds as
line number the position of the first use of that function in the file
(well, approximately, as usual).

(byte-compile-unresolved-functions): Add POSITIONs in the alist.
(byte-compile-function-warn): Store the current position in
`byte-compile-unresolved-functions`.
(byte-compile-arglist-warn): Adjust accordingly.
(byte-compile-print-syms): Delete unused function.
(byte-compile-warn-about-unresolved-functions): Use the stored position
to give more precise warnings.
2021-03-19 18:33:46 -04:00
Stefan Monnier
937b6c18bd * lisp/emacs-lisp/pcase.el (pcase-compile-patterns): New function (bug#47261)
Extracted from `pcase--expand`.
(pcase--expand): Use it.
2021-03-19 17:42:22 -04:00
Andrea Corallo
6ca6c71cd0 Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-19 15:28:00 +01:00
Stefan Monnier
b815445cea Fix copyright lines mistakenly treated as outline headers
* lisp/emacs-lisp/generator.el:
* test/lisp/cedet/semantic-utest.el:
* test/lisp/cedet/semantic/format-tests.el:
* test/lisp/cedet/semantic/fw-tests.el:
* test/lisp/cedet/semantic/bovine/gcc-tests.el:
* test/lisp/cedet/semantic/format-resources/test-fmt.el:
* test/manual/cedet/semantic-tests.el:
* lisp/obsolete/inversion.el: Use only 2 semi-colons before "Copyright".
2021-03-18 23:32:57 -04:00
Stefan Monnier
236aad4f8c * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Optimize the "return nil" case 2021-03-18 17:54:43 -04:00
Mattias Engdegård
52270aa0dc Optimise tail calls in and and or forms in cl-labels functions
* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Handle `and` and `or`.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
Add test cases.
2021-03-18 13:35:55 +01:00
Lars Ingebrigtsen
4eb0303197 Compute chart-face-list dynamically
* lisp/emacs-lisp/chart.el (chart-face-list): Allow a function as
the value (bug#47133) so that we can compute the faces dynamically
on different displays.
(chart--face-list): New function.
(chart-draw-data): Use it.
2021-03-18 11:15:50 +01:00
Lars Ingebrigtsen
21e1a126b5 Make memory-report work with buffer-local unbound vars
* lisp/emacs-lisp/memory-report.el (memory-report--buffer-data):
Protect against buffer-local unbound variables (bug#47057).
2021-03-18 08:33:40 +01:00
Stefan Monnier
82c3bd1e4a * lisp/emacs-lisp/benchmark.el (benchmark-call): New function
(benchmark-run, benchmark-run-compiled, benchmark): Use it.
(benchmark--adaptive): New internal function.
2021-03-17 19:04:28 -04:00
Andrea Corallo
3e133cc050 Fix `no-byte-compile' native compilation interaction (bug#47169)
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Throw
	no-native-compile when `byte-native-qualities' are null.
	* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): No need
	to consider `no-byte-compile'.
2021-03-16 19:02:57 +01:00
Andrea Corallo
f3abb17118 Have no-byte-compile' implies also no-native-compile'.
* lisp/emacs-lisp/comp.el (no-native-compile): Update doctring.
	* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): when
	`no-byte-compile' is set to non-nil it overrides this.
2021-03-16 09:12:46 +01:00
Eli Zaretskii
6810635bdd * lisp/emacs-lisp/byte-opt.el: Fix native re-compilation (bug#47161). 2021-03-15 19:24:20 +02:00
Andrea Corallo
7f74ed4912 * lisp/emacs-lisp/bytecomp.el: Fix native re-compilation (bug#47161). 2021-03-15 16:46:16 +01:00