]> git.eshelyaron.com Git - emacs.git/log
emacs.git
4 years ago* Fix `byte-compile-file' for native compilation (bug#45442)
Andrea Corallo [Sat, 26 Dec 2020 19:16:26 +0000 (20:16 +0100)]
* Fix `byte-compile-file' for native compilation (bug#45442)

* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Fix logic for
native compilation.

4 years agoFix missing float handling into `comp-cstr-set-cmp-range'
Andrea Corallo [Sat, 26 Dec 2020 12:09:24 +0000 (13:09 +0100)]
Fix missing float handling into `comp-cstr-set-cmp-range'

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-cmp-range): Add
float handling.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Update results.

4 years ago* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two more test.
Andrea Corallo [Sat, 26 Dec 2020 11:34:58 +0000 (12:34 +0100)]
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two more test.

4 years ago* Remove unnecessary lhs rename in `comp-ssa-rename-insn'
Andrea Corallo [Sat, 26 Dec 2020 11:23:27 +0000 (12:23 +0100)]
* Remove unnecessary lhs rename in `comp-ssa-rename-insn'

* lisp/emacs-lisp/comp.el (comp-ssa-rename-insn): No point to
rename lhs as it's being replaced.

4 years ago* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Add two functions.
Andrea Corallo [Sat, 26 Dec 2020 11:22:21 +0000 (12:22 +0100)]
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Add two functions.

4 years agoEnable integer range narrowing under compare and branch
Andrea Corallo [Fri, 25 Dec 2020 09:57:02 +0000 (10:57 +0100)]
Enable integer range narrowing under compare and branch

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-cmp-range)
(comp-cstr->, comp-cstr->=, comp-cstr-<, comp-cstr-<=): New
functions.
* lisp/emacs-lisp/comp.el (comp-equality-fun-p)
(comp-range-cmp-fun-p): New functions.
(comp-collect-rhs): Use `comp-assign-op-p' in place of
`comp-set-op-p'.
(comp-negate-range-cmp-fun, comp-reverse-cmp-fun): New functions.
(comp-emit-assume): Rework to be able to emit also comparision
assumption.
(comp-add-cond-cstrs-simple): Update for new `comp-emit-assume'.
(comp-add-cond-cstrs-simple): Update to emit range assumption.
(comp-fwprop-insn): Execute range assumptions.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add tests.

4 years ago* Don't emit byte op-code annotations in LIMPLE to optimize for compile-time
Andrea Corallo [Fri, 25 Dec 2020 08:39:22 +0000 (09:39 +0100)]
* Don't emit byte op-code annotations in LIMPLE to optimize for compile-time

Saves 10~15% in bootstrap time.

* lisp/emacs-lisp/comp.el (comp-op-case): Don't emit op-code
annotaitons.
(comp-limplify-lap-inst, comp-add-cond-cstrs-simple)
(comp-add-cond-cstrs, comp-tco-func): Update accordingly.

4 years ago* Memoize `comp-subtype-p'
Andrea Corallo [Thu, 24 Dec 2020 12:05:30 +0000 (13:05 +0100)]
* Memoize `comp-subtype-p'

* lisp/emacs-lisp/comp-cstr.el (comp-subtype-p): Memoize.
(comp-cstr-ctxt): Add `subtype-p-mem' slot.

4 years ago* Constrain only mvars that are actually used
Andrea Corallo [Thu, 24 Dec 2020 08:14:28 +0000 (09:14 +0100)]
* Constrain only mvars that are actually used

* lisp/emacs-lisp/comp.el (comp-mvar-used-p, comp-collect-mvars)
(comp-collect-rhs): New functions.
(comp-add-cond-cstrs-simple, comp-add-cond-cstrs): Update logic.
(comp-add-cstrs): Call `comp-collect-rhs' before doing anything
else.

4 years ago* Use `comp-assign-op-p' into dead code elimination pass
Andrea Corallo [Thu, 24 Dec 2020 07:52:56 +0000 (08:52 +0100)]
* Use `comp-assign-op-p' into dead code elimination pass

* lisp/emacs-lisp/comp.el (comp-dead-assignments-func): Use
`comp-assign-op-p' in place of `comp-set-op-p'.

4 years ago* Fix logic for constraining block with multiple predecessors
Andrea Corallo [Tue, 22 Dec 2020 21:53:05 +0000 (22:53 +0100)]
* Fix logic for constraining block with multiple predecessors

* lisp/emacs-lisp/comp.el (comp-limple-lock-keywords)
(comp-add-cond-cstrs-target-block): Logic update.

4 years agoSymplify (not t) => nil and (not nil) => t
Andrea Corallo [Tue, 22 Dec 2020 19:39:24 +0000 (20:39 +0100)]
Symplify (not t) => nil and (not nil) => t

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-negation): Symplify (not
t) => nil and (not nil) => t.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests.

4 years agoExtend cstrs pass to match `unless' like code
Andrea Corallo [Tue, 22 Dec 2020 14:00:44 +0000 (15:00 +0100)]
Extend cstrs pass to match `unless' like code

* lisp/emacs-lisp/comp.el (comp-emit-assume): Add assertion.
(comp-add-new-block-between): Fix two typos.
(comp-add-cond-cstrs-target-block): Fix typo.
(comp-add-cond-cstrs-simple): Logic update.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.

4 years ago* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Opencode byte-not.
Andrea Corallo [Tue, 22 Dec 2020 12:04:02 +0000 (13:04 +0100)]
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Opencode byte-not.

4 years agoExtend cstrs pass to match `when' like code
Andrea Corallo [Tue, 22 Dec 2020 09:29:48 +0000 (10:29 +0100)]
Extend cstrs pass to match `when' like code

* lisp/emacs-lisp/comp.el (comp-emit-assume): Better parameter names.
(comp-add-cond-cstrs-simple): New function.
(comp-add-cond-cstrs): Rename assume-target -> block-target.
(comp-add-cstrs): Call `comp-add-cond-cstrs-simple'.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add test.

4 years agoInvert basic block argument order in LIMPLE cond-jump
Andrea Corallo [Tue, 22 Dec 2020 08:57:51 +0000 (09:57 +0100)]
Invert basic block argument order in LIMPLE cond-jump

* lisp/emacs-lisp/comp.el (comp-emit-cond-jump)
(comp-emit-switch, comp-emit-narg-prologue, comp-add-cond-cstrs):
Invert basic block argument order in LIMPLE cond-jump.
* src/comp.c (emit_limple_insn): Likewise.

4 years agoMerge remote-tracking branch 'savannah/master' into HEAD
Andrea Corallo [Wed, 23 Dec 2020 18:49:58 +0000 (19:49 +0100)]
Merge remote-tracking branch 'savannah/master' into HEAD

4 years agoDeclare argument vector as char *const *.
Philipp Stephani [Wed, 23 Dec 2020 16:40:18 +0000 (17:40 +0100)]
Declare argument vector as char *const *.

This matches the signature of execve.

* src/callproc.c (child_setup): Declare NEW_ARGV as char *const *.

4 years ago* .clang-format (ColumnLimit): Fix line length.
Philipp Stephani [Wed, 23 Dec 2020 16:34:26 +0000 (17:34 +0100)]
* .clang-format (ColumnLimit): Fix line length.

4 years agoPass C string pointer to current directory to 'child_setup'.
Philipp Stephani [Wed, 23 Dec 2020 15:26:57 +0000 (16:26 +0100)]
Pass C string pointer to current directory to 'child_setup'.

This avoids the impression that 'child_setup' could do anything
Lisp-related.

* src/callproc.c (child_setup): Pass C pointer to current directory
name.
(call_process): Adapt callers.

* src/process.c (create_process): Adapt callers.

4 years agoNegate only values while constraining variables (bug#45376)
Andrea Corallo [Wed, 23 Dec 2020 14:51:55 +0000 (15:51 +0100)]
Negate only values while constraining variables (bug#45376)

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-value-negation): New
function.
* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Use
`comp-cstr-value-negation'.
* test/src/comp-test-funcs.el (comp-test-45376-1-f): Rename.
(comp-test-45376-2-f): New funcion.
* test/src/comp-tests.el (bug-45376-1): Rename test.
(bug-45376-2): Add test.

4 years ago* Fix non range cstr union operation
Andrea Corallo [Wed, 23 Dec 2020 13:03:54 +0000 (14:03 +0100)]
* Fix non range cstr union operation

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-homogeneous): Add
range parameter and handle the non range case.
(comp-cstr-union-1-no-mem, comp-cstr-intersection-no-mem): Update
`comp-cstr-union-homogeneous' call sites.

4 years agoAllocate environment block before forking.
Philipp Stephani [Wed, 23 Dec 2020 14:55:23 +0000 (15:55 +0100)]
Allocate environment block before forking.

While 'child_setup' carefully avoids calls to async-signal-unsafe
functions like 'malloc', it seems simpler and less brittle to use
normal allocation outside the critical section between 'fork' and
'exec'.

* src/callproc.c (make_environment_block): New function to create the
environment block for subprocesses.  Code largely extracted from
'child_setup' and adapted to use 'xmalloc' instead of 'alloca'.
(child_setup): Remove environment block allocation in favor of
passing the environment block as command-line argument.
(call_process): Adapt to new calling convention.

* src/process.c (create_process): Adapt to new calling convention.

4 years ago* Follow cstr basic blocks to perform latch recognition
Andrea Corallo [Wed, 23 Dec 2020 10:47:36 +0000 (11:47 +0100)]
* Follow cstr basic blocks to perform latch recognition

* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Fix latch
recognition.

4 years agoReject filenames containing NUL bytes.
Philipp Stephani [Wed, 23 Dec 2020 11:00:46 +0000 (12:00 +0100)]
Reject filenames containing NUL bytes.

Such filenames are dangerous, as Emacs would silently only use the
part up to the first NUL byte.  Reject them explicitly instead.

* src/coding.c (encode_file_name_1): New helper function.
(encode_file_name): Check that encoded filename doesn't contain a
NUL byte.
(syms_of_coding): Define 'filenamep' symbol.

* test/src/fileio-tests.el (fileio-tests/null-character): New unit
test.

* etc/NEWS: Document change.

4 years agoRemove an unused parameter from 'child_setup' function.
Philipp Stephani [Wed, 23 Dec 2020 10:43:37 +0000 (11:43 +0100)]
Remove an unused parameter from 'child_setup' function.

* src/callproc.c (child_setup): Remove unused SET_PGRP parameter.

* src/callproc.c (call_process):
* src/process.c (create_process): Fix all callers.

4 years agoMake input constraints into memoization hash immutable (bug#45376)
Andrea Corallo [Wed, 23 Dec 2020 09:46:33 +0000 (10:46 +0100)]
Make input constraints into memoization hash immutable (bug#45376)

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1)
(comp-cstr-intersection): Copy input before soting it into the
memoization hash table.

4 years ago* lisp/emacs-lisp/comp-cstr.el (comp-cstr-copy): Tweak for perf.
Andrea Corallo [Wed, 23 Dec 2020 09:48:29 +0000 (10:48 +0100)]
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-copy): Tweak for perf.

4 years agoShow image as text when trying to search/replace in image buffer (bug#25905)
Juri Linkov [Wed, 23 Dec 2020 09:30:04 +0000 (11:30 +0200)]
Show image as text when trying to search/replace in image buffer (bug#25905)

* lisp/image-mode.el (image-mode-isearch-filter): New function.
(image-mode--setup-mode): Use it to add it as :before-while to
isearch-filter-predicate.

4 years agoImprove the string-limit doc string
Lars Ingebrigtsen [Wed, 23 Dec 2020 06:59:24 +0000 (07:59 +0100)]
Improve the string-limit doc string

* lisp/emacs-lisp/subr-x.el (string-limit): Mention
truncate-string-to-width in the doc string.

4 years agoAllow string-slice to take zero-length matches
Lars Ingebrigtsen [Wed, 23 Dec 2020 06:45:19 +0000 (07:45 +0100)]
Allow string-slice to take zero-length matches

* lisp/emacs-lisp/subr-x.el (string-slice): Allow zero-length
matches.  Code adapted from s.el by Magnar Sveen.

4 years agoRevert recent server.el frame-focus changes
Lars Ingebrigtsen [Wed, 23 Dec 2020 05:58:12 +0000 (06:58 +0100)]
Revert recent server.el frame-focus changes

* lisp/server.el (server-switch-buffer, server-execute): Revert
9cef8fc8cdb5e6e18c9cf617eed3808d67ca340e and
c5f2eb56c0164e87abc881955552e0b718921186.  This change led to
regressions in non-new-frame circumstances.

4 years agoHandle gracefully href="" in base tags in shr
Łukasz Stelmach [Tue, 22 Dec 2020 06:47:23 +0000 (07:47 +0100)]
Handle gracefully href="" in base tags in shr

* net/shr.el (shr-tag-base): shr-parse-base can't handle empty
strings gracefully.  Don't call it unless href is a non-empty
string (bug#45355).

4 years agoFix use of obsolete 'emergency' warning level
Stefan Kangas [Wed, 23 Dec 2020 04:16:02 +0000 (05:16 +0100)]
Fix use of obsolete 'emergency' warning level

* src/alloc.c (display_malloc_warning): Use new style ':emergency'
warning level instead of obsolete 'emergency'.

4 years agoFix use of obsolete 'error' warning level
Zajcev Evgeny [Tue, 22 Dec 2020 14:37:38 +0000 (17:37 +0300)]
Fix use of obsolete 'error' warning level

* src/fileio.c (auto_save_error): Use new style ':error' warning level
instead of obsolete 'error'.

4 years agoUse new NSString lisp methods
Alan Third [Tue, 22 Dec 2020 23:28:25 +0000 (23:28 +0000)]
Use new NSString lisp methods

* src/nsfont.m (ns_otf_to_script):
(ns_registry_to_script):
(ns_get_req_script): Use NSString conversion methods.
* src/nsimage.m ([EmacsImage allocInitFromFile:]): Use NSString
conversion methods.
* src/nsmenu.m (ns_menu_show): Use NSString conversion methods.
* src/nsselect.m (symbol_to_nsstring):
(ns_string_to_pasteboard_internal): Use NSString conversion methods.
* src/nsterm.m (ns_term_init):
([EmacsView initFrameFromEmacs:]): Use NSString conversion methods.
* src/nsxwidget.m (nsxwidget_webkit_uri):
(nsxwidget_webkit_title):
(js_to_lisp): Use NSString conversion methods.
(build_string_with_nsstr): Functionality replaced by NSString
extensions.

4 years agoFix --with-nativecomp Windows build (bug#45303)
Liāu, Kiong-Gē 廖宮毅 [Tue, 22 Dec 2020 19:02:50 +0000 (20:02 +0100)]
Fix --with-nativecomp Windows build (bug#45303)

Liāu, Kiong-Gē 廖宮毅 <gongyi.liao@gmail.com>

* src/comp.c (eln_load_path_final_clean_up): Fix argument order.
* nt/mingw-cfg.site (ac_cv_func_strsignal): Force
`ac_cv_func_strsignal' to no.

Copyright-paperwork-exempt: yes

4 years agoAlign the word "Function" in profiler's headers over the actual functions
Alan Mackenzie [Tue, 22 Dec 2020 18:34:24 +0000 (18:34 +0000)]
Align the word "Function" in profiler's headers over the actual functions

* lisp/profiler.el (profiler-report-render-calltree-1): Replace two
occurrences of "Function" with "  Function".

4 years agoEnsure that Gnus servers are open(able) before searching them
Eric Abrahamsen [Sun, 20 Dec 2020 19:26:37 +0000 (11:26 -0800)]
Ensure that Gnus servers are open(able) before searching them

* lisp/gnus/gnus-search.el (gnus-search-run-search): Imap servers need
to be opened (made into the "current server") before we manipulate the
nnimap-buffer.
(gnus-search-run-search): Sneakily fix regexp.
(gnus-search-indexed-parse-output): We need to pass the server name in
here, otherwise nnmaildir won't know how to make this the "current
server".

4 years agoAlign profiler's header-line-format to column 0, to work correctly on tty's
Alan Mackenzie [Tue, 22 Dec 2020 16:57:46 +0000 (16:57 +0000)]
Align profiler's header-line-format to column 0, to work correctly on tty's

* lisp/profiler.el (profiler-report-header-line-format): Propertize the first
space with 'display '(space :align-to 0).

4 years agoRe-order the items in `profiler-report' output.
Alan Mackenzie [Tue, 22 Dec 2020 12:06:21 +0000 (12:06 +0000)]
Re-order the items in `profiler-report' output.

Putting the usage figures first on the line will eliminate the truncation of
function names.

lisp/profiler.el (profiler-version): Change to "28.1".
(profiler-format): Enhance, so that a width of zero means print the string
without padding or truncation.
(profiler-report-cpu-line-format, profiler-report-memory-line-format): Amend
for the new layout.  The number of places for the cpu samples has been reduced
from 19 to 12 (enough for ~30 years at 1,000 samples per second).
(profiler-report-line-format, profiler-report-describe-entry): Amend for the
new order of arguments to profiler-format.

etc/NEWS (Specialized Modes): Add an entry documenting this change.

doc/lispref/debugging.texi (Profiling): Describe the new ordering of the items
in place of the old ordering.

4 years agoReorganize Tramp header lines
Michael Albinus [Tue, 22 Dec 2020 11:13:37 +0000 (12:13 +0100)]
Reorganize Tramp header lines

* lisp/net/tramp.el: Move header lines Version, Package-Requires,
Package-Type and URL ...
* lisp/net/trampver.el: ... here.

4 years ago; Fix docstrings in last change to subr-x.el
Basil L. Contovounesios [Tue, 22 Dec 2020 09:01:47 +0000 (09:01 +0000)]
; Fix docstrings in last change to subr-x.el

4 years agoFix wdired-get-filename when ls -F marks symlinks
Daniel Martín [Tue, 22 Dec 2020 06:36:41 +0000 (07:36 +0100)]
Fix wdired-get-filename when ls -F marks symlinks

* lisp/wdired.el (wdired-get-filename): In some systems like BSD or
macOS, "ls -F" marks symlinks with a trailing "@".  Add logic
accounting for this so that wdired-get-filename returns the correct
filename.  This change also fixes test "wdired-test-bug34915" on macOS
and BSD systems (bug#34915).

4 years agoMake string-pad take an optional START parameter
Lars Ingebrigtsen [Tue, 22 Dec 2020 05:59:25 +0000 (06:59 +0100)]
Make string-pad take an optional START parameter

* lisp/emacs-lisp/subr-x.el (string-pad): Alter the calling
convention.

4 years agoChange the string-limit parameter semantics
Lars Ingebrigtsen [Tue, 22 Dec 2020 05:54:32 +0000 (06:54 +0100)]
Change the string-limit parameter semantics

* lisp/emacs-lisp/subr-x.el (string-limit): Alter the calling
convention.

4 years agoFurther string-clean-whitespace tweaks
Lars Ingebrigtsen [Tue, 22 Dec 2020 03:24:25 +0000 (04:24 +0100)]
Further string-clean-whitespace tweaks

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Put \r
back, which was mistakenly removed.

4 years ago(ruby-mode-set-encoding): Use 'save-restriction'
Dmitry Gutov [Tue, 22 Dec 2020 01:15:45 +0000 (03:15 +0200)]
(ruby-mode-set-encoding): Use 'save-restriction'

* lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
Use 'save-restriction' (bug#45349).

4 years agoTiny string-clean-whitespace simplification
Basil L. Contovounesios [Mon, 21 Dec 2020 22:34:33 +0000 (22:34 +0000)]
Tiny string-clean-whitespace simplification

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Streamline by
treating replacement string as being literal and having fixed case.

4 years agoMake string-chop-newline more efficient
Lars Ingebrigtsen [Mon, 21 Dec 2020 22:18:05 +0000 (23:18 +0100)]
Make string-chop-newline more efficient

* lisp/emacs-lisp/subr-x.el (string-chop-newline): Make more
efficient.

4 years agoMake string-clean-whitespace work on non-ASCII whitespace, too
Lars Ingebrigtsen [Mon, 21 Dec 2020 21:41:37 +0000 (22:41 +0100)]
Make string-clean-whitespace work on non-ASCII whitespace, too

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Also clean
up non-ASCII whitespace.

4 years agoAdd try-completion to the string shortdoc
Lars Ingebrigtsen [Mon, 21 Dec 2020 21:08:56 +0000 (22:08 +0100)]
Add try-completion to the string shortdoc

* lisp/emacs-lisp/shortdoc.el (string): Mention try-completion here.

4 years agoAdd string-chop-newline
Lars Ingebrigtsen [Mon, 21 Dec 2020 21:05:37 +0000 (22:05 +0100)]
Add string-chop-newline

* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/subr-x.el (string-chop-newline): Add new function.

4 years ago; Fix recent string utility additions
Basil L. Contovounesios [Mon, 21 Dec 2020 20:40:12 +0000 (20:40 +0000)]
; Fix recent string utility additions

* etc/NEWS: Fix typo.
* lisp/emacs-lisp/subr-x.el (string-limit): Fix typos in docstring.
Simplify.
(string-slice): Improve docstring wording.
(string-pad): Simplify.

4 years agoFix shorter-than-length case for string-limit
Lars Ingebrigtsen [Mon, 21 Dec 2020 19:42:17 +0000 (20:42 +0100)]
Fix shorter-than-length case for string-limit

* lisp/emacs-lisp/subr-x.el (string-limit): Fix
shorter-than-length case.

4 years ago* Fix a test in auth-source-tests.el
Andrea Corallo [Fri, 18 Dec 2020 14:22:41 +0000 (15:22 +0100)]
* Fix a test in auth-source-tests.el

* test/lisp/auth-source-tests.el
(auth-source-test-secrets-create-secret): Redefine `read-string'
respecting the original number of arguments.

4 years ago* Fix a bunch of known type specifiers
Andrea Corallo [Sat, 19 Dec 2020 14:11:30 +0000 (15:11 +0100)]
* Fix a bunch of known type specifiers

* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fixes for:
=, string-search, substring.

4 years agoFix `comp-add-call-cstr' and add a test
Andrea Corallo [Sat, 19 Dec 2020 10:56:15 +0000 (11:56 +0100)]
Fix `comp-add-call-cstr' and add a test

* lisp/emacs-lisp/comp.el (comp-add-call-cstr): Fix it.
* test/src/comp-tests.el (assume-in-loop-1): New test.
* test/src/comp-test-funcs.el (comp-test-assume-in-loop-1-f): New
function.

4 years agoFix value type inference for doubly negate constraints
Andrea Corallo [Fri, 18 Dec 2020 17:37:16 +0000 (18:37 +0100)]
Fix value type inference for doubly negate constraints

* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Do not propagate in
case of double negation.
* test/src/comp-test-funcs.el (comp-test-assume-double-neg-f):
New function.
* test/src/comp-tests.el (assume-double-neg): New test.

4 years agoFix native compiler tests when they are bytecompiled
Andrea Corallo [Fri, 18 Dec 2020 16:44:49 +0000 (17:44 +0100)]
Fix native compiler tests when they are bytecompiled

* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-ts)
(comp-cstr-typespec-test, comp-cstr-typespec-tests-alist): Eval
also at compile time.
* test/src/comp-tests.el (comp-tests-type-spec-tests)
(comp-tests-define-type-spec-test): Likewise.

4 years agoSimplify correctly (or (integer 1 1) (not (integer 1 1))) as t
Andrea Corallo [Fri, 18 Dec 2020 16:22:05 +0000 (17:22 +0100)]
Simplify correctly (or (integer 1 1) (not (integer 1 1))) as t

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Logic
update.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.

4 years ago* Guarantee fwprop convergence and termination
Andrea Corallo [Thu, 17 Dec 2020 16:31:22 +0000 (17:31 +0100)]
* Guarantee fwprop convergence and termination

* lisp/emacs-lisp/comp.el (comp-emit-call-cstr): Have new-mvar as
LHS *and* RHS when constraining in and to ensure monotonicity and
fwprop convergence.
(comp-fwprop): Raise a warning for debug reasons in case fwprop
does not converge within 100 iterations.

4 years ago* Allow for overlapping src and dst in cstr set operations
Andrea Corallo [Thu, 17 Dec 2020 21:31:09 +0000 (22:31 +0100)]
* Allow for overlapping src and dst in cstr set operations

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem)
(comp-cstr-union-1, comp-cstr-intersection-no-mem)
(comp-cstr-intersection): Logic update.

4 years agoSymplify type specifier (not t) as nil
Andrea Corallo [Thu, 17 Dec 2020 17:01:10 +0000 (18:01 +0100)]
Symplify type specifier (not t) as nil

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
Add logic.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests.

4 years agoEnhance type inference constraining function arguments
Andrea Corallo [Tue, 15 Dec 2020 22:53:29 +0000 (23:53 +0100)]
Enhance type inference constraining function arguments

* lisp/emacs-lisp/comp.el: Add some commentary.
(comp-cond-cstrs-target-mvar): Rename and update docstring.
(comp-add-cond-cstrs): Update to use
`comp-cond-cstrs-target-mvar'.
(comp-emit-call-cstr, comp-lambda-list-gen, comp-add-call-cstr):
New functions.
(comp-add-cstrs): Call `comp-add-call-cstr'.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Update two
type specifier tests.

4 years ago* Allow for modifying insn-cell inside `comp-loop-insn-in-block'
Andrea Corallo [Tue, 15 Dec 2020 16:45:53 +0000 (17:45 +0100)]
* Allow for modifying insn-cell inside `comp-loop-insn-in-block'

* lisp/emacs-lisp/comp.el (comp-loop-insn-in-block): Update.

4 years ago* Rename comp-cond-cstr into comp-add-cstrs
Andrea Corallo [Tue, 15 Dec 2020 15:57:23 +0000 (16:57 +0100)]
* Rename comp-cond-cstr into comp-add-cstrs

* lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-target-mvar)
(comp-add-cond-cstrs, comp-add-cstrs): Rename comp-cond-cstr
-> comp-add-cstrs.

4 years ago* Two minors in comp.el
Andrea Corallo [Wed, 16 Dec 2020 17:37:39 +0000 (18:37 +0100)]
* Two minors in comp.el

* lisp/emacs-lisp/comp.el (comp-known-func-cstr-h)
(comp-ret-type-spec): Style.

4 years ago* Add a type specifier test to comp-cstr-tests.el
Andrea Corallo [Mon, 21 Dec 2020 17:41:13 +0000 (18:41 +0100)]
* Add a type specifier test to comp-cstr-tests.el

* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.

4 years ago* Enumerate and split type specifier tests in comp-tests.el to ease debug
Andrea Corallo [Mon, 21 Dec 2020 17:39:34 +0000 (18:39 +0100)]
* Enumerate and split type specifier tests in comp-tests.el to ease debug

* test/src/comp-tests.el (comp-tests-type-spec-tests): Enumerate.
(comp-tests-define-type-spec-test): New function.
(comp-tests-define-type-spec-tests): New macro to expand tests.

4 years ago* Improve constraint simplification logic in comp-cstr.el
Andrea Corallo [Wed, 16 Dec 2020 17:41:18 +0000 (18:41 +0100)]
* Improve constraint simplification logic in comp-cstr.el

* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors):
Simplify.
(comp-cstr-empty-p): New Funchion.
(comp-split-pos-neg): Minor.
(comp-normalize-typeset): Logic update.
(comp-union-typesets): Minor.
(comp-intersect-two-typesets): New functio.
(comp-intersect-typesets): Logic update.
(comp-range-union, comp-range-intersection): Minor.
(comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem)
(comp-cstr-intersection-homogeneous)
(comp-cstr-intersection-no-mem, comp-cstr-negation)
(comp-type-spec-to-cstr, comp-cstr-to-type-spec): Logic update.

* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors): Simplify.

4 years agoRename slice-string to string-slice
Lars Ingebrigtsen [Mon, 21 Dec 2020 19:18:57 +0000 (20:18 +0100)]
Rename slice-string to string-slice

* lisp/emacs-lisp/subr-x.el (string-slice): Rename from slice-string.
* doc/lispref/strings.texi (Creating Strings): Ditto.

4 years agoAdd `string-pad'
Lars Ingebrigtsen [Mon, 21 Dec 2020 19:01:28 +0000 (20:01 +0100)]
Add `string-pad'

* doc/lispref/strings.texi (Creating Strings): Document it.
* lisp/emacs-lisp/shortdoc.el (string): Add example.

* lisp/emacs-lisp/subr-x.el (string-pad): New function.

4 years ago* Fix a number of type specifier simplification tests
Andrea Corallo [Wed, 16 Dec 2020 17:40:58 +0000 (18:40 +0100)]
* Fix a number of type specifier simplification tests

* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Fix a number of tests.

4 years ago* Improve comp-fwprop pass
Andrea Corallo [Sun, 13 Dec 2020 11:19:30 +0000 (12:19 +0100)]
* Improve comp-fwprop pass

Wire-up comp-cstr.el routines in fwprop and constraint mvars also on
the else side of branches.

* lisp/emacs-lisp/comp.el (comp-emit-assume)
(comp-cond-cstr-target-mvar, comp-cond-cstr-func)
(comp-fwprop-insn): Logic update.
(comp-mvar-value-vld-p, comp-mvar-propagate, comp-fwprop-call):
Handle neg slot.

4 years agoBeef up the Emacs string utility set a bit
Lars Ingebrigtsen [Mon, 21 Dec 2020 17:53:32 +0000 (18:53 +0100)]
Beef up the Emacs string utility set a bit

* doc/lispref/strings.texi (Modifying Strings): Document them.
* lisp/emacs-lisp/shortdoc.el (string): Add examples.

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace)
(string-fill, string-limit, string-lines, slice-string): New
functions.

4 years agoFix frame creation on X when tool bar is disabled
Eli Zaretskii [Mon, 21 Dec 2020 17:27:02 +0000 (19:27 +0200)]
Fix frame creation on X when tool bar is disabled

* src/xterm.c (handle_one_xevent): Restrict the fix for bug#44002
to situations when we are asked by the WM to create a window with
bogus 1x1 dimensions.  (Bug#44794)

4 years ago* Add mvar pretty print support when dumping LIMPLE
Andrea Corallo [Sun, 13 Dec 2020 17:02:19 +0000 (18:02 +0100)]
* Add mvar pretty print support when dumping LIMPLE

* lisp/emacs-lisp/comp.el (comp-prettyformat-mvar)
(comp-prettyformat-insn): New function.
(comp-log-func): Update to use `comp-prettyformat-insn'.
(comp-finalize-phis): Change LIMPLE phi format to ease
`comp-prettyformat-insn' destructuring.

4 years agoFix permission problem in Tramp's copy-file
Michael Albinus [Mon, 21 Dec 2020 15:37:29 +0000 (16:37 +0100)]
Fix permission problem in Tramp's copy-file

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly):
Take care of PRESERVE-UID-GID.

4 years ago; * src/nsfns.m (all_nonzero_ascii): comment correction
Mattias Engdegård [Mon, 21 Dec 2020 10:24:46 +0000 (11:24 +0100)]
; * src/nsfns.m (all_nonzero_ascii): comment correction

4 years agoDrop XEmacs support for EDE ELisp projects
Stefan Kangas [Mon, 21 Dec 2020 15:22:42 +0000 (16:22 +0100)]
Drop XEmacs support for EDE ELisp projects

* lisp/cedet/ede/proj-elisp.el (ede-proj-target-elisp): Remove
XEmacs support.
(ede-xemacs-compiler): Make obsolete.

4 years agoFix Windows build link-time zlib error (bug#45303)
Andrea Corallo [Mon, 21 Dec 2020 09:20:35 +0000 (10:20 +0100)]
Fix Windows build link-time zlib error (bug#45303)

* src/lisp.h (md5_gz_stream): Declare.
* src/comp.c (accumulate_and_process_md5)
(final_process_md5, md5_gz_stream): Remove.
* src/decompress.c (accumulate_and_process_md5)
(final_process_md5, md5_gz_stream): Move from comp.c.

4 years ago* src/comp.c (eln_load_path_final_clean_up): Fix call arg order (bug#45303).
Andrea Corallo [Mon, 21 Dec 2020 07:45:53 +0000 (08:45 +0100)]
* src/comp.c (eln_load_path_final_clean_up): Fix call arg order (bug#45303).

4 years ago* src/comp.c (Fcomp__compile_ctxt_to_file): Fix sigmask store/restore.
Andrea Corallo [Mon, 21 Dec 2020 07:35:30 +0000 (08:35 +0100)]
* src/comp.c (Fcomp__compile_ctxt_to_file): Fix sigmask store/restore.

4 years agoFix problem with entering Gnus groups when Gnus isn't running
Lars Ingebrigtsen [Mon, 21 Dec 2020 04:55:32 +0000 (05:55 +0100)]
Fix problem with entering Gnus groups when Gnus isn't running

* lisp/gnus/gnus-sum.el (gnus-update-summary-mark-positions):
Don't bug out when Gnus isn't running (bug#45330).

4 years agoMake python-mode fontify more assignment statements
Dario Gjorgjevski [Mon, 21 Dec 2020 04:40:38 +0000 (05:40 +0100)]
Make python-mode fontify more assignment statements

* lisp/progmodes/python.el (python-font-lock-assignment-matcher): New
function to match assignment statements.
(python-rx): Add `assignment-target' and `grouped-assignment-target'.
(python-font-lock-keywords-maximum-decoration): Add new matchers
(bug#45341).

4 years agoGeneric-ify xref-location-column
Dmitry Gutov [Mon, 21 Dec 2020 01:38:37 +0000 (03:38 +0200)]
Generic-ify xref-location-column

* lisp/progmodes/xref.el (xref-location-column):
Create a generic from xref-file-location-column, to use in the
common rendering code (bug#36967).
(xref--insert-xrefs): Update accordingly.

* test/lisp/progmodes/xref-tests.el
(xref-matches-in-directory-finds-two-matches-on-the-same-line)
(xref-matches-in-directory-finds-an-empty-line-regexp-match):
Ditto.

4 years agoDe-duplicate lines in Xref buffers
Juri Linkov [Mon, 21 Dec 2020 01:22:23 +0000 (03:22 +0200)]
De-duplicate lines in Xref buffers

* lisp/progmodes/xref.el (xref--insert-xrefs):
Render matches coming from the same line together (bug#36967).
(xref--item-at-point): Account for the above.

4 years agoUnbreak build after commit 1a0a11f7d2d1dbecb9f754b1e129d50e489058e6.
Philipp Stephani [Sun, 20 Dec 2020 23:17:56 +0000 (00:17 +0100)]
Unbreak build after commit 1a0a11f7d2d1dbecb9f754b1e129d50e489058e6.

The commit only changed a comment in 'struct buffer', so the portable
dumper doesn't need to be adapted.

* src/pdumper.c (dump_buffer): Update hash for 'struct buffer'.

4 years agoFix image cache lookup
Alan Third [Sun, 20 Dec 2020 16:03:52 +0000 (16:03 +0000)]
Fix image cache lookup

* src/image.c (lookup_image): ignore_colors should be false as we want
to search for images with matching colors.

4 years agoRemove unnecessary string conversion
Alan Third [Sun, 20 Dec 2020 15:57:23 +0000 (15:57 +0000)]
Remove unnecessary string conversion

* src/nsfns.m (ns_set_represented_filename): NSString can load List
strings directly now.

4 years agoMerge remote-tracking branch 'savannah/master' into HEAD
Andrea Corallo [Sun, 20 Dec 2020 21:07:48 +0000 (22:07 +0100)]
Merge remote-tracking branch 'savannah/master' into HEAD

4 years agoHave native compiler always preserve multibyte strings (bug#45342)
Andrea Corallo [Sun, 20 Dec 2020 19:53:22 +0000 (20:53 +0100)]
Have native compiler always preserve multibyte strings (bug#45342)

* lisp/emacs-lisp/comp.el (comp-final): Escape multibyte string
when offloading compilation to child process.
* test/src/comp-test-funcs.el (comp-test-45342-f): New function
* test/src/comp-tests.el (bug-45342): New test

4 years ago* lisp/simple.el (goto-line-read-args): Use number-at-point (bug#45199)
Juri Linkov [Sun, 20 Dec 2020 20:05:51 +0000 (22:05 +0200)]
* lisp/simple.el (goto-line-read-args): Use number-at-point (bug#45199)

* lisp/subr.el (goto-char--read-natnum-interactive): Add the value of
point to the end of default values, and move function slightly higher.

4 years ago* Fix missing 'gcc_jit_type_get_const' macro definition (bug#45303).
Andrea Corallo [Sun, 20 Dec 2020 18:49:10 +0000 (19:49 +0100)]
* Fix missing 'gcc_jit_type_get_const' macro definition (bug#45303).

* src/comp.c (gcc_jit_type_get_pointer): Define macro.

4 years agoImprove make-process in Tramp
Michael Albinus [Sun, 20 Dec 2020 18:45:11 +0000 (19:45 +0100)]
Improve make-process in Tramp

* doc/misc/tramp.texi (Remote processes): Remove INSIDE_EMACS
restriction.
(Frequently Asked Questions, External packages): Add indices.

* etc/NEWS: 'start-process-shell-command' and
'start-file-process-shell-command' do not support the old calling
conventions any longer.

* lisp/subr.el (start-process-shell-command)
(start-file-process-shell-command): Remove old calling conventions.

* lisp/net/tramp-compat.el (remote-file-error): Remove, it isn't
necessary.

* lisp/net/tramp.el (tramp-handle-make-process): Remove special shell
handling.  Support environment variables.

* test/lisp/net/tramp-tests.el
(tramp--test--deftest-direct-async-process): Skip for mock method.
(tramp--test-async-shell-command): Suppress `shell-command-sentinel'.
(tramp-test32-shell-command, tramp-test33-environment-variables):
Adapt tests.
(tramp-test32-shell-command-direct-async)
(tramp-test33-environment-variables-direct-async): New tests.

4 years agoInhibit buffer hooks in temporary buffers
Basil L. Contovounesios [Sat, 19 Dec 2020 12:39:45 +0000 (12:39 +0000)]
Inhibit buffer hooks in temporary buffers

Give get-buffer-create an optional argument to inhibit buffer hooks
in internal or temporary buffers for efficiency (bug#34765).

* etc/NEWS: Announce new parameter of get-buffer-create and
generate-new-buffer, and that with-temp-buffer and with-temp-file
now inhibit buffer hooks.

* doc/lispref/buffers.texi (Buffer Names): Fix typo.
(Creating Buffers): Document new parameter of get-buffer-create and
generate-new-buffer.
(Buffer List, Killing Buffers): Document when buffer hooks are
inhibited.
(Current Buffer):
* doc/lispref/files.texi (Writing to Files): Document that
with-temp-buffer and with-temp-file inhibit buffer hooks.
* doc/lispref/internals.texi (Buffer Internals): Document
inhibit_buffer_hooks flag.  Remove stale comment.
* doc/misc/gnus-faq.texi (FAQ 5-8):
* lisp/simple.el (shell-command-on-region): Fix indentation.

* lisp/files.el (kill-buffer-hook): Document when hook is inhibited.
(create-file-buffer):
* lisp/gnus/gnus-uu.el (gnus-uu-unshar-article):
* lisp/international/mule.el (load-with-code-conversion):
* lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image):
* lisp/net/imap.el (imap-open):
* lisp/net/mailcap.el (mailcap-maybe-eval):
* lisp/progmodes/flymake-proc.el
(flymake-proc--read-file-to-temp-buffer)
(flymake-proc--copy-buffer-to-temp-buffer): Simplify.

* lisp/subr.el (generate-new-buffer): Forward new optional argument
to inhibit buffer hooks to get-buffer-create.
(with-temp-file, with-temp-buffer, with-output-to-string):
* lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer
used.

* src/buffer.c (run_buffer_list_update_hook): New helper function.
(Fget_buffer_create): Use it.  Add optional argument to set
inhibit_buffer_hooks flag instead of comparing the buffer name to
Vcode_conversion_workbuf_name.  All callers changed.
(Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal)
(record_buffer): Use run_buffer_list_update_hook.
(Fkill_buffer): Document when buffer hooks are inhibited.  Use
run_buffer_list_update_hook.
(init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer.
(Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document
when hooks are inhibited.
* src/buffer.h (struct buffer): Update inhibit_buffer_hooks
commentary.
* src/coding.h (Vcode_conversion_workbuf_name):
* src/coding.c (Vcode_conversion_workbuf_name): Make static again
since it is no longer needed in src/buffer.c.
(code_conversion_restore, code_conversion_save, syms_of_coding):
Prefer boolean over integer constants.
* src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in
" *code-converting-work*" buffer.
* src/window.c (Fselect_window): Fix grammar.  Mention
window-selection-change-functions alongside buffer-list-update-hook.

* test/src/buffer-tests.el: Fix requires.
(buffer-tests-inhibit-buffer-hooks): New test.

4 years agoimage-cache-size improvements
Mattias Engdegård [Sat, 19 Dec 2020 15:47:32 +0000 (16:47 +0100)]
image-cache-size improvements

Implement for non-Cairo X11 and NS.  Count masks as well, and
XImage objects on X11.

* src/image.c (image_size_in_bytes): New.
(image_frame_cache_size): Use image_size_in_bytes.
* src/nsterm.h:
* src/nsimage.m (ns_image_size_in_bytes, [EmacsImage sizeInBytes]):
New function and method.
* src/w32gui.h:
* src/w32term.c (w32_image_size): Update signature.

4 years agoFix default value of gnus-registry-register-all: should be t
Eric Abrahamsen [Sat, 19 Dec 2020 23:25:14 +0000 (15:25 -0800)]
Fix default value of gnus-registry-register-all: should be t

* lisp/gnus/gnus-registry.el (gnus-registry-register-all): This was
meant to default to t; only an oversight during code review left it as
nil.

4 years agoJamie Beardslee <beardsleejamie@gmail.com>
Dmitry Gutov [Sat, 19 Dec 2020 22:16:32 +0000 (00:16 +0200)]
Jamie Beardslee <beardsleejamie@gmail.com>

* lisp/progmodes/project.el (project-execute-extended-command):
New command.
(project-prefix-map): Binding for it.

Copyright-paperwork-exempt: yes