Commit graph

7246 commits

Author SHA1 Message Date
João Távora
bba3bea247 Adjust Eldoc documentation after Eli's review
* etc/NEWS (Eldoc): Adjust paragraphs.

* lisp/emacs-lisp/eldoc.el (eldoc-prefer-doc-buffer): Adjust
docstring.
(eldoc--enthusiasm-curbing-timer, eldoc-documentation-strategy)
(eldoc-documentation-functions): Adjust docstring.
(eldoc--handle-docs): Adjust comments.
(eldoc--documentation-compose-1): New helper.
(eldoc-documentation-compose)
(eldoc-documentation-compose-eagerly): Use it.
(eldoc-print-current-symbol-info): Adjust comments.
2020-07-08 11:25:33 +01:00
João Távora
1203626f47 Make more parts of Emacs use new Eldoc capabilities
Elisp-mode was doing a lot of work that can now be delegated to Eldoc.
Flymake uses the new Eldoc functionality, too, installing a global
documentation function that may report on diagnostics under point.

CEDET's grammar.el was left as the only user of an Eldoc-internal
function.  That function was moved to grammar.el.  That file is still,
somewhat reprehensibly, using an internal function of elisp-mode.el,
but this was left unchanged.

In other situations, eldoc-documentation-functions is used or
recommended.

The only other places where the obsolete eldoc-documentation-function
is still used is in libraries which are presumably meant to remain
compatible with previous Emacs versions.

* lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall)
(elisp-eldoc-var-docstring): New functions.
(emacs-lisp-mode): Put two elements in
eldoc-documentation-functions.

* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Setup
new Elisp eldoc-documentation-functions.

* lisp/progmodes/flymake.el (flymake-mode): Use
flymake-eldoc-function.
(flymake-eldoc-function): New function.
(Package-Requires): Require eldoc 1.1.0

* lisp/descr-text.el (describe-char-eldoc): Recommend
eldoc-documentation-functions.

* lisp/progmodes/cfengine.el (cfengine3-documentation-function):
Recommend eldoc-documentation-functions

* lisp/progmodes/octave.el (inferior-octave-mode): Use
eldoc-documentation-functions.

* lisp/cedet/semantic/grammar.el (semantic--docstring-format-sym-doc):
New function.
(semantic-grammar-eldoc-get-macro-docstring): Adjust.
2020-07-08 11:25:33 +01:00
João Távora
a9bd506004 * lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0 2020-07-08 11:25:33 +01:00
João Távora
22cae4f509 New M-x eldoc for on-demand and interactive documentation requests
The function eldoc is just an alias for
eldoc-print-current-symbol-info, which is made interactive.

* lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Now an
interactive function.
(eldoc): Alias to eldoc-print-current-symbol-info.
2020-07-08 11:25:33 +01:00
João Távora
a7a53f0d79 Better handle asynchronous Eldoc sources
This is a backward compatible redesign of significant parts of the
eldoc.el library.

Previously, Eldoc clients (major/minor modes setting its documentation
gathering variables) needed to directly call eldoc-message, an
internal function, to display the docstring to the user.  When more
asynchronous sources are involved, this is hard to do or even breaks
down.

Now, an Eldoc backend may return any non-nil, non-string value and
call a callback afterwards.  This restores power to Eldoc over how
(and crucially also when) to display the docstrings to the user.

Among other things, this fixes so called "doc blinking", or the very
short-lived display of a lower priority Eldoc message.  This would
happen if a particular producer of documentation finishes shortly
before a higher priority one, like in the LSP engine Eglot as reported
by Andrii Kolomoiets <andreyk.mad@gmail.com> and Dmitry Gutov
<dgutov@yandex.ru>.

Gathering docstrings is now delegated to the variable
eldoc-documentation-strategy, which is the new name for the
now-obsolete eldoc-documentation-function, and still accepts the
so-called "old protocol".  Examples of the new strategies enabled are
codified in functions such as eldoc-documentation-enthusiast,
eldoc-documentation-compose-eagerly, along with the existing
eldoc-documentation-compose and eldoc-documentation-default.

The work of displaying and formatting docstrings is shifted almost
fully to Eldoc itself and is delegated to the internal function
eldoc--handle-docs.  Among other improvements, it handles most of
eldoc-echo-area-use-multiline-p and outputs documentation to a
temporary *eldoc* buffer.

The manual and NEWS are updated to mention the new Eldoc features.

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions):
Overhaul docstring.
(eldoc-documentation-compose, eldoc-documentation-default): Handle
non-nil, non-string values of elements of
eldoc-documentation-functions.  Use eldoc--handle-multiline.
(eldoc-print-current-symbol-info): Honour non-nil, non-string
values returned by eldoc-documentation-callback.
(eldoc--make-callback): Now also a function.
(eldoc-documentation-default, eldoc-documentation-compose): Tweak docstring.
(eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly):
New functions.
(eldoc-echo-area-use-multiline-p): Add new semantics.
(eldoc--handle-docs): Handle some of eldoc-echo-area-use-multiline-p.
(eldoc-doc-buffer): New command.
(eldoc-prefer-doc-buffer): New defcustom.
(eldoc--enthusiasm-curbing-timer): New variable.
(eldoc-documentation-strategy): Rename from eldoc-documentation-function.
(eldoc--supported-p): Use eldoc-documentation-strategy
(eldoc-highlight-function-argument)
(eldoc-argument-case, global-eldoc-mode)
(turn-on-eldoc-mode): Mention eldoc-documentation-strategy.
(eldoc-message-function): Mention eldoc--message.
(eldoc-message): Made obsolete.
(eldoc--message): New helper.

* lisp/hexl.el (hexl-print-current-point-info): Adjust to new
eldoc-documentation-functions protocol.

* lisp/progmodes/cfengine.el (cfengine3-documentation-function):
Adjust to new eldoc-documentation-functions protocol.

* lisp/progmodes/elisp-mode.el
(elisp-eldoc-documentation-function): Adjust to new
eldoc-documentation-functions protocol.

* lisp/progmodes/octave.el (octave-eldoc-function): Adjust to new
eldoc-documentation-functions protocol.

* lisp/progmodes/python.el (python-eldoc-function): Adjust to new
eldoc-documentation-functions protocol.

(eldoc-print-current-symbol-info): Rework with cl-labels.

* doc/emacs/programs.texi (Lisp Doc): Mention
eldoc-documentation-strategy.

* doc/lispref/modes.texi (Major Mode Conventions): Mention
eldoc-documentation-functions.

* etc/NEWS: Mention eldoc-documentation-strategy.
2020-07-08 11:25:33 +01:00
Andrea Corallo
3d43d45755 Merge remote-tracking branch 'savannah/master' into HEAD 2020-07-07 20:44:39 +01:00
Mattias Engdegård
df3ece9d2e Optimise assoc and rassoc with symbol key to assq and rassq
This is the same transformation made for member to memq.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-assoc): New function.
(assoc, rassoc): Set the byte-optimizer property.
2020-07-07 17:55:20 +02:00
Stefan Monnier
6b80ff3c46 * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add keyword 2020-07-06 18:04:54 -04:00
Mattias Engdegård
3f990c3ccc Simplify byte-code optimisation of pure functions
Most pure functions need no explicit optimisation; we can do away with
almost all uses of byte-optimize-predicate (now renamed to
byte-optimize-constant-args, since it is not just for predicates).
Also remove some superfluous arity warnings.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-identity, byte-optimize-memq)
(byte-optimize-nth, byte-optimize-nthcdr):
Remove arity warnings and simplify.
* lisp/emacs-lisp/byte-opt.el (<, >, <=, >=, not, null, consp, listp)
(symbolp, stringp, string<, string-lessp, proper-list-p, logand)
(logior, logxor, lognot, car, cdr, car-safe, cdr-safe):
Remove superfluous byte-optimizer property.
(byte-optimize-predicate): Rename to byte-optimize-constant-args.
All uses changed.
2020-07-06 18:08:06 +02:00
Mattias Engdegård
fb63a64d21 Mark more functions pure (bug#42147)
Extend the list of 'pure' functions to many predicates and numerical
functions that we are reasonably confident will give portable results.
Also include various list and array accessors, because our use of purity
in the byte compiler isn't affected by the mutability of arguments.

* lisp/emacs-lisp/byte-opt.el: Update example in comment.
(pure-fns): Add many functions.
(byte-optimize-form-code-walker) Don't signal errors during evaluation
of calls to pure functions with constant arguments at compile time,
since such calls are not necessarily reachable.
2020-07-06 12:54:17 +02:00
Mattias Engdegård
c10293e168 Relax portable number check in byte compiler (bug#42147)
With bignums, the set of representable integers is no longer
platform-dependent, and since we use nothing but IEEE754 64-bit
floats, all numbers are now portable.  Take advantage of this fact
to simplify constant-folding in the byte compiler, allowing it to
be applied more widely.

* lisp/emacs-lisp/byte-opt.el (byte-opt--portable-max)
(byte-opt--portable-min, byte-opt--portable-numberp): Remove.
(byte-opt--arith-reduce, byte-optimize-minus, byte-optimize-1+)
(byte-optimize-1-): Simplify: any number will do, and if N is a
number, then so are -N, N+1 and N-1.
2020-07-05 16:56:32 +02:00
Andrea Corallo
2593bbee51 * Relax constant folding rules
* lisp/emacs-lisp/comp.el (comp-function-optimizable-p): No need to
check for operands or result to be fixnums.
2020-07-04 15:55:48 +01:00
Andrea Corallo
b0f683ec16 * Fix missing tail recursion elimination
* lisp/emacs-lisp/comp.el (comp-tco-func): Fix tail recursion
	elimination given now functions in LIMPLE are expressed with
	the C name.
2020-07-02 22:55:42 +02:00
Andrea Corallo
8f81859497 Rework `comp-c-func-name' arguments
* lisp/emacs-lisp/comp.el (comp-c-func-name): Add FIRST argument
	to ignore the compiler context and return the first name.

	* lisp/emacs-lisp/disass.el (disassemble-internal): Update the
	`comp-c-func-name' call.
2020-07-02 22:39:39 +02:00
Andrea Corallo
b67e156041 * Add to possibility to write per pass specific tests
* lisp/emacs-lisp/comp.el (comp-post-pass-hooks): New special
	variable.
	(native-compile): Run what is registered in
	`comp-post-pass-hooks'.
2020-07-02 22:39:32 +02:00
Andrea Corallo
4681f33071 Fix lambda-list relocation class
Lambda-lists must stay in the same relocation class of the object
referenced by code to respect uninterned symbols.

	* lisp/emacs-lisp/comp.el (comp-prepare-args-for-top-level): Break
	the original function in a generic specializing for
	dynamic/lexical functions.  When allocating the lambda-list for
	dynamic functions do that in the default relocation class.
	(comp-emit-for-top-level): Make use of the new
	`comp-prepare-args-for-top-level'.
	(comp-emit-lambda-for-top-level): Likewise.
2020-06-30 21:30:35 +02:00
Andrea Corallo
0ce4bf3ede * Do not skip native compilation for leim subfolder during boostrap
* lisp/emacs-lisp/comp.el (comp-bootstrap-black-list): Remove
	"^leim/".
2020-06-28 21:23:45 +01:00
Andrea Corallo
0eedb5af0b Merge remote-tracking branch 'savannah/master' into HEAD 2020-06-27 21:42:16 +01:00
Eli Zaretskii
be7a07f38d Fix byte-compilation warning in project.el
* lisp/emacs-lisp/seq.el (seq-every-p): Autoload it.  This fixes
byte-compilation warning in project.el.
2020-06-26 10:15:46 +03:00
Andrea Corallo
c324e02f75 Merge remote-tracking branch 'savahnna/master' into dev 2020-06-22 00:20:03 +02:00
Andrea Corallo
cfb871add4 * Handle correctly pure delaration specifier.
* lisp/emacs-lisp/comp.el (comp-func): New slot 'pure'.
	(comp-spill-decl-spec): New function.
	(comp-spill-speed): Rework to use the later.
	(comp-spill-lap-function, comp-intern-func-in-ctxt): Spill pure
	decl value.
	(comp-function-optimizable-p): Check in the compiler env too if
	pure.
2020-06-22 00:13:43 +02:00
Andrea Corallo
decced8337 Allow per function speed declaration
* src/comp.c (COMP_SPEED): Rename.
	(comp_t): Add 'func_speed' field.
	(emit_mvar_lval, compile_function): Update for per function speed.
	(Fcomp__compile_ctxt_to_file): COMP_SPEED renamed.

	* lisp/emacs-lisp/comp.el (comp-speed): Doc update.
	(comp-func): New 'speed' slot.
	(comp-spill-speed): New function.
	(comp-spill-lap-function, comp-intern-func-in-ctxt): Fill 'speed'
	slot.
	(comp-spill-lap-function): Gate -1 speed functions for native
	compilation and emit bytecode instead.
	(comp-spill-lap): Close over `byte-to-native-plist-environment'.
	(comp-latch-make-fill): Update for per function speed.
	(comp-limplify-top-level): Fill speed.
	(comp-propagate1, comp-call-optim-form-call, comp-call-optim)
	(comp-dead-code, comp-tco, comp-remove-type-hints): Update for per
	function speed.
2020-06-22 00:05:29 +02:00
Andrea Corallo
29b2a08c36 Execute top level forms in the right lex/dyn scope.
* lisp/emacs-lisp/bytecomp.el (byte-to-native-top-level): Add
	'lexical' slot.
	(byte-compile-output-file-form): Update for new slot.
	(byte-compile-file-form-defmumble): Capture scope.

	* lisp/emacs-lisp/comp.el (comp-emit-for-top-level): Specify
	execution scope.
2020-06-22 00:03:23 +02:00
Basil L. Contovounesios
0792f8e4f0 Revert last change in benchmark.el
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00791.html

* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Revert to
giving byte-compile a form rather than a closure.
2020-06-21 19:01:40 +01:00
Basil L. Contovounesios
1ecd350f38 Evaluate some unnecessarily quoted lambdas
* lisp/cedet/semantic/complete.el
(semantic-displayer-tooltip-max-tags):
* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled):
* lisp/emacs-lisp/package.el (package--default-summary)
(package-menu-filter-by-version):
* lisp/eshell/em-pred.el (eshell-pred-file-time):
* lisp/progmodes/verilog-mode.el (verilog-auto-lineup)
(verilog-auto-reset-widths, verilog-auto-arg-format)
(verilog-auto-inst-vector, verilog-auto-inst-template-numbers):
* lisp/textmodes/bibtex.el (bibtex-dialect):
* test/lisp/autoinsert-tests.el
(autoinsert-tests-define-auto-insert-before)
(autoinsert-tests-define-auto-insert-after): Remove some unnecessary
quoting around anonymous functions.
2020-06-21 13:42:14 +01:00
Andrea Corallo
c37b5446d1 Add native compiler dynamic scope support
Add an initial implementation to support dynamic scope.  Arg
parsing/binding it's done using the existing code in use for
bytecode (no ad-hoc code is synthetized for that).

	* src/lisp.h (struct Lisp_Subr): Add lambda_list field.
	(SUBR_NATIVE_COMPILED_DYNP): New inliner.

	* src/alloc.c (mark_object): Update for Add lambda_list field.

	* src/eval.c (eval_sub, Ffuncall, funcall_lambda): Handle native
	compiled dynamic scope

	* src/comp.c (declare_lex_function): Rename from declare_function
	and rework.
	(declare_function): New function.
	(make_subr): Handle daynamic scope

	* src/pdumper.c (dump_subr): Update for lambda_list field.

	* lisp/emacs-lisp/comp.el (comp-func): Remove args slot.
	(comp-func-l, comp-func-d): New classes deriving from `comp-func'.
	(comp-spill-lap-function): Rework.
	(comp-prepare-args-for-top-level): New function.
	(comp-emit-for-top-level, comp-emit-lambda-for-top-level): Make
	use of `comp-prepare-args-for-top-level'.
	(comp-limplify-top-level): Use `comp-func-l'.
	(comp-limplify-function): Emit arg prologue only for dynamic
	scoped functions.
	(comp-call-optim-form-call): Use `comp-func-l'.
	(comp-call-optim, comp-tco): Do not optimize dynamic scoped code.
2020-06-19 09:04:49 +02:00
Basil L. Contovounesios
23a148c950 Various battery.el improvements (bug#41808)
* lisp/battery.el: Mention BSD support in Commentary.  Don't load
preloaded lisp/emacs-lisp/timer.el.
(battery--files): New function.
(battery--find-linux-sysfs-batteries): Use it and make fewer
syscalls.
(battery-status-function): Perform GNU/Linux checks in increasing
order of obsolescence: sysfs, ACPI, and then APM.  Simplify Darwin
check.  Add :version tag now that battery-upower is the default.
(battery-echo-area-format, battery-mode-line-format): Mention %s.
(battery-load-low, battery-load-critical): New faces.
(battery-update): Display battery-mode-line-format even if
percentage is N/A.  Apply faces battery-load-low or
battery-load-critical according to the percentage, but append them
so they don't override user customizations.  Update all mode lines
since we are in global-mode-string.
(battery-linux-proc-apm-regexp): Mark as obsolete, replacing with...
(battery--linux-proc-apm): ...this new rx definition.
(battery-linux-proc-apm): Use it.  Fix indentation.  Simplify.
(battery--acpi-rate, battery--acpi-capacity): New rx definitions.
(battery-linux-proc-acpi): Use them.  Fix pathological whitespace
regexps.  Simplify.
(battery-linux-sysfs): Fix docstring and indentation.  Reduce number
of file searches.  Simplify.
(battery-bsd-apm): Fix docstring.  Simplify.
(battery-pmset): Fix docstring.  Simplify ID regexp.

* lisp/emacs-lisp/rx.el (rx-define): Indent as a defun.

* test/lisp/battery-tests.el (battery-linux-proc-apm-regexp): Test
new battery--linux-proc-apm rx definition.
(battery-acpi-rate-regexp, battery-acpi-capacity-regexp): New tests.
2020-06-18 12:58:28 +01:00
Philipp Stephani
e96f78fca6 Band-aid for edebugging generator bodies (Bug#40434).
Edebug doesn't support them well.  Rather than trying to fix Edebug,
disable instrumentation for now to prevent annoying bugs.

* lisp/emacs-lisp/generator.el (iter-defun, iter-lambda, iter-make)
(iter-do): Don't attempt to instrument bodies that are mangled by the
CPS transformer.

* test/lisp/emacs-lisp/generator-tests.el
(generator-tests-edebug): New regression test.
2020-06-14 20:01:28 +02:00
Philipp Stephani
62cf8f1649 Ensure that getters and setters can be edebugged at the same time.
It's necessary to add a name suffix to setters defined with
'gv-define-setter' so that Edebug can distinguish between the getter
and the setter (Bug#41853).

* lisp/emacs-lisp/gv.el (gv-define-setter): Add a name suffix to
setter definitions.

* test/lisp/emacs-lisp/gv-tests.el (gv-setter-edebug): New regression
test.
2020-06-14 18:18:13 +02:00
Andrea Corallo
34ed9d2498 * Introduce latches
Define a new kind of basic block 'latch' to close over loops.  Its
purpose is for now to emit calls to `comp-maybe-gc-or-quit' but in
future will be usefull for the loop optimizer to exploit unboxes.

	* lisp/emacs-lisp/comp.el (comp-block): New base class.
	(comp-block-lap): New class for LAP derived basic blocks.
	(comp-latch): New class.
	(comp-bb-maybe-add, comp-make-curr-block, comp-emit-handler)
	(comp-emit-switch, comp-emit-switch, comp-limplify-top-level)
	(comp-addr-to-bb-name, comp-limplify-block)
	(comp-limplify-function): Update logic for new bb objects
	arrangment.
	(comp-latch-make-fill): New function.
	(comp-emit-uncond-jump, comp-emit-cond-jump): Update to emit
	latches.
	(comp-new-block-sym): Add a postfix paramenter.
2020-06-13 16:37:14 +02:00
Andrea Corallo
a6cc16d04c Merge remote-tracking branch 'savahnna/master' into HEAD 2020-06-11 18:37:47 +02:00
Philipp Stephani
00f4b7215c Slightly improve commit 73be4d1ed5.
* lisp/emacs-lisp/cl-macs.el (cl-lambda-list, cl-lambda-list1)
(cl-macro-list, cl-macro-list1): Use exactly the same specification as
for &optional (sans the third optional list element).
2020-06-10 15:46:12 +02:00
Philipp Stephani
73be4d1ed5 Allow destructuring in &aux sections when using edebug (Bug#40431)
* lisp/emacs-lisp/cl-macs.el (cl-lambda-list, cl-lambda-list1)
(cl-macro-list, cl-macro-list1): Allow arbitrary 'cl-lambda'
arguments in the &aux section.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-aux-edebug): New
regression test.
2020-06-10 15:34:41 +02:00
Nicolás Bértolo
4d1cfd0997 * Fix usage of cl-destructuring-bind in package--delete-directory.
* lisp/emacs-lisp/package.el (package--delete-directory): Fix usage of
cl-destructuring-bind.
2020-06-09 15:59:15 +02:00
Andrea Corallo
3d3737b90a * Move final log after containers has been finalized
* lisp/emacs-lisp/comp.el (comp-final): Remove function log.
	(comp-compile-ctxt-to-file): Add function log.
2020-06-08 21:51:24 +01:00
Andrea Corallo
3d576c784b Merge remote-tracking branch 'savannah/master' into dev 2020-06-07 20:08:54 +02:00
Andrea Corallo
53fba73ff2 * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add `make-byte-code'.
`make-byte-code' wraps `vector' doing some sanity check on the input
arguments.  `vector' is in side-effect-and-error-free-fns so add
`make-byte-code' to side-effect-free-fns.
2020-06-07 19:49:43 +02:00
Andrea Corallo
fbf4882a8b * Rename comp-function-optimizable -> comp-function-optimizable-p
* lisp/emacs-lisp/comp.el (comp-function-optimizable): Rename into
	'comp-function-optimizable-p'.
	(comp-function-call-maybe-remove): Use the new name.
2020-06-07 19:20:04 +02:00
Andrea Corallo
88ccee4083 * Fix comp-call-optim-form-call for null `callee'
* lisp/emacs-lisp/comp.el (comp-call-optim-form-call): Guard
	agains null `calle'.
2020-06-07 19:20:04 +02:00
Glenn Morris
fa6d56529f Merge from origin/emacs-27
35661ef943 (origin/emacs-27) Fix typo in "(elisp) Type Keywords"
1af0e95fec Gnus nnir-summary-line-format has no effect
dd366b5d3b Improve documentation of 'window-text-pixel-size'
fbd49f969e * src/xdisp.c (Fwindow_text_pixel_size): Doc fix.  (Bug#41...
d8593fd19f Minor improvements to EDE and EIEIO manuals
3916e63f9e Have Fido mode also imitate Ido mode in ignore-case options
cc35b197c7 Update package-menu-quick-help
bf09106256 Improve documentation of 'sort-subr'
73749efa13 Update Ukrainian transliteration
30a7ee505a Fix Arabic shaping when eww/shr fill the text to be rendered
7d323f07c0 Silence some byte-compiler warnings in tests
cf473e742f * test/lisp/battery-tests.el: New file.
b07e3b1d97 Improve format-spec documentation (bug#41571)

# Conflicts:
#	test/lisp/emacs-lisp/package-tests.el
2020-06-07 09:03:59 -07:00
Andrea Corallo
47a6fbd382 * Improve propagate pass
As function folding can generate 'setimm' insns handle them in the
`comp-propagate-insn'.

	* lisp/emacs-lisp/comp.el (comp-propagate-insn): Handle 'setimm'
	insn.
2020-06-07 16:59:23 +02:00
Andrea Corallo
a58fef9f63 * Optimize optimizable variables
* lisp/emacs-lisp/comp.el (comp-symbol-values-optimizable): New
	defconst.
	(comp-function-call-maybe-remove): New logic to to remove
	unnecessary `symbol-value' calls.
2020-06-07 10:36:58 +02:00
Andrea Corallo
489a79de96 * Mitigate possible speed 3 miss-optimization
Do not perform trampoline optimization at speed 3 on function if their
name is not unique inside the compilation unit.  Note that the
function can still be redefined in any other way therefore this is a
mitigation.

	* lisp/emacs-lisp/comp.el (comp-func-unique-in-cu-p): New
	predicate.
	(comp-call-optim-form-call): Perform trampoline optimization
	for named functions only if they are unique within the current
	compilation unit.
2020-06-06 22:03:11 +01:00
Andrea Corallo
dcfcbb14f5 * Allow for optimizing anonymous lambdas in call-optim
* lisp/emacs-lisp/comp.el (comp-func-in-unit): New function.
	(comp-call-optim-form-call): Update logic for optimizing
	anonymous lambdas.
2020-06-06 22:03:11 +01:00
Andrea Corallo
e8ab017b6d Change 'direct-call' 'direct-callref' LIMPLE ops sematinc
Is cleaner to have the function c-name as first argument of
'direct-call' 'direct-callref'.  This is preparatory to anonymous
lambdas optimization.

	* lisp/emacs-lisp/comp.el (comp-propagate-insn): Use c-name when
	gathering the comp-func definition for direct calls.
	(comp-call-optim-form-call): Add put c-name as first argument of
	direct-call direct-callref when optimizing.

	* src/comp.c (emit_call): Update logic for having c-name as
	first arg of direct calls.
	(emit_call_ref): Rename 'subr_sym' into 'func'.
2020-06-06 22:03:11 +01:00
Andrea Corallo
ee3df1483a Merge remote-tracking branch 'savannah/master' into HEAD 2020-06-06 21:52:00 +02:00
Basil L. Contovounesios
8bcc781bc7 Un-deprecate oset and oset-default
For discussion see the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00630.html
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00674.html
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00099.html

* lisp/emacs-lisp/eieio.el (oset, oset-default): Un-deprecate.
* lisp/emacs-lisp/eieio-core.el (eieio-oref): Declare gv-setter here
instead of in lisp/emacs-lisp/eieio.el.  Suggested by
Stefan Monnier <monnier@iro.umontreal.ca>.
(eieio-oref-default): Add gv-setter declaration.
* etc/NEWS: Announce these changes.
* doc/misc/eieio.texi (Accessing Slots): Document oref and
oref-default as generalized variables.  Consistently document
getters before setters.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: Use
lexical-binding.
(eieio-test-13-init-methods): Simplify.
(eieio-test-33-instance-tracker): Declare IT-list as special.
2020-06-06 17:24:00 +01:00
Basil L. Contovounesios
cc35b197c7 Update package-menu-quick-help
* lisp/emacs-lisp/package.el (package--quick-help-keys): Filtering
is now bound to the prefix '/', not the key 'f' (bug#41721).
Advertise only the standard 'g' binding now that both it and 'r' are
bound to revert-buffer (bug#35504).
(package--prettify-quick-help-key): Avoid modifying string literals.
(package-menu-filter): Reintroduce as obsolete alias of
package-menu-filter-by-keyword for backward
compatibility (bug#36981).
2020-06-05 19:06:00 +01:00
Andrea Corallo
f5ea65b436 Merge remote-tracking branch 'savannah/master' into HEAD 2020-06-04 10:33:07 +01:00
Andrea Corallo
e4e6bb7fdd * Introduce `comp-loop-insn-in-block'
* lisp/emacs-lisp/comp.el (comp-loop-insn-in-block): New macro.
	(comp-call-optim-func, comp-dead-assignments-func)
	(comp-remove-type-hints-func): Use `comp-loop-insn-in-block'.
2020-06-03 22:06:26 +01:00