Andrea Corallo [Sun, 15 Nov 2020 22:31:00 +0000 (23:31 +0100)]
Fix nativecomp cond-rw pass
* lisp/emacs-lisp/comp.el (comp-mvar-symbol-p): Improve it.
(comp-cond-rw-func): Fix logic for multiple predecessor on target
block.
* test/src/comp-tests.el (comp-test-cond-rw-1): New test.
* test/src/comp-test-funcs.el (comp-test-cond-rw-1-1-f)
(comp-test-cond-rw-1-2-f): New functions.
Andrea Corallo [Sat, 14 Nov 2020 16:38:05 +0000 (17:38 +0100)]
Add `comp-constraint-to-type-spec' and better handle boolean type spec
* lisp/emacs-lisp/comp.el (comp-constraint-to-type-spec): New
function splitting out code from comp-ret-type-spec + better
handle boolean type specifier.
(comp-ret-type-spec): Rework to leverage
`comp-constraint-to-type-spec'.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a
testcase.
Andrea Corallo [Sat, 14 Nov 2020 15:45:50 +0000 (16:45 +0100)]
Handle correctly quoting in *Native-compile-Log* buffer
* lisp/emacs-lisp/comp.el (comp-log): Add `quoted' parameter and
pass it to `comp-log-to-buffer'.
(comp-log-to-buffer): Add `quoted' parameter and leverage `prin1'
or `princ' accordingly.
Andrea Corallo [Sat, 14 Nov 2020 10:24:30 +0000 (11:24 +0100)]
* Fix debug symbol emission
* src/comp.c (Fcomp__compile_ctxt_to_file): Now that we do not
rely anymore on globlal variables move logic in from
'Fcomp__init_ctxt' so comp.debug is already set correctly.
Andrea Corallo [Thu, 12 Nov 2020 16:27:31 +0000 (17:27 +0100)]
Characterize functions in terms of type specifiers
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): New const
in place of `comp-known-ret-types' and `comp-known-ret-ranges'.
(comp-constraint): New struct to separate the constraint side of
an mvar.
(comp-constraint-f): Analogous for functions.
(comp-mvar): Rework and include `comp-constraint'.
(comp-type-spec-to-constraint): New function.
(comp-known-constraints-h): New const.
(comp-func-ret-typeset, comp-func-ret-range): Rework.
(comp-fwprop-insn): Fix.
* test/src/comp-tests.el (destructure-type-spec): New testcase.
Eli Zaretskii [Sat, 14 Nov 2020 13:02:13 +0000 (15:02 +0200)]
Make Calc windows dedicated by default
* lisp/calc/calc.el (calc-make-windows-dedicated): New defcustom.
(calc, calc-trail-display): Set Calc windows dedicated if
calc-make-windows-dedicated is non-nil. Patch by Boruch Baum
<boruch_baum@gmx.com>. (Bug#44108)
Eli Zaretskii [Sat, 14 Nov 2020 12:43:42 +0000 (14:43 +0200)]
Make 'prefer-utf-8' heed inhibit-*-detection variables
* lisp/international/mule-conf.el (prefer-utf-8): Inhibit
detection of null bytes and ISO escape sequences if the respective
inhibit-*-detection variables say so. (Bug#44486)
Jared Finder [Sun, 1 Nov 2020 05:25:47 +0000 (21:25 -0800)]
Face-changing text properties and help-echo now work with xterm-mouse.
* src/dispnew.c (update_mouse_position): New function for mouse
movement logic in 'handle_one_term_event' that can be shared across
different mouse backends.
(display--update-for-mouse-movement): New lisp function, call it.
* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function
that calls 'display--update-for-mouse-movement'.
(xterm-mouse-translate-1): Call it.
* src/term.c (handle_one_term_event): Inline logic from
'term_mouse_movement' and call 'update_mouse_position'.
(term_mouse_movement): Delete.
Eric Abrahamsen [Wed, 11 Nov 2020 18:48:37 +0000 (10:48 -0800)]
Save instantiated gnus-search engines in an alist
So we aren't re-instantiating (and potentially configuring) them with
every search.
* lisp/gnus/gnus-search.el (gnus-search-engine-instance-alist): New
variable holding server->engine mapping.
(gnus-search-server-to-engine): See if we've already instantiated this
server. If so, return it. If not, instantiate it and save in the above
variable.
(gnus-search-shutdown): Shutdown function clearing the above alist.
Eric Abrahamsen [Fri, 13 Nov 2020 04:02:09 +0000 (20:02 -0800)]
Make sure Gnus search groups search topics recursively
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): If a search is initiated from
a topic line, make sure we get all the groups under that topic (and
under sub-topics).
* lisp/international/ucs-normalize.el
(quick-check-composition-list-to-regexp): Don't add an explicit
pattern for U+1161..U+1175 and U+11a8..U+11c2 since these are already
part of `combining-chars'.
Michael Albinus [Fri, 13 Nov 2020 15:55:08 +0000 (16:55 +0100)]
Some minor Tramp fixes, resulting from test campaign
* lisp/net/tramp.el (tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use `current-time'
if needed.
* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping):
(tramp-gvfs-do-copy-or-rename-file): Remove "gvfs-rename", it is
not trustworthy.
* test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p): Check also for
symlinked files in trash.
(tramp-test20-file-modes): Revert last change, it was a thinko.
Robert Pluim [Thu, 12 Nov 2020 15:51:49 +0000 (16:51 +0100)]
Emit required version when Harfbuzz is not found but Cairo is
* configure.ac: Define harfbuzz_required_ver with required
harfbuzz version, and put it in the warning message emitted when
Cairo is found but not HarfBuzz.
* lisp/progmodes/project.el (project-find-file): Don't say
anything about recognizing file names, as that may lead the user
to think that it'll check whether the string at point is an
existing file (bug#44588).
Stefan Kangas [Mon, 9 Nov 2020 21:23:04 +0000 (22:23 +0100)]
Fix mistake in describe-buffer-bindings
* src/keymap.c (Fdescribe_buffer_bindings): Fix a call in
describe-buffer-bindings. This fixes a mistake in my previous commit
to prefer the Lisp version of describe-map-tree (8a1441310aa1), where
0 was accidentally converted to Qt in two places.
Andrea Corallo [Wed, 11 Nov 2020 16:59:46 +0000 (17:59 +0100)]
* Nativecomp testsuite rework for derived return type specifiers
As we have derived return type specifiers as some test for them. Also
rewrite some propagation related test using return type specifiers too
as it's way more convenient.
* test/src/comp-tests.el (fw-prop-1): Nit rename.
(comp-tests-check-ret-type-spec): New function.
(comp-tests-type-spec-tests): New variable.
(comp-tests-cond-rw-0-var) Remove variable.
(cond-rw-0, cond-rw-1, cond-rw-2, cond-rw-3, cond-rw-4, cond-rw-5)
Remove tests as now covered by `comp-tests-check-ret-type-spec'.
Andrea Corallo [Tue, 10 Nov 2020 17:58:56 +0000 (18:58 +0100)]
* Add to elisp-mode `emacs-lisp-native-compile-and-load'
* lisp/progmodes/elisp-mode.el
(emacs-lisp--before-compile-buffer): New function.
(emacs-lisp-byte-compile-and-load): Use the previous.
(emacs-lisp-native-compile-and-load): New function.
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Undo the add
of fixnum and bignum as unnecessary.
* test/src/comp-tests.el
(comp-tests-mentioned-p-1, comp-tests-cond-rw-checker-val)
(comp-tests-cond-rw-checker-type, cond-rw-1, cond-rw-2)
(cond-rw-3, cond-rw-4, cond-rw-5): Update for new type interface.
(range-simple-union, range-simple-intersection): New integer range
tests.
(union-types): New union type test.
Andrea Corallo [Sun, 8 Nov 2020 09:40:05 +0000 (10:40 +0100)]
* Rename two nativecomp functions
* lisp/emacs-lisp/comp.el (comp-function-foldable-p): Rename from
comp-function-optimizable-p.
(comp-function-call-maybe-fold): Same from
comp-function-call-maybe-fold.
Eli Zaretskii [Wed, 11 Nov 2020 19:46:43 +0000 (21:46 +0200)]
Avoid crashes in the daemon due to user interaction
* src/minibuf.c (read_minibuf): Avoid crashes in the daemon if the
init file invokes some kind of minibuffer interaction, by not
updating the selected frame if it's the initial frame.
(Bug#44583)
Juri Linkov [Wed, 11 Nov 2020 19:18:31 +0000 (21:18 +0200)]
In dired-query use read-char-from-minibuffer with bound help-char (bug#42708)
* lisp/dired-aux.el (dired-query): Replace read-char-choice call
with read-char-from-minibuffer.
* lisp/subr.el (read-char-choice): Restore the previous version
that uses read-key.
(read-char-from-minibuffer): Bind help-char to help-form-show
when help-form is non-nil.
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): `symbol-name'
should not be quantified by a `+' as it is redundant and performs
very badly (bug#44572).
* lisp/cedet/semantic.el (semantic-submode-list):
(semantic-default-submodes): Remove mention of
global-cedet-m3-minor-mode, which no longer exists, apparently
(bug#44565).
Fix font lock of assignments with type hints in Python
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Fix regular
expressions for font lock of assignments with type hints (bug#44568).
The font lock of assignments with type hints in Python is rather bad.
Consider the following example:
As things stand right now, only ‘var1’ would be highlighted. To make
things worse, the ‘Mapping’ type hint of ‘var2’ would also be
highlighted, which is entirely incorrect.
This commit makes all of ‘var1’ through ‘var5’ be highlighted
correctly.
Harald Jörg [Wed, 11 Nov 2020 09:42:44 +0000 (10:42 +0100)]
Cleanup of the test file for cperl-mode
* test/lisp/progmodes/cperl-mode-tests.el
(cperl--run-test-cases): New macro, factored out from various
indentation / rewriting tests. Contains documentation of the
format used by the cperl-mode-resources files.
(cperl-test-bug-19709): Replace 'next-line' by 'forward-line'.
(cperl-test-indent-exp),
(cperl-test-indent-styles),
(cperl-test-bug-30393): Use the new macro.
(cperl-test-bug-19709): Make fit for Emacs 26.
(cperl-test-indent-styles): Skip for Perl mode (bug#44561).
(server--create-frame): New function, extracted from
`server-create-dumb-terminal-frame`.
(server-create-window-system-frame, server-create-tty-frame):
(server-create-dumb-terminal-frame): Use it.
Eliza Velasquez [Wed, 11 Nov 2020 03:14:03 +0000 (22:14 -0500)]
* lisp/server.el: Fix frame creation on dumb terminals (bug#25547)
(server-create-dumb-terminal-frame): New function.
(server-process-filter): Use it.
(server-delete-client): Don't delete tty terminal when it's not
exclusive to this client.
Juri Linkov [Tue, 10 Nov 2020 19:27:37 +0000 (21:27 +0200)]
Don't set file name variable in org-element-parse-secondary-string (bug#44524)
* lisp/org/org-element.el (org-element-parse-secondary-string):
Don't set buffer-local variables buffer-file-name and buffer-file-truename
in temporary buffer.
Tom Fitzhenry [Mon, 9 Nov 2020 11:19:10 +0000 (22:19 +1100)]
Remove extra process call from vc-hg-registered
Prefer vc-state to benefit from its caching (bug#44534)
This same technique is used in vc-git.el,
per commit 2018-06-28 "Remove extra process call from vc-git-find-file-hook" 93c41ce6aa64b14fc9bd7bdd0d909915a79191cd.
* lisp/vc/vc-hg.el (vc-hg-registered): Use vc-state rather than vc-hg-state.
Andrew G Cohen [Tue, 10 Nov 2020 00:19:43 +0000 (08:19 +0800)]
Remove ephemeral group on error or null result
* lisp/gnus/nnselect.el (nnselect-request-group): If an ephemeral
group is empty, there is nothing to see, so remove the group.
(nnselect-run): Catch and return an empty artlist on error.
Fix undefined behavior when fetching glyphs from the display vector.
You can trigger this rather obscure bug by enabling selective display
if the second glyph in its display vector has an invalid face. For
example, evaluate
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Use with-no-warnings
instead of with-suppressed-warnings which complains when running
the test interactively.
Eli Zaretskii [Mon, 9 Nov 2020 15:35:52 +0000 (17:35 +0200)]
Fix compilation of image.c on MS-Windows
This is a followup to last change in image.c.
* src/image.c (rsvg_handle_get_intrinsic_dimensions): Define to
call fn_rsvg_handle_get_intrinsic_dimensions.
(svg_css_length_to_pixels): Compile only for librsvg >= 2.46.0, as
RsvgLength type was not defined before.
Eli Zaretskii [Mon, 9 Nov 2020 15:22:25 +0000 (17:22 +0200)]
Avoid breaking Arabic shaping in 'window-text-pixel-size'
* src/xdisp.c (CHAR_COMPOSED_P): If the bidi_p flag is not set,
pass -1 to composition_reseat_it, so that the shaping engine will
figure out the directionality of the text. This is important,
e.g., when using move_it_* functions in some context that is not
redisplay, such as 'window-text-pixel-size'. (Bug#44521)
Alan Third [Sat, 31 Oct 2020 15:14:34 +0000 (15:14 +0000)]
Fix crash in ns_mouse_position (bug#44313)
* src/nsterm.m (ns_destroy_window): Close the window before freeing
the frame resources so we don't end up accessing the frame struct
after it's been freed.