Commit graph

7514 commits

Author SHA1 Message Date
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
Eli Zaretskii
aabda4263b Prefer expand-file-name to concat in native-compilation code
* lisp/emacs-lisp/comp.el (comp-eln-load-path-eff):
* src/comp.c (Fcomp_el_to_eln_filename)
(eln_load_path_final_clean_up): Prefer expand-file-name to concat.
(Bug#43725)
2021-03-15 16:56:08 +02:00
Gabriel do Nascimento Ribeiro
2d12df3926 Init archive and add noconfirm to 'package-install-selected-packages'
* lisp/emacs-lisp/package.el (package-install-selected-packages):
Add call to 'package--archives-initialize' and add optional argument
NOCONFIRM to skip user confirmation when installing packages.  (Bug#47124)
2021-03-15 03:09:02 +01:00
Andrea Corallo
5e4ec4d3c9 Fix some entry in `comp-known-type-specifiers' (bug#46847)
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Some
	fix.
	* test/src/comp-tests.el (comp-tests-46670-1): Update test.
2021-03-14 22:05:02 +01:00
Andrea Corallo
d018584814 * Fix circular dependecy when loading a modified comp.el (bug#47049)
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Move it
	before other functional code.
2021-03-12 22:35:23 +01:00
Glenn Morris
1feddd35ab Merge from origin/emacs-27
02a5cfce47 (origin/emacs-27) * lisp/mouse.el: Fix mouse-1-clock-follo...
c881e990e3 * lisp/emacs-lisp/gv.el (edebug-after): Don't run the gett...
2021-03-12 08:47:41 -08:00
Andrea Corallo
82bd6d57d5 Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-12 16:42:51 +01:00
Andrea Corallo
d9cd55a4f1 Implement `no-native-compile' (bug#46983)
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Capture
	`no-native-compile'.
	* lisp/emacs-lisp/comp.el (no-native-compile): Define new
	variable.
	(comp-spill-lap-function): Throw when `no-native-compile' was
	captured non-nil.
	(comp--native-compile): Catch `no-native-compile' if necessary and
	return nil in case.
2021-03-12 13:11:45 +01:00
Mattias Engdegård
a0854f939c ; Fix typos in doc strings 2021-03-12 12:12:14 +01:00
Andrea Corallo
0144764d1d * Fix error reporting for async native compilation (bug#47024)
* lisp/emacs-lisp/comp.el (comp--native-compile): During async
	compilation if we catch an error print it in a parsable way so we
	can report it to the user.
2021-03-12 10:03:09 +01:00
Stefan Monnier
ba6ae500f1 * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Simplify (doh!) 2021-03-11 22:31:39 -05:00
Stefan Monnier
009bc7c9d8 * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Tune down the warning
Don't warn for always-nil bindings if the binding is made explicit.
Fixes bug#47080.
2021-03-11 22:27:41 -05:00
Stefan Monnier
7109307c1a * lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Use macroexp-let2
This also silences the recently introduced compilation warning.
2021-03-11 21:47:10 -05:00
Lars Ingebrigtsen
d0125959d7 Make byte-compiled uses of `define-minor-mode' more compatible
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Be more
defensive about accessing minor mode variables.
2021-03-12 00:41:54 +01:00
Stefan Monnier
b21f6193fe * lisp: Remove yet more always-nil variables
* lisp/align.el (align-region):
Remove always-nil variable `group-c`.
* lisp/ido.el (ido-make-prompt): Remove always-nil variable `prefix`.

* lisp/xdg.el (xdg-mime-collect-associations):
Remove always-nil variable `end`.

* lisp/calc/calc-yank.el (calc-edit):
Remove always-nil variable `flag`.

* lisp/calendar/todo-mode.el (todo-edit-item--header):
Remove always-nil variable `dayname`.
(todo-show-categories-table):
Remove always-nil variable `sortkey`.

* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-docstring-engine):
Remove always-nil variable `err`.

* lisp/emacs-lisp/tcover-ses.el: Remove always-nil variable `pause`.

* lisp/eshell/em-ls.el (eshell-ls-files):
Remove always-nil variable `ignore`.

* lisp/net/ange-ftp.el (ange-ftp-copy-file-internal): Remove always-nil
variable `temp2`.

* lisp/progmodes/cperl-mode.el (cperl-tags-hier-init): Remove
always-nil variables `l1`, `l2`, `l3`.
(cperl-tags-treeify): Remove always-nil variable `l1`.

* lisp/progmodes/ebrowse.el (ebrowse-tags-read-member+class-name):
Remove always-nil variable `class`.

* lisp/textmodes/artist.el (artist-draw-ellipse-with-0-height):
Remove always-nil variable `fill-info`.

* lisp/textmodes/flyspell.el (flyspell-emacs-popup):
Remove always-nil variable `show-affix-info`.

* lisp/textmodes/rst.el (rst-Ado):
Remove always-nil variable `char`.

* lisp/vc/vc.el (vc-diff-build-argument-list-internal):
Remove always-nil variable `rev2-default`.
2021-03-11 13:29:14 -05:00
Stefan Monnier
e13c30132a * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Warn never-initialized vars
(byte-compile-not-lexical-var-p): Remove Emacs<24 compatibility.
2021-03-11 13:01:59 -05:00
Lars Ingebrigtsen
4b47eb32c6 Fix byte-compilation warning in benchmark-run
* lisp/emacs-lisp/benchmark.el (benchmark-run): Avoid a
byte-compilation warning about an empty let body (bug#46819).
2021-03-10 15:52:54 +01:00
Andrea Corallo
fe1c081c38 * Fix truncated warnings (bug#47024)
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Bind
	`warning-fill-column' to `most-positive-fixnum'.
2021-03-10 15:50:58 +01:00
Mattias Engdegård
7add330903 Mark string predicates side-effect-free
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add string>,
string-greaterp, string-empty-p, string-prefix-p, string-suffix-p
and string-blank-p, all recently marked pure.
2021-03-10 14:08:41 +01:00
Stefan Kangas
4cb52200cb Fix duplicate ":" in ert-find-test-other-window prompt
* lisp/emacs-lisp/ert.el (ert-find-test-other-window): Don't insert
duplicate ":" in prompt.
2021-03-10 04:34:53 +01:00
Stefan Kangas
dc2688acb3 Do mode tagging in ert.el 2021-03-10 04:34:32 +01:00
Stefan Monnier
7561c01380 * lisp/emacs-lisp/cconv.el: Don't confuse a string for a docstring
(cconv--convert-funcbody): Check there's something after a docstring.

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-string-vs-docstring):
New corresponding test.
2021-03-09 11:04:03 -05:00
Andrea Corallo
43b0df62cd Merge commit '9cbdf20316' into native-comp 2021-03-09 10:03:47 +01:00
Philipp Stephani
f4452bb814 Fix structure of condition object in nested 'ert-fail'.
See the test 'ert-test-fail' for the expected structure.

* lisp/emacs-lisp/ert.el (ert--should-signal-hook): Condition list
should be (SYMBOL . DATA), not (SYMBOL DATA).
* test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Fix
unit test.
2021-03-08 14:30:24 +01:00
Mauro Aranda
a01166562c Make checkdoc--next-docstring use the doc-string-elt property
This follows from a fix for Bug#46918 and a discussion to use
doc-string-elt:
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00232.html

* lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Check for a
non-nil doc-string-elt property, instead of hard-coding the
supported symbols.  Use that property to position point at the
doc-string.
2021-03-08 08:12:23 -03:00
Stefan Kangas
0e4a2dca83 Normalize version specifiers for make-obsolete and friends
* lisp/auth-source.el (auth-source-forget-user-or-password)
(auth-source-user-or-password, auth-source-hide-passwords):
* lisp/calendar/icalendar.el (icalendar--datetime-to-noneuropean-date):
* lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym-function-arglist):
* lisp/emacs-lisp/debug.el (debugger-insert-backtrace):
* lisp/obsolete/nnir.el (nnir-swish-e-index-file):
* lisp/obsolete/starttls.el (starttls-any-program-available):
Normalize version specifiers for make-obsolete and friends.
2021-03-08 05:09:27 +01:00
Stefan Monnier
251dea693a * lisp/emacs-lisp/bytecomp.el: Warn about unprefixed vars in boundp
(byte-compile--check-prefixed-var): New fun,
extracted from `byte-compile--declare-var`.
(byte-compile--declare-var): Use it.
(byte-compile-maybe-guarded): Use it as well.
2021-03-07 19:00:47 -05:00