Commit graph

6685 commits

Author SHA1 Message Date
Nicolás Bértolo
d59607b685 * Windows: Use NUMBER_OF_PROCESSORS environment variable.
* lisp/emacs-lisp/comp.el (comp-effective-async-max-jobs): Use
NUMBER_OF_PROCESSORS environment variable if system is Windows NT,
"nproc" if it is in PATH or a default of 1.
2020-05-23 09:36:52 +01:00
Nicolás Bértolo
60b326ef11 * Workaround the 32768 chars command line limit in Windows.
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Pass the
compilation commands through a temporary file that is loaded by the
child process. This is also done all other operating systems, even
those that support long command lines. It should not be a problem
since libgccjit uses temporary files too.
2020-05-23 09:36:52 +01:00
Andrea Corallo
f5ba60defb * lisp/emacs-lisp/comp.el (comp-num-cpus): Fix definition.
Introduced by 2aec16ab75.
2020-05-19 08:43:38 +01:00
Andrea Corallo
2aec16ab75 * Pacify with the byte-compiler
* lisp/emacs-lisp/comp.el (comp-num-cpus): New special variable.
	(comp-effective-async-max-jobs): Make use of `comp-num-cpus'.
	(comp-call-optim-form-call): Remove unnecessary parameter.
	(comp-call-optim-func): Reflect `comp-call-optim-form-call'
	parameter removal.
2020-05-18 21:04:36 +01:00
Andrea Corallo
2ac6194585 * Add new customize `comp-async-env-modifier-form' (Bug#40838)
* lisp/emacs-lisp/comp.el (comp-async-env-modifier-form): New
	customize.
	(comp-run-async-workers): Make use of `comp-async-env-modifier-form'.
2020-05-18 21:04:36 +01:00
Andrea Corallo
6d850b50c5 * Make the Evil happy (Bug#41374)
* lisp/emacs-lisp/comp.el (comp-never-optimize-functions):
	Blacklist all primitives advised by evil-mode from trampoline
	optimization.
	(comp-call-optim-form-call): Prevent trampoline optimization for
	recursive calls at speed 2 to respect elisp original semantic.
2020-05-18 19:19:05 +01:00
Andrea Corallo
cd4ef52c86 Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-17 22:49:02 +01:00
Paul Eggert
c7bc28bf03 Don’t attempt to modify constant conses
From a patch privately suggested by Mattias Engdegård on 2020-05-11
in a followup to Bug#40671.
* admin/charsets/cp51932.awk:
* admin/charsets/eucjp-ms.awk:
Generate code that does not modify constant conses.
* doc/misc/emacs-mime.texi (Encoding Customization):
* lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops):
* lisp/frameset.el (frameset-persistent-filter-alist):
* lisp/gnus/gnus-sum.el (gnus-article-mode-line-format-alist):
Use append instead of nconc.
* lisp/language/japanese.el (japanese-ucs-cp932-to-jis-map)
(jisx0213-to-unicode):
Use mapcar instead of mapc.
* lisp/language/lao-util.el (lao-transcription-consonant-alist)
(lao-transcription-vowel-alist):
* lisp/language/tibetan.el (tibetan-subjoined-transcription-alist):
Use copy-sequence.
* test/src/fns-tests.el (fns-tests-nreverse):
(fns-tests-sort, fns-tests-collate-sort)
(fns-tests-string-version-lessp, fns-tests-mapcan):
Use copy-sequence, vector, and list.
2020-05-16 17:05:37 -07:00
Andrea Corallo
d6f6353cfd * Do not refuse to compile if a dynamic lambda is encountered
* lisp/emacs-lisp/comp.el (comp-lex-byte-func-p): New subst.
	(comp-intern-func-in-ctxt): Do not crash if we still encounter a
	non lexical scoped lambda.
2020-05-15 20:06:49 +01:00
Andrea Corallo
9a64585c12 * Allow for logging async compilation command line
* lisp/emacs-lisp/comp.el (comp-run-async-workers): When non zero
	verbose log async compilation command line invocation.
2020-05-15 20:06:49 +01:00
Andrea Corallo
e351a12216 Sanity check on lambdas fixups
* src/pdumper.c (dump_do_dump_relocation): While fixing up lambda
	relocation verify placeholder coherency.

	* src/comp.c (syms_of_comp): Define symbol 'lambda-fixup'.

	* lisp/emacs-lisp/comp.el (comp-finalize-container): Leave a
	lambda-fixup as placeholder in the relocation as a sanity check.
2020-05-15 20:06:49 +01:00
Andrea Corallo
2b064c780c * Fix speed 2 bootstrap
(comp-call-optim-func): Do nothing if the function name is
	unknown.
2020-05-15 20:06:49 +01:00
Andrea Corallo
44b0ce6e38 Add anonymous lambdas reload mechanism
* src/pdumper.c (dump_do_dump_relocation): Initialize
	'lambda_gc_guard' while resurrecting.
	(dump_do_dump_relocation): Revive lambdas and fixup them.

	* src/comp.h (struct Lisp_Native_Comp_Unit): Define new
	'lambda_gc_guard' 'lambda_c_name_idx_h' 'data_imp_relocs'
	'loaded_once' fields.

	* src/comp.c (load_comp_unit): Use compilaiton unit 'loaded_once'
	field.
	(make_subr, Fcomp__register_lambda): New functions.
	(Fcomp__register_subr): Make use of 'make_subr'.
	(Fnative_elisp_load): Indent.
	(Fnative_elisp_load): Initialize 'lambda_gc_guard'
	'lambda_c_name_idx_h' fields.
	(syms_of_comp): Add Scomp__register_lambda.

	* lisp/emacs-lisp/comp.el (comp-ctxt): Change
	'byte-func-to-func-h' hash key test.
	(comp-ctxt): Add 'lambda-fixups-h' slot.
	(comp-emit-lambda-for-top-level): New function.
	(comp-finalize-relocs): Never emit lambdas in pure space.
	(comp-finalize-relocs): Fixup relocation indexes.
2020-05-15 20:06:49 +01:00
Andrea Corallo
2ee2fb5a86 * Prune now unnecessary byte-code objects
* lisp/emacs-lisp/comp.el (comp-finalize-container): Prune
	byte-code that was lambdas.
	(comp-compile-ctxt-to-file): Remove fixme.
2020-05-14 21:50:32 +01:00
Andrea Corallo
c12831a6b6 * Rework comp-spill-lap-function
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Move code
	from to comp-intern-func-in-ctxt.
	(comp-intern-func-in-ctxt): New function, this guard
	in case byte-to-native-lambda-byte-func is nil.
2020-05-14 21:50:32 +01:00
Andrea Corallo
a335f7eeac Update spill LAP machinery and compile anonymous lambdas
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Make use of
	byte-to-native-lambdas-h and update for 'byte-to-native-func-def'.
	(comp-spill-lap-function): Rework logic to retrive LAP using
	'byte-to-native-lambdas-h'.
	(comp-emit-for-top-level): Update for 'byte-to-native-function'.

	* lisp/emacs-lisp/bytecomp.el: Add commentary on new spill LAP
	mechanism.
	(byte-to-native-lambda, byte-to-native-func-def): New structures.
	(byte-to-native-top-level): Indent.
	(byte-to-native-lambdas-h): Update doc.
	(byte-compile-lapcode): Add a 'byte-to-native-lambda' instance
	into byte-to-native-lambdas-h instead of just LAP.
	(byte-compile-file-form-defmumble): Store into
	'byte-to-native-func-def' only the byte compiled function, the LAP
	will be retrived through 'byte-to-native-lambdas-h'.
	(byte-compile-lambda): Return the byte compiled function.
2020-05-14 21:50:31 +01:00
Andrea Corallo
3bcb79fdcd Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-14 07:14:23 +01:00
João Távora
9ebf51999c Turn Eldoc, Xref and Project into GNU ELPA :core packages
The new packages state they require Emacs 26.3 to function, but a
small part of project.el breaks this "soft" rule: the two functions
requiring fileloop.el are incompatible with Emacs 26.3.

* lisp/jsonrpc.el: Tweak comment near Package-Requires.

* lisp/emacs-lisp/eldoc.el: Add Version and Package-Requires.

* lisp/progmodes/flymake.el: Add comment near Package-Requires.

* lisp/progmodes/project.el: Add Version and Package-Requires.

* lisp/progmodes/xref.el: Add Version and Package-Requires.
2020-05-13 11:31:35 +01:00
Stefan Monnier
45fa5e9724 * lisp/emacs-lisp/syntax.el: Fix bug#41195
Allow use of `syntax-ppss-flush-cache` in `syntax-propertize-function`.

(syntax-propertize--inhibit-flush): New var.
(syntax-propertize): Bind it.
(syntax-ppss-flush-cache): Test it.
2020-05-12 16:52:11 -04:00
Michael Heerdegen
3b170f04f4 Revert "Inhibit modification hooks when saving eieio-persistent's"
This reverts commit c59e878439.
2020-05-12 21:06:22 +02:00
Stefan Kangas
e6837016b0 Support sorting timer-list-mode by column (Bug#40854)
* lisp/emacs-lisp/timer-list.el (timer-list-mode)
(timer-list--idle-predicate, timer-list--next-predicate)
(timer-list--repeat-predicate)
(timer-list--function-predicate): Add support for sorting by column.
2020-05-12 19:10:20 +02:00
Stefan Kangas
ee5c5daad5 Base timer-list-mode on tabulated-list-mode (Bug#40854)
* lisp/emacs-lisp/timer-list.el (list-timers)
(timer-list-mode): Inherit from 'tabulated-list-mode' instead of
'special-mode' and make the necessary changes to support that.

* doc/lispref/os.texi (Timers): Update documentation.
2020-05-12 19:10:03 +02:00
Alan Mackenzie
dd0b910f1a Fix bug #40992 whilst still allowing breakpoint highlights in edebug
Strategy: when an instrumented function gets re-evaluated, save the former
value of its symbol's `edebug' property in the new propery `ghost-edebug'.  If
this function is still being edebugged, edebug will then access its info from
this new property.

Also fix the bug whereby compile-defun'ing an instrumented function prevents
the function being re-instrumented by I (edebug-instrument-callee).

* lisp/emacs-lisp/edebug.el (edebug-get-edebug-or-ghost): New function.
(edebug-read-and-maybe-wrap-form1): save value of `edebug' property in
'ghost-edebug'.
(edebug-make-form-wrapper): Set value of `ghost-edebug' to nil.
(edebug-make-form-wrapper, edebug-find-stop-point, edebug-next-break-point)
(edebug-modify-breakpoint, edebug--overlay-breakpoints, edebug-set-breakpoint)
(edebug-unset-breakpoints, edebug-toggle-disable-breakpoint)
(edebug--backtrace-goto-source, edebug-display-freq-count)
(edebug-set-conditional-breakpoint): Use edebug-get-edebug-or-ghost to access
edebug information.
(edebug-instrument-function): Also check a function is a cons before declaring
it "already instrumented".
2020-05-11 20:05:54 +00:00
Stefan Monnier
a69ef94e22 * lisp/emacs-lisp/pcase.el (pcase--fgrep): Look inside vectors 2020-05-11 09:53:37 -04:00
Stefan Monnier
5601eb231f * lisp/emacs-lisp/syntax.el (syntax-propertize): Use run-hook-wrapped
This way we avoid making assumptions about the content of
syntax-propertize-extend-region-functions
2020-05-11 00:15:15 -04:00
Stefan Monnier
a218c98615 * lisp/emacs-lisp/pcase.el: Don't bind unused vars in branches
(pcase--fgrep): Change calling convention to take bindings rather than
just variables.
(pcase--funcall, pcase--eval): Adjust to this new calling convention.
(pcase--expand): Use `pcase--fgrep` to bind only the vars that are used.
2020-05-10 19:07:45 -04:00
Stefan Monnier
7f7a8fbfd7 * lisp/emacs-lisp/eieio.el (eieio pcase macro): Fix last-minute typo 2020-05-10 16:17:16 -04:00
Stefan Monnier
0bb9aeddd6 * lisp/emacs-lisp/eieio.el (eieio pcase macro): Remove unused var is 2020-05-10 13:51:51 -04:00
Andrea Corallo
9bc0a7c408 * Fix `comp-deferred-compilation-black-list' effectiveness
* lisp/emacs-lisp/comp.el (native-compile-async): Fix logic for
	'comp-deferred-compilation-black-list' effectiveness.
2020-05-10 09:34:21 +01:00
Andrea Corallo
bc50c0c57e Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-09 20:04:41 +01:00
Glenn Morris
5c890bfc19 Merge from origin/emacs-27
be0d1cac83 (origin/emacs-27) Small fix for type of 'display-fill-colu...
c5e5839776 Fix customization of 'display-fill-column-indicator-charac...
d5c184aa3e Refer to fill column indicator Info node in some places.
e13300ae50 Merge branch 'emacs-27' of git.sv.gnu.org:/srv/git/emacs i...
0bae57033f Fix GTK's Tool Bar menu radio buttons
4c98aa7ea5 Minor clarifications in NEWS
a1cbd05f38 Improve documentation of 'with-suppressed-warnings'.
4a895c1b26 Fix a typo in a comment
2caf3e997e Improve documentation of Hi Lock mode
7081c1d66f Fix typos in the Emacs user manual
0385771e2f Fix references to Speedbar in VHDL mode
a76cafea0d Fix handling of FROM = t and TO = t by 'window-text-pixel-...

# Conflicts:
#	etc/NEWS
#	src/xdisp.c
2020-05-09 10:03:21 -07:00
Pieter van Oostrum
196bc13b7b Add new filter command to Package Menu (Bug#39903)
* lisp/emacs-lisp/package.el
(package-menu-filter-marked): New filter command.
* test/lisp/emacs-lisp/package-tests.el
(package-test-list-filter-marked): New test.
(package-menu-mode-menu):
(package-menu-mode-map): Update menu to include new filter command.

* doc/emacs/package.texi (Package Menu): Document the new command.
* etc/NEWS: Announce the new command.
2020-05-09 18:19:35 +02:00
Andrea Corallo
c6eb276076 Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-09 14:06:55 +01:00
Andrea Corallo
40f655e050 * Add 'comp-deferred-compilation-black-list' customize
* lisp/emacs-lisp/comp.el (comp-deferred-compilation-black-list):
	New customize.
	(native-compile-async): Make use of
	'comp-deferred-compilation-black-list'.
2020-05-09 14:06:43 +01:00
Philipp Stephani
a1cbd05f38 Improve documentation of 'with-suppressed-warnings'.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Refer to
'byte-compile-warnings' instead of 'byte-compile-warning-types', as
only the former variable documents the available warning types.
2020-05-08 22:12:07 +02:00
Zhu Zihao
39b2a598d2 Make pcase pattern 'eieio' respect slot access related functions.
* lisp/emacs-lisp/eieio.el: Make pcase pattern respect slot-missing and
slot-unbound
2020-05-08 11:08:02 -04:00
Noam Postavsky
ddc8020327 Don't increment array index in cl-loop twice (Bug#40727)
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Put the temp-idx
increment in cl--loop-body, leaving just the side-effect free testing
of the index for both cl--loop-body and cl--loop-conditions.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays):
Extend test to cover this case.
2020-05-07 08:23:56 -04:00
Noam Postavsky
de7158598f Revert "cl-loop: Calculate the array length just once"
It fails when using 'and' (parallel bindings) for arrays (Bug#40727).
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Revert to
recomputing array length.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-arrays): New
test.
2020-05-07 08:23:56 -04:00
Andrea Corallo
cf105f6044 * Fix bug#41112
* lisp/emacs-lisp/comp.el (comp-jump-table-optimizable): New
	function.
	(comp-emit-switch): Make use of 'comp-jump-table-optimizable'.
2020-05-07 10:23:10 +01:00
Andrea Corallo
f8df3320b1 * Add native compilation unit black list
* lisp/emacs-lisp/comp.el (comp-bootstrap-black-list): New customize.
	(batch-native-compile): Rework to make use of
	'comp-bootstrap-black-list'.
	(batch-byte-native-compile-for-bootstrap): Add assertion to make
	logic assumption explicit.
2020-05-06 20:11:47 +01:00
Noam Postavsky
de1b33f5a8 Revert "cl-loop: Calculate the array length just once"
Don't merge to master.  This is a safe-for-release fix for Bug#40727.
2020-05-05 21:07:58 -04:00
Noam Postavsky
caf155c463 Revert "cl-loop: Add missing guard condition"
Don't merge to master.  This is a safe-for-release fix for Bug#40727.
2020-05-05 21:07:58 -04:00
Noam Postavsky
79e133da03 Revert "Refix conditional step clauses in cl-loop"
Don't merge to master.  This is a safe-for-release fix for Bug#40727.
2020-05-05 21:07:58 -04:00
Alan Mackenzie
9f5999b08d Remove calls to non-existent functions from edebug.el.
Do not merge to master.

*lisp/emacs-lisp/edebug.el (edebug--display-1)
(edebug-toggle-disable-breakpoint): Remove calls to
edebug--overlay-breakpoints and edebug--overlay-breakpoints-removed which had
been overlooked in a recent changed to edebug.
2020-05-04 18:26:38 +00:00
Andrea Corallo
c6a610ecdc Merge remote-tracking branch 'savannah/master' into HEAD 2020-05-04 18:24:00 +01:00
Stefan Monnier
40149b8718 * lisp/emacs-lisp/eieio.el (oset, oset-default): Mark as obsolete 2020-05-03 18:05:16 -04:00
Simen Heggestøyl
7db0093bc2 Use lexical-binding in check-declare.el and add tests
* lisp/emacs-lisp/check-declare.el: Use lexical-binding.
(check-declare-warn): Silence byte compiler warning about unused
lexical argument.

* test/lisp/emacs-lisp/check-declare-tests.el: New file with tests
for check-declare.el.
2020-05-03 19:50:57 +02:00
Stefan Kangas
5f516dc944 Remove redundant :groups args missed in last commit
* lisp/emacs-lisp/cl-indent.el (lisp-lambda-list-keyword-alignment)
(lisp-lambda-list-keyword-parameter-indentation)
(lisp-lambda-list-keyword-parameter-alignment)
(lisp-indent-backquote-substitution-mode): Remove redundant :group args.
2020-05-03 16:21:51 +02:00
Stefan Kangas
d55b3b5966 Improve indentation of 'loop' forms
* lisp/emacs-lisp/cl-indent.el (lisp-loop-keyword-indentation)
(lisp-loop-forms-indentation, lisp-simple-loop-indentation): Use a
more standard indentation of 'loop' forms.  (Bug#2160)

(lisp-indent-maximum-backtracking, lisp-tag-indentation)
(lisp-tag-body-indentation, lisp-backquote-indentation)
(lisp-loop-keyword-indentation, lisp-loop-forms-indentation)
(lisp-simple-loop-indentation): Remove redundant :group args.
2020-05-03 16:19:09 +02:00
Andrea Corallo
1ec7499e59 * Add a warning for missing write privilege
* lisp/emacs-lisp/comp.el (native-compile-async): Check for write
	privilege and raise a warning in case.
2020-05-03 13:37:38 +01:00