]> git.eshelyaron.com Git - emacs.git/log
emacs.git
4 years ago* Rename `comp-propagate' into `fw-prop'
Andrea Corallo [Sun, 12 Jul 2020 13:05:46 +0000 (15:05 +0200)]
* Rename `comp-propagate' into  `fw-prop'

* lisp/emacs-lisp/comp.el (comp-passes): Rename `comp-propagate'
-> `comp-fwprop'.
(comp-fwprop-prologue): Rename from `comp-propagate-prologue'.
(comp-fwprop-insn): Rename from `comp-fwprop-insn'.
(comp-propagate*): Rename from `comp-propagate*' and update.
(comp-fwprop): Rename from `comp-propagate' and update.

4 years ago* Clean-up now unnecessary backward propagation in comp.el
Andrea Corallo [Sun, 12 Jul 2020 10:22:41 +0000 (12:22 +0200)]
* Clean-up now unnecessary backward propagation in comp.el

* lisp/emacs-lisp/comp.el (comp-passes): Invoke 'comp-propagate'
instead of 'comp-propagate-alloc'.
(comp-mvar): Remove unnecessary `array-idx' slot.
(comp-propagate-prologue): Remove.
(comp-propagate-prologue): Remove `backward' parameter and
backward propagation logic.
(comp-propagate1): Remove and move logic into `comp-propagate'.
(comp-propagate-alloc): Remove pass.

4 years ago* Rework frame allocation strategy
Andrea Corallo [Sun, 12 Jul 2020 09:11:41 +0000 (11:11 +0200)]
* Rework frame allocation strategy

All frame slots are now simple automatic variables given the array
allocation and fill is done in 'emit_limple_call_ref'.

* src/comp.c (comp_t): Remove 'f_frame' 'arrays' slots, add
'frame'.
(emit_mvar_lval): Simplify to make use of 'comp.frame'.
(compile_function): Clean-up and add comp.frame initialization.

4 years ago* Rework the backend to allocate arument arrays for call by references
Andrea Corallo [Sun, 12 Jul 2020 08:54:48 +0000 (10:54 +0200)]
* Rework the backend to allocate arument arrays for call by references

* src/comp.c (comp_t): Add 'zero' field.
(emit_limple_call_ref): Allocate an array to host the parametes
and generate the code moving values into.
(Fcomp__init_ctxt): Initialize comp.zero.

4 years agoMerge remote-tracking branch 'savannah/master' into wip2
Andrea Corallo [Thu, 9 Jul 2020 15:42:16 +0000 (16:42 +0100)]
Merge remote-tracking branch 'savannah/master' into wip2

4 years ago* Disable ipa-pure in comp-tests-tco
Andrea Corallo [Wed, 8 Jul 2020 19:57:20 +0000 (20:57 +0100)]
* Disable ipa-pure in comp-tests-tco

* test/src/comp-tests.el (comp-tests-tco): Disable ipa-pure to
check effectively for tail recursion elimination.

4 years ago* Add `comp-disabled-passes'
Andrea Corallo [Wed, 8 Jul 2020 13:23:09 +0000 (14:23 +0100)]
* Add `comp-disabled-passes'

* lisp/emacs-lisp/comp.el (comp-disabled-passes): New special
variable.
(native-compile): Make use of `comp-disabled-passes'.

4 years ago;* test/src/comp-test-funcs-dyn.el: Fix comment header.
Andrea Corallo [Sun, 5 Jul 2020 22:00:14 +0000 (23:00 +0100)]
;* test/src/comp-test-funcs-dyn.el: Fix comment header.

4 years agoAdd some tests for pure function optimization
Andrea Corallo [Sun, 5 Jul 2020 22:00:07 +0000 (23:00 +0100)]
Add some tests for pure function optimization

* test/src/comp-tests.el (comp-tests-fw-prop): Fix docstring.
(comp-tests-pure-checker-1, comp-tests-pure-checker-2): New
functions.
(comp-tests-pure): New test testing for pure function
optimization.

4 years ago* Optimize pure functions defined by the compilation environment
Andrea Corallo [Sun, 5 Jul 2020 21:05:36 +0000 (22:05 +0100)]
* Optimize pure functions defined by the compilation environment

* lisp/emacs-lisp/comp.el (comp-apply-in-env): New macro.
(comp-function-call-maybe-remove): Update to make use of
`comp-apply-in-env'.

4 years ago* Introduce a new pass ipa-pure
Andrea Corallo [Sun, 5 Jul 2020 19:26:36 +0000 (20:26 +0100)]
* Introduce a new pass ipa-pure

Add a simple pass to infer pure functions not explicitly declared as
such.  Use this information only during compilation (speed 3) to
optimize out function calls whe possible.

4 years ago* Add `comp-call-op-p'
Andrea Corallo [Sun, 5 Jul 2020 19:00:46 +0000 (20:00 +0100)]
* Add `comp-call-op-p'

* lisp/emacs-lisp/comp.el (comp-call-op-p): New predicate.
(comp-limple-insn-call-p): Make use of.

4 years ago* test/src/comp-test-funcs.el (comp-tests-aref-aset-f) : Fix UB.
Andrea Corallo [Sun, 5 Jul 2020 18:45:10 +0000 (19:45 +0100)]
* test/src/comp-test-funcs.el (comp-tests-aref-aset-f) : Fix UB.

4 years ago* Define `comp-symbol-func-to-fun'
Andrea Corallo [Sun, 5 Jul 2020 17:32:32 +0000 (18:32 +0100)]
* Define `comp-symbol-func-to-fun'

* lisp/emacs-lisp/comp.el (comp-symbol-func-to-fun): New function.
(comp-func-in-unit): Make use of the `comp-symbol-func-to-fun'.

4 years ago* Add a test targeting forward propagation
Andrea Corallo [Sun, 5 Jul 2020 10:11:11 +0000 (11:11 +0100)]
* Add a test targeting forward propagation

* test/src/comp-tests.el (comp-tests-fw-prop-checker-1): New
function.
(comp-tests-fw-prop): New test.

4 years agoBump Flymake version
João Távora [Thu, 9 Jul 2020 10:13:48 +0000 (11:13 +0100)]
Bump Flymake version

* lisp/progmodes/flymake.el (Version): Bump to 1.0.9.

4 years agoUpdate tests for recent changes
Glenn Morris [Thu, 9 Jul 2020 00:35:54 +0000 (17:35 -0700)]
Update tests for recent changes

* test/lisp/descr-text-tests.el (descr-text-test-desc):
Update for recent change to describe-char-eldoc.
* test/lisp/progmodes/elisp-mode-tests.el
(elisp--highlight-function-argument-indexed)
(elisp--highlight-function-argument-keyed-1)
(elisp--highlight-function-argument-keyed-2):
Update for recent change to elisp--highlight-function-argument.

4 years ago* lisp/progmodes/cc-engine.el (c-at-expression-start-p): Fix message.
Glenn Morris [Thu, 9 Jul 2020 00:23:36 +0000 (17:23 -0700)]
* lisp/progmodes/cc-engine.el (c-at-expression-start-p): Fix message.

4 years ago; * etc/NEWS (Eldoc): adjust NEWS entry.
João Távora [Wed, 8 Jul 2020 19:22:53 +0000 (20:22 +0100)]
; * etc/NEWS (Eldoc): adjust NEWS entry.

4 years agoShoosh warnings about obsolete eldoc-documentation-function
João Távora [Wed, 8 Jul 2020 19:20:14 +0000 (20:20 +0100)]
Shoosh warnings about obsolete eldoc-documentation-function

* lisp/progmodes/cfengine.el (cfengine3-mode): Remove mention to
obsolete eldoc-documentation-function.

* lisp/progmodes/python.el (python-mode): Use with-no-warnings.

4 years ago; * etc/NEWS: Fix last change.
Eli Zaretskii [Wed, 8 Jul 2020 16:54:17 +0000 (19:54 +0300)]
; * etc/NEWS: Fix last change.

4 years ago; * etc/NEWS: Minor copyedits of the recent additions.
Eli Zaretskii [Wed, 8 Jul 2020 16:49:45 +0000 (19:49 +0300)]
; * etc/NEWS: Minor copyedits of the recent additions.

4 years ago* Rework some test logic for generality
Andrea Corallo [Sun, 5 Jul 2020 09:23:46 +0000 (10:23 +0100)]
* Rework some test logic for generality

* test/src/comp-tests.el (comp-tests-make-insn-checker): New
function splitting logic from `comp-tests-tco-checker' to have it
more general.
(comp-tests-tco-checker): Make use of
`comp-tests-make-insn-checker'.

4 years ago* Clean-up some const folding logic and add `comp-function-pure-p'
Andrea Corallo [Sun, 5 Jul 2020 09:21:21 +0000 (10:21 +0100)]
* Clean-up some const folding logic and add `comp-function-pure-p'

* lisp/emacs-lisp/comp.el (comp-function-pure-p): New predicate.
(comp-function-call-maybe-remove): Update to use the
`comp-function-pure-p'.

4 years agoSpecial-case symbol and fixnum keys in member, assoc and rassoc
Mattias Engdegård [Wed, 8 Jul 2020 09:22:19 +0000 (11:22 +0200)]
Special-case symbol and fixnum keys in member, assoc and rassoc

* src/fns.c (Fmember, Fassoc, Frassoc): Delegate to the cheaper Fmemq,
Fassq and Frassq for arguments of the appropriate types.
(eq_comparable_value): New function.

4 years agoImprove Eldoc docstrings
João Távora [Wed, 8 Jul 2020 10:19:19 +0000 (11:19 +0100)]
Improve Eldoc docstrings

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-strategy): Improve
docstring.
(eldoc--make-callback): Improve docstring.
(eldoc--invoke-strategy): New helper function.
(eldoc-print-current-symbol-info): Call eldoc--invoke-strategy.
(eldoc-documentation-functions): Improve docstring.

4 years agoChange version scheme of two Eldoc obsolete specs
João Távora [Tue, 7 Jul 2020 12:37:16 +0000 (13:37 +0100)]
Change version scheme of two Eldoc obsolete specs

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function)
(eldoc-message): Obsolete spec uses eldoc-1.1.0.

4 years agoAdjust describe-char-eldoc to new eldoc-documentation-functions protocol
João Távora [Tue, 7 Jul 2020 12:35:07 +0000 (13:35 +0100)]
Adjust describe-char-eldoc to new eldoc-documentation-functions protocol

* lisp/descr-text.el (describe-char-eldoc): Adjust to new
eldoc-documentation-functions protocol.

4 years agoAdjust Eldoc documentation after Eli's review
João Távora [Sun, 5 Jul 2020 11:55:27 +0000 (12:55 +0100)]
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.

4 years agoMake more parts of Emacs use new Eldoc capabilities
João Távora [Sat, 6 Jun 2020 13:04:48 +0000 (14:04 +0100)]
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.

4 years ago* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0
João Távora [Wed, 3 Jun 2020 17:47:24 +0000 (18:47 +0100)]
* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0

4 years agoNew M-x eldoc for on-demand and interactive documentation requests
João Távora [Mon, 15 Jun 2020 12:55:37 +0000 (13:55 +0100)]
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.

4 years agoBetter handle asynchronous Eldoc sources
João Távora [Mon, 25 May 2020 15:39:40 +0000 (16:39 +0100)]
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.

4 years agoMerge remote-tracking branch 'savannah/master' into HEAD
Andrea Corallo [Tue, 7 Jul 2020 19:44:39 +0000 (20:44 +0100)]
Merge remote-tracking branch 'savannah/master' into HEAD

4 years agoOptimise assoc and rassoc with symbol key to assq and rassq
Mattias Engdegård [Mon, 6 Jul 2020 10:51:04 +0000 (12:51 +0200)]
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.

4 years agoMerge from origin/emacs-27
Glenn Morris [Tue, 7 Jul 2020 14:50:40 +0000 (07:50 -0700)]
Merge from origin/emacs-27

71fc003860 (origin/emacs-27) Avoid infloop in 'format-mode-line'
247dcb4b1b Clarify the documentation of 'left/right-fringe' display spec
d453cee177 Minor improvement in ELisp manual
3c778c443c * doc/misc/tramp.texi (Customizing Methods): Fix typo.

4 years ago; Merge from origin/emacs-27
Glenn Morris [Tue, 7 Jul 2020 14:50:40 +0000 (07:50 -0700)]
; Merge from origin/emacs-27

The following commit was skipped:

2aa4be89cd (emacs-27) ; Auto-commit of loaddefs files.

4 years agoMerge from origin/emacs-27
Glenn Morris [Tue, 7 Jul 2020 14:50:39 +0000 (07:50 -0700)]
Merge from origin/emacs-27

59e768d64a Fix undefined behavior in json.c (Bug#42113)
cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix.
b9abf5ceb2 Improve do string of 'man'
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...

4 years agoAvoid infloop in 'format-mode-line'
Eli Zaretskii [Tue, 7 Jul 2020 14:08:19 +0000 (17:08 +0300)]
Avoid infloop in 'format-mode-line'

* src/xdisp.c (decode_mode_spec): Don't use W->start if it is
outside of the buffer's accessible region.  (Bug#42220)

4 years ago* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add `keyword`
Stefan Monnier [Mon, 6 Jul 2020 22:04:54 +0000 (18:04 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add `keyword`

4 years agoSimplify byte-code optimisation of pure functions
Mattias Engdegård [Mon, 6 Jul 2020 15:38:52 +0000 (17:38 +0200)]
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.

4 years agoMark more functions pure (bug#42147)
Mattias Engdegård [Sun, 5 Jul 2020 11:47:34 +0000 (13:47 +0200)]
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.

4 years ago; Revert "; Add a note about a bottleneck"
Dmitry Gutov [Mon, 6 Jul 2020 01:29:52 +0000 (04:29 +0300)]
; Revert "; Add a note about a bottleneck"

This reverts commit 9f9ce631a2ff44ebcb87b0b1390a21b13665db43.

It's still a bottleneck, but so are mapcar (with its effect on GC) and
concat. So our limits show in several places at once.

4 years ago; Add a note about a bottleneck
Dmitry Gutov [Mon, 6 Jul 2020 00:50:59 +0000 (03:50 +0300)]
; Add a note about a bottleneck

4 years ago* lisp/progmodes/project.el: Bump the version.
Dmitry Gutov [Sun, 5 Jul 2020 21:51:13 +0000 (00:51 +0300)]
* lisp/progmodes/project.el: Bump the version.

4 years ago; Add a couple of FIXMEs
Dmitry Gutov [Sun, 5 Jul 2020 21:50:32 +0000 (00:50 +0300)]
; Add a couple of FIXMEs

4 years agoproject-switch-to-buffer: Don't filter based on default-directory
Dmitry Gutov [Sun, 5 Jul 2020 00:35:00 +0000 (03:35 +0300)]
project-switch-to-buffer: Don't filter based on default-directory

* lisp/progmodes/project.el (project-switch-to-buffer):
Don't filter based on default-directory
(https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00075.html).
(project-switch-to-buffer): Ditto.

4 years agoVerilog-Mode collected updates.
Wilson Snyder [Sun, 5 Jul 2020 17:31:39 +0000 (13:31 -0400)]
Verilog-Mode collected updates.

* lisp/progmodes/verilog-mode.el (verilog-auto-inst): Support regexp of
what AUTOINST I/O to include, issue #1682.  Reported by Mrainy.
(verilog-font-lock-keywords-1): Fix highlighting module names with no
following (, issue #1679.  Reported by Vinam Arora.
(verilog-font-lock-keywords) Adds syntax highlighting for identifiers in
declaration statements, #1678.
(verilog-calculate-indent, verilog-inject-arg)
(verilog-keywords, verilog-showscopes): Support AMS
connectmodule/endconnectmodule, #1665. Reported by Dan McMahill.

4 years agoDon't confuse errors with nil in bytecomp-tests.el
Mattias Engdegård [Sun, 5 Jul 2020 15:44:34 +0000 (17:44 +0200)]
Don't confuse errors with nil in bytecomp-tests.el

* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-check-1)
(bytecomp-explain-1, test-byte-opt-arithmetic, bytecomp-lexbind-check-1)
(bytecomp-lexbind-explain-1):
If an expression raises an error when evaluated, don't treat it as if
it had succeeded with the value nil; use 'bytecomp-check-error' as the
result instead.

4 years agoClarify the documentation of 'left/right-fringe' display spec
Eli Zaretskii [Sun, 5 Jul 2020 15:30:21 +0000 (18:30 +0300)]
Clarify the documentation of 'left/right-fringe' display spec

* doc/lispref/display.texi (Other Display Specs, Fringe Bitmaps):
Clarify how the optional FACE parameter of the left-fringe and
right-fringe display spec is used.  Reported by Gregory Heytings
<ghe@sdf.org>.

4 years agoRelax portable number check in byte compiler (bug#42147)
Mattias Engdegård [Fri, 3 Jul 2020 18:13:50 +0000 (20:13 +0200)]
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.

4 years agoRemove long obsolete c-looking-at-bos. Make c-at-expression-start-p obsolete
Alan Mackenzie [Sat, 4 Jul 2020 16:35:47 +0000 (16:35 +0000)]
Remove long obsolete c-looking-at-bos.  Make c-at-expression-start-p obsolete

* lisp/progmodes/cc-engine.el (c-looking-at-bos): Remove.
(c-at-expression-start-p): Make obsolete, with no alternative function.

4 years ago* Relax constant folding rules
Andrea Corallo [Sat, 4 Jul 2020 14:53:15 +0000 (15:53 +0100)]
* Relax constant folding rules

* lisp/emacs-lisp/comp.el (comp-function-optimizable-p): No need to
check for operands or result to be fixnums.

4 years agoFix filling in js-mode and mhtml-mode (js-mode parts), fixing bug #41897
Alan Mackenzie [Sat, 4 Jul 2020 12:55:49 +0000 (12:55 +0000)]
Fix filling in js-mode and mhtml-mode (js-mode parts), fixing bug #41897

* lisp/progmodes/js.el (js-mode): Use "\\(?:" in the value of
comment-start-skip rather than "\\(", fixing the second half of bug #41952.
Call c-foreign-init-lit-pos-cache and install c-foreign-truncate-lit-pos-cache
on before-change-functions, to connect up correctly with CC Mode's filling
mechanism.

* lisp/textmodes/mhtml-mode.el (mhtml--crucial-variable-prefix): Add prefixes
"adaptive-fill-", "fill-", "normal-auto-fill-function" and "paragraph-" to
pull in variables crucial to filling.
(mhtml-syntax-propertize): Read the current submode from the piece of text
being propertized rather than one character before it, and do so before
erasing the submode text-property.
(mhtml-mode): Set the js-mode value of auto-fill-function to js-do-auto-fill.
Correctly initialize and use CC Mode's filling facilities, as above.

4 years agoCC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952
Alan Mackenzie [Sat, 4 Jul 2020 11:56:18 +0000 (11:56 +0000)]
CC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952

Also add functions to enable correct use of CC Mode's filling functionality
from major modes which don't initialize CC Mode fully.  These modes are
currently js-mode and mhtml-mode.

* lisp/progmodes/cc-langs.el (comment-start-skip): Replace "\\(" by "\\(?:" so
that (match-end 1) isn't falsely taken to be the start of the comment.

* lisp/progmodes/cc-engine.el (c-foreign-truncate-lit-pos-cache)
(c-foreign-init-lit-pos-cache): New functions.

4 years agoUse 'emacs-lisp-mode-syntax-table' for reading Lisp expressions
Daniel Koning [Tue, 23 Jun 2020 00:03:20 +0000 (19:03 -0500)]
Use 'emacs-lisp-mode-syntax-table' for reading Lisp expressions

* lisp/simple.el (read--expression): Set syntax table to
'emacs-lisp-mode-syntax-table' when reading a Lisp expression
from the minibuffer.  (Bug#41781)

Copyright-paperwork-exempt: yes

4 years agoMinor improvement in ELisp manual
Eli Zaretskii [Sat, 4 Jul 2020 07:19:56 +0000 (10:19 +0300)]
Minor improvement in ELisp manual

* doc/lispref/frames.texi (Position Parameters): Clarify the
description of the 'above' frame parameter.  (Bug#42154)

4 years ago* Fix missing tail recursion elimination
Andrea Corallo [Thu, 2 Jul 2020 19:45:42 +0000 (21:45 +0200)]
* 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.

4 years ago* Add a test to verify tail recursion elimination
Andrea Corallo [Thu, 2 Jul 2020 19:43:52 +0000 (21:43 +0200)]
* Add a test to verify tail recursion elimination

* test/src/comp-tests.el (comp-tests-tco): Compile a recursive
functions at speed 3 and verify the tail recursion elimination.
(comp-tests-tco-checker, comp-tests-mentioned-p)
(comp-tests-mentioned-p-1): New support functions.

4 years agoRework `comp-c-func-name' arguments
Andrea Corallo [Thu, 2 Jul 2020 19:32:09 +0000 (21:32 +0200)]
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.

4 years ago* Add to possibility to write per pass specific tests
Andrea Corallo [Thu, 2 Jul 2020 19:29:34 +0000 (21:29 +0200)]
* 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'.

4 years agoMerge remote-tracking branch 'savahnna/master' into HEAD
Andrea Corallo [Thu, 2 Jul 2020 20:30:37 +0000 (22:30 +0200)]
Merge remote-tracking branch 'savahnna/master' into HEAD

4 years ago* lisp/progmodes/cc-mode.el (c-or-c++-mode--regexp): Change WS to [ \t] in it
Alan Mackenzie [Thu, 2 Jul 2020 18:14:30 +0000 (18:14 +0000)]
* lisp/progmodes/cc-mode.el (c-or-c++-mode--regexp): Change WS to [ \t] in it

4 years agoRemove Emacs-27 reference
Phillip Lord [Thu, 2 Jul 2020 17:03:23 +0000 (18:03 +0100)]
Remove Emacs-27 reference

* admin/nt/dist-build/README-windows-binaries:

4 years ago* doc/misc/tramp.texi (Customizing Methods): Fix typo.
Michael Albinus [Thu, 2 Jul 2020 11:06:25 +0000 (13:06 +0200)]
* doc/misc/tramp.texi (Customizing Methods): Fix typo.

4 years agoRevert feature added in bfd96e995d using project directories in vc (bug#41821)
Juri Linkov [Wed, 1 Jul 2020 22:08:18 +0000 (01:08 +0300)]
Revert feature added in bfd96e995d using project directories in vc (bug#41821)

4 years ago; * etc/NEWS: Announce dropping of support for OpenBSD 5.3.
Eli Zaretskii [Wed, 1 Jul 2020 14:25:52 +0000 (17:25 +0300)]
; * etc/NEWS: Announce dropping of support for OpenBSD 5.3.

4 years agoSupport pty's on OpenBSD
YASUOKA Masahiko [Sat, 27 Jun 2020 03:56:42 +0000 (12:56 +0900)]
Support pty's on OpenBSD

* configure.ac (PTY_TTY_NAME_SPRINTF): OpenBSD has posix_openpt
nowadays.  (Bug#42059)

Copyright-paperwork-exempt: yes

4 years ago; Auto-commit of loaddefs files.
Glenn Morris [Wed, 1 Jul 2020 13:27:56 +0000 (06:27 -0700)]
; Auto-commit of loaddefs files.

4 years ago; Auto-commit of loaddefs files.
Glenn Morris [Wed, 1 Jul 2020 13:12:10 +0000 (06:12 -0700)]
; Auto-commit of loaddefs files.

4 years agoBind 'C-x 4 1' to 'same-window-prefix' and document new commands (bug#41691)
Juri Linkov [Tue, 30 Jun 2020 21:30:18 +0000 (00:30 +0300)]
Bind 'C-x 4 1' to 'same-window-prefix' and document new commands (bug#41691)

* lisp/window.el (ctl-x-4-map): Bind 'C-x 4 1' to 'same-window-prefix'.

* doc/emacs/windows.texi (Pop Up Window): Add 'C-x 4 4' and 'C-x 4 1'.
* doc/emacs/frames.texi (Creating Frames): Add 'C-x 5 5'.
(Tab Bars): Add 'C-x t t'.

4 years agoAdd a test for lambda list containing uninterned symbols
Andrea Corallo [Tue, 30 Jun 2020 17:14:52 +0000 (19:14 +0200)]
Add a test for lambda list containing uninterned symbols

* test/src/comp-test-funcs-dyn.el
(comp-tests-cl-uninterned-arg-parse-f): New function.

* test/src/comp-tests.el (comp-tests-cl-uninterned-arg-parse-f):
New test.

4 years agoFix lambda-list relocation class
Andrea Corallo [Tue, 30 Jun 2020 17:10:19 +0000 (19:10 +0200)]
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.

4 years agoSubject: Frame-local tab-bar for numeric value of tab-bar-show (bug#42052)
James N. V. Cash [Mon, 29 Jun 2020 23:45:15 +0000 (02:45 +0300)]
Subject: Frame-local tab-bar for numeric value of tab-bar-show (bug#42052)

* lisp/tab-bar.el (tab-bar-new-tab-to): Set frame parameter
tab-bar-lines to 1 when tab-bar-show is the same as number of tabs.
(tab-bar-close-tab, tab-bar-close-other-tabs): Set frame parameter
tab-bar-lines to 0 when tab-bar-show is the same as number of tabs.

Copyright-paperwork-exempt: yes

4 years agoCC Mode: optimize for repeated simple operations.
Alan Mackenzie [Mon, 29 Jun 2020 19:10:09 +0000 (19:10 +0000)]
CC Mode: optimize for repeated simple operations.

Do this by recognising that unterminated strings in a buffer are typically
going to be few and close together.  Also optimize code for C++ attributes.

* lisp/progmodes/cc-defs.el (c-previous-single-property-change): New macro.
(c-put-syn-tab, c-clear-syn-tab): Turned from macros into functions, and moved
to cc-mode.el.
(c-clear-syn-tab-properties): Amended to use c-min/max-syn-tab-mkr.
(c-with-extended-string-fences): Removed.

* lisp/progmodes/cc-engine-el (c-enclosing-c++-attribute): Rewritten for
speed.
(c-slow-enclosing-c++-attribute): Removed.
(c-semi-pp-to-literal): Remove a superfluous call to
c-with-extended-string-fences.

* lisp/progmodes/cc-mode.el (c-min-syn-tab-mkr, c-max-syn-tab-mkr): two new
marker variables which bound the region occupied by positions with
c-fl-syn-tab text properties.
(c-basic-common-init): Initialize these two variables.
(c-fl-syn-tab-region): Removed.
(c-put-syn-tab, c-clear-syn-tab): Functions moved from cc-defs.el.
(c-clear-string-fences): Amended to use the new scheme.
(c-restore-string-fences): Now takes no arguments; amended to use the new
scheme.
(c-font-lock-fontify-region): Amended to use the new scheme.

4 years ago* test/src/fns-tests.el (test-secure-hash): Test getrandom format.
Paul Eggert [Mon, 29 Jun 2020 16:54:45 +0000 (09:54 -0700)]
* test/src/fns-tests.el (test-secure-hash): Test getrandom format.

4 years agoRevert "* src/comp.c (Fcomp__register_subr): Remove code duplication using Fdefalias."
Andrea Corallo [Mon, 29 Jun 2020 15:26:29 +0000 (17:26 +0200)]
Revert "* src/comp.c (Fcomp__register_subr): Remove code duplication using Fdefalias."

This reverts commit 6c7f615ae59b636efe5012f761a25acfd956480d.

4 years agoFix undefined behavior in json.c (Bug#42113)
Philipp Stephani [Mon, 29 Jun 2020 10:32:56 +0000 (12:32 +0200)]
Fix undefined behavior in json.c (Bug#42113)

* src/json.c (lisp_to_json_toplevel_1, Fjson_parse_string): Check
whether input strings are actually strings.

* test/src/json-tests.el (json-parse-string/wrong-type)
(json-serialize/wrong-hash-key-type): New regression tests.

4 years agoUpdate from Gnulib.
Paul Eggert [Sun, 28 Jun 2020 20:22:44 +0000 (13:22 -0700)]
Update from Gnulib.

This incorporates:
2020-06-28 getrandom: do not depend on ‘open’ on mingw
2020-06-28 getrandom: fix compilation errors on older versions of mingw
* build-aux/config.sub, lib/getrandom.c, m4/getrandom.m4:
Copy from Gnulib
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.

4 years ago* Do not skip native compilation for leim subfolder during boostrap
Andrea Corallo [Sun, 28 Jun 2020 19:44:22 +0000 (20:44 +0100)]
* Do not skip native compilation for leim subfolder during boostrap

* lisp/emacs-lisp/comp.el (comp-bootstrap-black-list): Remove
"^leim/".

4 years ago* Enable deferred compilation for dynamic scoped code
Andrea Corallo [Sun, 28 Jun 2020 19:38:13 +0000 (20:38 +0100)]
* Enable deferred compilation for dynamic scoped code

* src/comp.c (maybe_defer_native_compilation): Trigger for dynamic
code and add a comment.

4 years agoMS-Windows fixes as followup to import of Gnulib 'getrandom'
Eli Zaretskii [Sun, 28 Jun 2020 15:26:20 +0000 (18:26 +0300)]
MS-Windows fixes as followup to import of Gnulib 'getrandom'

* nt/mingw-cfg.site (gl_cv_lib_assume_bcrypt): Set to "no" to
disable linking against bcrypt.dll.  (Bug#42095)

* src/gnutls.c (gnutls_rnd) [WINDOWSNT]: Don't define a function
pointer, and don't load it from GnuTLS DLL.
(w32_gnutls_rnd) [WINDOWSNT]: Delete unused function.
* src/fns.c (gnutls_rnd) [WINDOWSNT]: Don't redirect to
w32_gnutls_rnd.

4 years agoMerge remote-tracking branch 'savannah/master' into uninterned
Andrea Corallo [Sun, 28 Jun 2020 14:54:57 +0000 (15:54 +0100)]
Merge remote-tracking branch 'savannah/master' into uninterned

4 years ago* src/comp.c (Fcomp__register_subr): Remove code duplication using Fdefalias.
Andrea Corallo [Sun, 28 Jun 2020 14:38:48 +0000 (15:38 +0100)]
* src/comp.c (Fcomp__register_subr): Remove code duplication using Fdefalias.

4 years agoAdd a test to verify CL macro expansion in dynamic scope
Andrea Corallo [Sun, 28 Jun 2020 12:45:49 +0000 (13:45 +0100)]
Add a test to verify CL macro expansion in dynamic scope

* test/src/comp-tests.el (comp-tests-cl-macro-exp): New test.

* test/src/comp-test-funcs-dyn.el: Require `cl-lib'.
(comp-tests-cl-macro-exp-f): New function.

4 years ago* Setup correctly the printer while dumping objs in native CU (bug#42088)
Andrea Corallo [Sun, 28 Jun 2020 12:33:11 +0000 (13:33 +0100)]
* Setup correctly the printer while dumping objs in native CU (bug#42088)

* src/comp.c (emit_static_object): Bind a bunch of special
variables to setup `prin1-to-string' as
`byte-compile-output-file-form' does.  This to preserve
uninterned symbols.

4 years agoFix ACTION argument of 'display-buffer' call in gud.el
Richard Kim [Tue, 16 Jun 2020 06:20:57 +0000 (23:20 -0700)]
Fix ACTION argument of 'display-buffer' call in gud.el

* lisp/progmodes/gud.el (gud-common-init): The ACTION argument of
'display-buffer' should be a list of list of functions.  (Bug#41888)

4 years agoAdd thread-naming support for OpenBSD
Timo Myyrä [Sun, 28 Jun 2020 08:27:21 +0000 (10:27 +0200)]
Add thread-naming support for OpenBSD

OpenBSD has pthread_set_name_np; FreeBSD appears to have both
this call and pthread_setname_np (the latter call is used in preference).

* configure.ac: Detect pthread_set_name_np.
* sys/systhread.c:
Include <pthread_np.h> and call pthread_set_name_np if available.

4 years agoMerge remote-tracking branch 'savannah/master' into HEAD
Andrea Corallo [Sat, 27 Jun 2020 20:42:16 +0000 (21:42 +0100)]
Merge remote-tracking branch 'savannah/master' into HEAD

4 years agosrc/comp.c (Fcomp__register_subr): Handle advice activation (bug#42038).
Andrea Corallo [Sat, 27 Jun 2020 19:59:22 +0000 (20:59 +0100)]
src/comp.c (Fcomp__register_subr): Handle advice activation (bug#42038).

4 years agoUse getrandom syscall for nonces
Paul Eggert [Sat, 27 Jun 2020 20:02:24 +0000 (13:02 -0700)]
Use getrandom syscall for nonces

* admin/merge-gnulib (GNULIB_MODULES): Add getrandom.
* doc/lispref/text.texi (Format of GnuTLS Cryptography Inputs):
Don’t say that iv-auto uses GNUTLS_RND_NONCE.  Also, don’t say
that it returns the IV’s actual value, as it never has done that.
* src/fns.c, src/sysdep.c: Include sys/random.h, for getrandom.
* src/fns.c (Fsecure_hash_algorithms): Use getrandom so that this
function does not depend on HAVE_GNUTLS3.
* src/sysdep.c: Do not include <gnutls/crypto.h>.
(random_seed) [HAVE_LRAND48]: Can be long int now.
(init_random) [!WINDOWSNT]: Use getrandom syscall instead
of opening /dev/urandom, as this works even on GNU/Linux
hosts that lack /dev/urandom.  Don’t bother with gnutls_rnd
as it’s not needed now that we have getrandom.

4 years agoUpdate from Gnulib
Paul Eggert [Sat, 27 Jun 2020 17:00:17 +0000 (10:00 -0700)]
Update from Gnulib

This incorporates:
2020-06-27 getloadavg: don’t depend on fopen-gnu
2020-06-25 c-dtoastr, c-ldtoastr: new modules
2020-06-01 getloadavg: fix double-increment bug
2020-06-01 tempname: use getrandom, not getentropy
2020-05-31 tempname: merge from glibc and coreutils
2020-05-31 getentropy: work around a macOS and Solaris problem
2020-05-31 fnmatch: merge from glibc
2020-05-30 unistd: remove conflicting declaration of getrandom
2020-05-30 don't assume that UNICODE is not defined
2020-05-29 fix compilation error on native Windows
2020-05-28 avoid dynamic loading of Windows API functions when possible
2020-05-28 at-internal: make more robust in multithreaded applications
2020-05-28 getloadavg: make more robust in multithreaded applications
2020-05-27 getloadavg: make more robust in multithreaded applications
2020-05-26 count-one-bits: fix MSVC specific code
2020-05-25 getentropy, getrandom: new modules
2020-05-24 open, openat: really support O_CLOEXEC
2020-05-23 verify: document ‘assume’ better
2020-05-21 regex: configure better with "clang -fsanitize=leak"
2020-05-21 memmem: configure better with "clang -fsanitize=undefined"
2020-05-19 ftoastr: fix ifndef typo
* build-aux/config.guess, build-aux/config.sub, doc/misc/texinfo.tex:
* lib/count-one-bits.h, lib/ftoastr.c, lib/ftoastr.h:
* lib/getloadavg.c, lib/gettimeofday.c, lib/libc-config.h:
* lib/open.c, lib/openat-proc.c, lib/tempname.c, lib/tempname.h:
* lib/unistd.in.h, lib/verify.h, m4/memmem.m4, m4/regex.m4:
* m4/unistd_h.m4:
Update from Gnulib.
* lib/getrandom.c, lib/sys_random.in.h:
* m4/getrandom.m4, m4/sys_random_h.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.

4 years ago* src/keyboard.c (Fclear_this_command_keys): Doc fix.
Eli Zaretskii [Sat, 27 Jun 2020 08:35:34 +0000 (11:35 +0300)]
* src/keyboard.c (Fclear_this_command_keys): Doc fix.

4 years agoImprove do string of 'man'
Eli Zaretskii [Sat, 27 Jun 2020 07:48:02 +0000 (10:48 +0300)]
Improve do string of 'man'

* lisp/man.el (man): Mention the need to use C-q for quoting the
SPC character in the man-page input.  (Bug#41859)

4 years ago; * src/xdisp.c (pos_visible_p): Yet another minor fix for bug#42039.
Eli Zaretskii [Fri, 26 Jun 2020 19:33:44 +0000 (22:33 +0300)]
; * src/xdisp.c (pos_visible_p): Yet another minor fix for bug#42039.

4 years agoMerge from origin/emacs-27
Glenn Morris [Fri, 26 Jun 2020 14:50:38 +0000 (07:50 -0700)]
Merge from origin/emacs-27

5280e118c0 (origin/emacs-27) ; * src/xdisp.c (pos_visible_p): Fix las...
bb1a9481c9 Fix posn-at-point at beginning of a display string
0c4b033670 Improve documentation of Info node movement commands
632b0119e1 Add Jansson dependency to Windows Build
dbfcdab837 Unbreak 'reverse-region'
c37de84845 Fix typos and markup in fill column indicator docs
f61bff3ee9 ; * CONTRIBUTE: Clarify the preferences for patch formatting.
368e140660 Avoid crashes in 'defconst'
11e3413cff Fix text about Lisp archives in the Emacs FQ
4c81724675 Don't use 'cl' functions in ELisp manual's examples

4 years ago; * src/xdisp.c (pos_visible_p): Fix last change. (Bug#42039)
Eli Zaretskii [Fri, 26 Jun 2020 13:34:50 +0000 (16:34 +0300)]
; * src/xdisp.c (pos_visible_p): Fix last change.  (Bug#42039)

4 years agoFix posn-at-point at beginning of a display string
Eli Zaretskii [Fri, 26 Jun 2020 12:01:44 +0000 (15:01 +0300)]
Fix posn-at-point at beginning of a display string

* src/xdisp.c (pos_visible_p): Account for the line-number width
when the display string at CHARPOS ends in a newline.  (Bug#42039)

4 years ago; Fix recent indentation in project.el
Basil L. Contovounesios [Fri, 26 Jun 2020 08:37:52 +0000 (09:37 +0100)]
; Fix recent indentation in project.el

* lisp/progmodes/project.el (project-ignores, project-find-file-in)
(project-eshell, project--read-project-list): Fix indentation.

4 years agoImprove documentation of Info node movement commands
Eli Zaretskii [Fri, 26 Jun 2020 07:41:09 +0000 (10:41 +0300)]
Improve documentation of Info node movement commands

* lisp/info.el (Info-next, Info-prev, Info-forward-node)
(Info-backward-node): More detailed descriptions of what each
commands does with respect to child and parent nodes.  (Bug#42050)