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.
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)
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.
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).
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.
Paul Eggert [Mon, 4 Oct 2021 03:30:26 +0000 (20:30 -0700)]
Add safety check in x_menu_show
* src/xmenu.c (x_menu_show): Explicitly check whether save_wv can
be null here. Looks like it can be but I am not 100% sure, so
play it safe and add a FIXME comment.
Paul Eggert [Mon, 4 Oct 2021 03:11:57 +0000 (20:11 -0700)]
Tweak x_connection_closed when I/O error
* src/xterm.c (x_connection_closed): Don’t dereference dpyinfo
in the unlikely case where it is null and ioerror is true.
This pacifies gcc 11.2.1 -Wanalyzer-null-dereference.
Stefan Kangas [Sun, 3 Oct 2021 23:08:03 +0000 (01:08 +0200)]
Don't use some obsolete names in documentation
* admin/notes/bugtracker: Use non-obsolete name
'mail-dont-reply-to-names'.
* admin/notes/multi-tty: Mention new variable name
'x-selection-value'.
* doc/lispintro/emacs-lisp-intro.texi (Point and mark)
(Point and mark, Design @value{COUNT-WORDS}): Avoid using obsolete
name 'count-lines-region'.
* doc/lispref/hooks.texi (Standard Hooks): Remove reference to
obsolete abnormal hook 'completion-annotate-function'.
* doc/misc/efaq.texi (SPC no longer completes file names): Remove
reference to obsolete 'minibuffer-local-filename-must-match-map';
setting it has no effect.
* doc/misc/gnus.texi (NNTP): Remove reference to obsolete variable
'nntp-authinfo-file'.
* doc/misc/reftex.texi (Table of Contents, Creating Citations)
(Options - Table of Contents, Options - Referencing Labels)
(Options - Creating Citations, Options - Index Support)
(Options - Index Support, Changes): Don't use obsolete names.
* doc/misc/speedbar.texi (Minor Display Modes)
(Major Display Modes): Make variable name suggestions more in line
with existing non-obsolete variable.
* lisp/textmodes/reftex-cite.el (reftex-select-bib-mode-map):
* lisp/textmodes/reftex-ref.el (reftex-offer-label-menu): Don't use
obsolete variable names.
* lisp/progmodes/which-func.el (which-func-mode): Doc fix.
Paul Eggert [Mon, 4 Oct 2021 00:58:16 +0000 (17:58 -0700)]
Tweak x_hide_tip for consistency
* src/xfns.c (x_hide_tip, Fx_show_tip): Be consistent about using
!NILP (tip_frame) instead of FRAMEP (tip_frame). The two
expressions are logically equivalent since tip_frame is either a
frame or nil, !NILP is a bit faster, and making things consistent
pacifies gcc 11.2.1 -Wanalyzer-null-dereference.
Paul Eggert [Mon, 4 Oct 2021 00:52:04 +0000 (17:52 -0700)]
Remove encode_terminal_code UNINITs
* src/term.c (encode_terminal_code): Clarify by removing a couple
of UNINITs and testing the local variable ‘cmp’ instead of
retesting src->u.cmp.automatic. This pacifies gcc 11.2.1
-Wanalyzer-null-dereference.
Paul Eggert [Mon, 4 Oct 2021 00:22:30 +0000 (17:22 -0700)]
Port systhreads.h to C2x
* src/systhread.h: Put NODISCARD at the start of extern
declarations, not at the end. This is needed by C2x.
This patch also pacifies gcc 11.2.1 -Wattributes.
Paul Eggert [Sun, 3 Oct 2021 23:37:13 +0000 (16:37 -0700)]
Pacify -Wanalyzer-null-argument in lisp_malloc
* src/alloc.c (lisp_malloc): Document that NBYTES must be
positive, and omit a needless runtime check. This pacifies a
false alarm with gcc 11.2.1 -Wanalyzer-possible-null-dereference.
* lisp/international/mule.el (load-with-code-conversion): Call
hack-read-symbol-shorthands-function. Set up shorthands.
(hack-read-symbol-shorthands-function): New variable.
Paul Eggert [Sun, 3 Oct 2021 18:42:20 +0000 (11:42 -0700)]
Simplify socket symlink-attack checking
This is a minor bugfix cleanup (Bug#33847#161).
* lib-src/emacsclient.c: Move "#include <acl.h>" to inside
"#ifdef SOCKETS_IN_FILE_SYSTEM", which is more accurate
and simpler than having a separate "#ifndef WINDOWSNT".
(O_PATH): Likewise.
Alan Mackenzie [Sun, 3 Oct 2021 18:13:23 +0000 (18:13 +0000)]
Clarify (elisp) insert-file-contents with BEG or END not on character boundary
* doc/lispref/files.texi (Reading from files): When the argument BEG or END to
insert-file-contents are at a byte position not at a character boundary,
clarify that raw bytes get inserted, and how to handle this awkwardness in
Lisp. Also clarify that insert-file-contents-literally is intended to insert
raw bytes into the buffer. Fix the outdated example that states it inserts
500 characters, when it actually inserts 500 bytes.
Juri Linkov [Sun, 3 Oct 2021 17:35:49 +0000 (20:35 +0300)]
Move context-menu selection items Defun/List/Symbol to prog-mode (bug#9054)
* lisp/mouse.el (context-menu-functions):
Add context-menu-middle-separator to choices.
(context-menu-region): Move Defun/List/Symbol selection items
to prog-context-menu.
* lisp/progmodes/prog-mode.el (prog-context-menu):
Move Defun/List/Symbol selection items from context-menu-region.
Include text-mode select menu only in strings and comments.
* lisp/textmodes/text-mode.el (text-mode-menu): New function.
(text-mode): Add text-mode-menu to context-menu-functions.
Juri Linkov [Sun, 3 Oct 2021 17:16:32 +0000 (20:16 +0300)]
* lisp/tab-bar.el (tab-bar-detach-tab): Handle frame selected by make-frame.
(tab-bar-move-window-to-tab): New command.
(tab-bar-new-tab-to): Handle the value 'window' of tab-bar-new-tab-choice.
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg02197.html
Juri Linkov [Sun, 3 Oct 2021 17:13:29 +0000 (20:13 +0300)]
* lisp/tab-line.el (tab-line-format): Add face-modified to the cache key.
When tab-line-tab-face-functions contains tab-line-tab-face-modified,
add 'buffer-modified-p' status to the cache-key, so the cache will expire
when the buffer modification status will change.
https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00129.html
* lisp/net/tramp.el (tramp-file-name-unify): New defun.
(tramp-file-name-equal-p):
* lisp/net/tramp-cache.el (tramp-get-connection-property)
(tramp-set-connection-property, tramp-flush-connection-property)
(tramp-flush-connection-properties): Use it.
* lisp/net/tramp-fuse.el (tramp-fuse-get-fusermount): New defun.
(tramp-fuse-mount-points): New defvar.
(tramp-fuse-unmount): Use it. Delete VEC from
`tramp-fuse-mount-points'. Delete mount point.
(tramp-fuse-unmount-on-cleanup): New user option.
(tramp-fuse-cleanup, tramp-fuse-cleanup-all): New defuns.
(top): Adapt `tramp-fuse-unload-hook',
`tramp-cleanup-connection-hook',
`tramp-cleanup-all-connections-hook' and `kill-emacs-hook'.
* lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection):
* lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection):
Add VEC to `tramp-fuse-mount-points'.
* test/lisp/net/tramp-tests.el (tramp-fuse-unmount-on-cleanup): Declare.
(tramp-test39-make-lock-file-name): Use it.
João Távora [Sun, 3 Oct 2021 10:56:16 +0000 (11:56 +0100)]
Font-lock shorthands in elisp-mode for quick visual recognition (bug#50959)
Only the shorthanded prefix is font-locked. This allows the remainder
of the font-lock logic to subsist (e.g. for macro-defining symbols).
* lisp/shorthands.el (cl-lib): Require it when compiling.
(elisp-shorthand-font-lock-face): New face.
(shorthands--mismatch-from-end): New helper.
(shorthands-font-lock-shorthands): New helper.
* test/lisp/progmodes/elisp-mode-resources/simple-shorthand-test.el:
Add some dummy test code.
Fix substitution of pretty quotes in code in easy-mmode
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Adjust.
(easy-mmode--mode-docstring): Avoid making quotes into pretty
quotes in code (bug#50968).
Stefan Kangas [Sat, 2 Oct 2021 19:56:22 +0000 (21:56 +0200)]
Clarify the purpose of internal--format-docstring-line
* test/lisp/subr-tests.el (subr-test-internal--format-docstring-line):
* lisp/subr.el (internal--format-docstring-line): Make it more clear
that this function is not intended for the first line of a docstring.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add comment explaining
why we use 'internal--format-docstring-line'.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
Kyle Meyer [Sat, 2 Oct 2021 18:27:55 +0000 (14:27 -0400)]
Update to Org 9.5-30-g10dc9d
The plan is to cut the Org 9.5.1 release and include it in Emacs 28.1,
but in the meantime regularly sync changes from Org's bugfix branch to
emacs-28.
This sync includes files from Org 9.5's new etc/csl/ directory that
should have been synced in bf9ec3d91a (Update to Org 9.5, 2021-09-29).
These items are a priority for the project and should be before other,
less prioritized items, according to a private discussion with project
co-maintainer Eli Zaretskii <eliz@gnu.org>.
Some of these items are a priority for the project and should be
before other, less prioritized items, according to a private
discussion with project co-maintainer Eli Zaretskii <eliz@gnu.org>.
Eli Zaretskii [Sat, 2 Oct 2021 08:06:18 +0000 (11:06 +0300)]
Preload paren.el
* lisp/Makefile.in (COMPILE_FIRST): Add the dependencies of
comp.el, so that they are natively-compiled in advance.
* lisp/loadup.el ("paren"): Preload paren.el. (Bug#50934)