Glenn Morris [Wed, 6 Oct 2021 14:50:33 +0000 (07:50 -0700)]
Merge from origin/emacs-28
1ccd3eb721 (origin/emacs-28) ; Fix typo in etc/NEWS 0f28ee94ac * NEWS: Mention rcirc connects to #emacs by default aacafbe267 Refactor mh-utils-tests macro 'with-mh-test-env' ead5c5cc51 Avoid using variable before it has been initialized b2c50d7cf3 Clarify docstring of blink-matching-paren d2a34cabcf ; Very minor touch-up to a recent change 36a7ce4393 ; * doc/emacs/trouble.texi (After a Crash): Fix typo. 1cd1b2835b * doc/misc/gnus.texi (Loose Threads): Use regexp-opt in ex... 9f041cdfac Bump project.el version ad2287e659 Retain compatibility with older project.el projects d86b2e59c7 native-comp-available-p is the definitive test 1b383ac424 Minor fix of a recently installed documentation change 4d76765b6c Fix md5 issue in recent Gnulib merge 18308b739a Tweak recent 'configure' fix
Arash Esbati [Wed, 6 Oct 2021 09:14:45 +0000 (11:14 +0200)]
Improve finding external documents in reftext
* lisp/textmodes/reftex-parse.el (reftex-parse-from-file): Extend
regexp in order to support \externalcitedocument macro and a
second optional argument provided by LaTeX package xr-hyper
(bug#51054).
Yuri D'Elia [Wed, 6 Oct 2021 08:43:22 +0000 (10:43 +0200)]
Perform cleanup on errors in mouse-drag-track
* lisp/mouse.el (mouse-drag-track): Disable both scroll-margin and
auto-hscroll-mode in mouse-drag-region and do not re-enable them until
dragging is over, making selections work as expected when inside the
margins.
* lisp/mouse.el (mouse-drag-track): Correctly reset original values
changed during execution if errors occur.
Yuri D'Elia [Wed, 6 Oct 2021 08:42:56 +0000 (10:42 +0200)]
Improve interaction between mouse-drag-region and scroll-margin
* lisp/mouse.el (mouse-drag-track): Disable both scroll-margin and
auto-hscroll-mode in mouse-drag-region and do not re-enable them until
dragging is over, making selections work as expected when inside the
margins.
Stephen Gildea [Wed, 6 Oct 2021 03:32:59 +0000 (20:32 -0700)]
Refactor mh-utils-tests macro 'with-mh-test-env'
* test/lisp/mh-e/mh-utils-tests.el (with-mh-test-env): Refactor to
reduce the size of the expanded macro.
(mh-test-utils-setup): New helper function.
(mh-ensure-native-trampolines): Absorbed by mh-test-utils-setup.
Dmitry Gutov [Tue, 5 Oct 2021 02:45:09 +0000 (05:45 +0300)]
Retain compatibility with older project.el projects
* lisp/progmodes/xref.el (xref--analyze):
Retain compatibility with older project.el and its compatible
project definitions (for standalone Xref from ELPA).
Stephen Gildea [Tue, 5 Oct 2021 16:15:57 +0000 (09:15 -0700)]
native-comp-available-p is the definitive test
* doc/lispref/compile.texi (Native Compilation): Document
native-comp-available-p as the way to test for native compilation.
* lisp/emacs-lisp/package.el (package--native-compile-async):
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
Test for native compilation with native-comp-available-p.
Thank you to Andrea Corallo for reviewing this patch.
Paul Eggert [Tue, 5 Oct 2021 16:08:02 +0000 (09:08 -0700)]
Fix md5 issue in recent Gnulib merge
When configured --with-native-compilation, Emacs needs md5_stream.
Problem reported by Andy Moreton (Bug#50985#23).
* admin/merge-gnulib (GNULIB_MODULES): Add crypto/md5,
needed for --with-native-compilation.
(AVOIDED_MODULES): Avoid crypto/af_alg, since Emacs doesn’t
need to bother with kernel-supported cryptography algorithms.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate by running admin/merge-gnulib.
* lib/md5-stream.c: New file, copied from Gnulib.
Glenn Morris [Tue, 5 Oct 2021 14:50:22 +0000 (07:50 -0700)]
Merge from origin/emacs-28
63abe976ce (origin/emacs-28) Document minibuffer-default-prompt-forma... b5afbedc90 Backward compatibility option for 'nobreak-char-display' ea1b728a06 ; * lisp/dired.el: Fix typo. 984eafeb98 Unbreak the build after Gnulib update 5946370cd1 Check, whether an FUSE mount has been broken in Tramp 90575a6c0c Disable 'nobreak-char-display' in Eldoc buffers 570e2c9a17 Fix small error in comint-send-input fd7bb31412 Update documentation of search-whitespace-regexp 1f4ced47a1 Fix cc-compat.el syntax error b431f54c1b Mention `seq-uniq' in `delete-dups' documentation 0a7bab689c ; Minor stylistic fixes found by checkdoc e2861e2d08 ; * etc/NEWS: Fix typo. 1a65d49931 Port recent Gnulib changes to MS-Windows 68a256c892 Update from Gnulib 63cb65dcce * Fix mh tests for native comp builds (bug#50975) e606cc6f40 * Fix `batch-native-compile' not to spawn a subprocess 894dfe70da Fix native-compilation build from tarball on Cygwin 2ce5e08058 Remove U+FE0F from script-representative-chars
* doc/misc/ert.texi (erts files): Indent examples with spaces rather
than tabs, since Texinfo treats tab characters as a single space;
see (info "(texinfo) @example"). Fix typos/thinkos.
Eli Zaretskii [Tue, 5 Oct 2021 14:12:49 +0000 (17:12 +0300)]
Backward compatibility option for 'nobreak-char-display'
* src/xdisp.c (syms_of_xdisp) <nobreak-char-ascii-display>: New
variable.
(get_next_display_element): If 'nobreak-char-ascii-display' is
non-nil, display non-ASCII space and hyphen characters as their
ASCII equivalents. (Bug#50983)
Stefan Kangas [Tue, 5 Oct 2021 13:17:41 +0000 (15:17 +0200)]
Make two old function aliases obsolete
* lisp/textmodes/bibtex.el (bibtex-find-crossref)
(bibtex-find-entry): Make function aliases obsolete. These were left
behind when renaming functions, but never declared obsolete.
Stefan Kangas [Tue, 5 Oct 2021 12:43:11 +0000 (14:43 +0200)]
Set advertised calling convention on make-face-* functions
* lisp/faces.el (make-face-bold, make-face-unbold)
(make-face-italic, make-face-unitalic, make-face-bold-italic):
Use `advertised-calling-convention` to avoid promoting the third
_noerror argument; it has been ignored since 1999.
Michael Albinus [Tue, 5 Oct 2021 09:27:48 +0000 (11:27 +0200)]
Check, whether an FUSE mount has been broken in Tramp
* lisp/net/tramp-fuse.el (tramp-fuse-mount-timeout): New defconst.
(tramp-fuse-mounted-p): Use it. Check for a file property instead
of a connection property.
(tramp-fuse-unmount): Dito.
* lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection):
Do not trust existence of a process, whether the volume is mounted.
* lisp/subr.el (define-keymap, define-keymap--define): Change how
these functions call each other.
(defvar-keymap): Change interface to be more like `define-keymap'.
* lisp/emacs-lisp/lisp-mode.el (lisp-indent--defvar-keymap): Remove.
(lisp-indent-function): Don't use it.
Daniel Martín [Tue, 5 Oct 2021 07:37:56 +0000 (09:37 +0200)]
Update documentation of search-whitespace-regexp
* doc/emacs/search.texi (Lax Search): Update the documentation about
the default value of search-whitespace-regexp, as it is now
independent of the major mode's syntax table (bug#51020).
In term-mode, handle ANSI codes, specifying italic and other modes
* etc/e/eterm-color.ti: Add new capabilities
* lisp/term.el: New faces and variables to support new ANSI modes.
(term-termcap-format): Add new capabilities
(term-emulate-terminal): When saving cursor, additionally save the new
variables.
(term--handle-colors-list): Handle ANSI codes, specifying italic other
modes.
* test/lisp/term-tests.el (ansi-test-strings): Adjust tests.
Add support for 256-color and 24bit ANSI colors in term-mode
(term-ansi-face-already-done): Make obsolete
(term--maybe-brighten-color): Remove
(term--color-as-hex): New function
(term-handle-colors-array): Make obsolete in favour of the new
function 'term--handle-colors-list'.
(term--handle-colors-list): New function, that can also handle ANSI
codes 38 and 48.
(term-handle-ansi-escape): Use it
* test/lisp/term-tests.el (ansi-test-strings): Add tests for 256-color
and 24bit ANSI colors
Miha Rihtaršič [Tue, 5 Oct 2021 06:53:36 +0000 (08:53 +0200)]
Add support for 256-color and 24bit ANSI colors in ansi-color
* lisp/ansi-color.el (ansi-color--code-as-hex): New function to
convert from 256-color and 24-bit ANSI codes.
(ansi-color--face-vec-face): Add support for ANSI color codes greater
than 16
(ansi-color--update-face-vec): Add support for ANSI codes 38 and 48
which can specify 256-color and 24bit ANSI colors.
* test/lisp/ansi-color-tests.el (ansi-color-tests--strings): Add tests
for ANSI codes 38 and 34
Miha Rihtaršič [Tue, 5 Oct 2021 06:47:07 +0000 (08:47 +0200)]
Optimize ansi-color.el
(ansi-color-context-region):
(ansi-color-context): Adjust doc string to the new format of
ansi-color context.
(ansi-color--find-face): Rename to ansi-color--face-vec-face
(ansi-color--face-vec-face): Adjust to the new format ansi-color
context.
(ansi-color-filter-apply):
(ansi-color-apply):
(ansi-color-filter-region):
(ansi-color-apply-on-region): Adjust to the new format of ansi-color
context in order to speed these functions up.
(ansi-color-apply-sequence): Make it obsolete.
(ansi-color--update-face-vec): New function to handle the new format
of ansi-color context.
(ansi-color-get-face-1): Make obsolete as this function isn't used any
more (bug#50806).
* lisp/emacs-lisp/memory-report.el (memory-report--type-size):
Default to nil so that the test in `memory-report-object-size' works.
(memory-report--set-size): Initialize
memory-report-object-size.
Paul Eggert [Mon, 4 Oct 2021 19:11:39 +0000 (12:11 -0700)]
Port recent Gnulib changes to MS-Windows
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_free-posix)
(OMIT_GNULIB_MODULE_malloc-posix)
(OMIT_GNULIB_MODULE_realloc-gnu)
(OMIT_GNULIB_MODULE_realloc-posix):
New macros, since we don’t want these modules on MS-Windows.
* src/w32heap.c (heap_alloc, heap_realloc): New functions.
(malloc_after_dump, realloc_after_dump, realloc_before_dump):
Use them.
Paul Eggert [Mon, 4 Oct 2021 19:11:39 +0000 (12:11 -0700)]
Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
Andrea Corallo [Mon, 4 Oct 2021 20:47:30 +0000 (22:47 +0200)]
* Fix mh tests for native comp builds (bug#50975)
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
New function.
(mh-test-utils-setup-with-mocks)
(mh-test-utils-setup-with-variant): Use it.
Andrea Corallo [Mon, 4 Oct 2021 19:15:02 +0000 (21:15 +0200)]
* Fix `batch-native-compile' not to spawn a subprocess
* lisp/emacs-lisp/comp.el (comp-running-batch-compilation): New var.
(comp-final): Use it.
(batch-native-compile): Bind `comp-running-batch-compilation' it.
Robert Pluim [Mon, 4 Oct 2021 17:11:15 +0000 (19:11 +0200)]
Remove U+FE0F from script-representative-chars
* lisp/international/fontset.el (script-representative-chars): Remove
U+FE0F / VS-16 from the 'emoji' entry. It could cause us to skip
fonts that don't have a glyph for it, even though we don't actually
need one.
* lisp/emacs-lisp/ert.el (ert-deftest, ert--run-test-internal):
Use t rather than the ambient file value for `lexical-binding` to
avoid bad lexbind coverage by mistake.
Allow computing :doc-spec info-look elements at run time
* lisp/info-look.el (info-lookup--expand-info): New function.
(:mode, info-lookup-add-help): Adjust doc string.
(info-lookup-add-help*): Allow adding a dynamic expansion.
(info-lookup): Expand.
(:mode): Use a dynamic expansion for Python to postpone the lookup.
(info-complete): Expand.