posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux. Use
it if we don't need to configure a pseudoterminal.
* configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
(HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New
configuration variables.
* src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro.
(emacs_posix_spawn_init_actions)
(emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New
helper functions.
(emacs_spawn): Use posix_spawn if possible.
* configure.ac: Add an option to use XInput 2 if available
* src/Makefile.in (XINPUT_LIBS, XINPUT_CFLAGS): New variables
(EMACS_CFLAGS): Add Xinput CFLAGS
(LIBES): Add XInput libs
* src/xmenu.c (popup_activated_flag): Expose flag if XInput 2 is
available
* src/xfns.c (x_window): Set XInput 2 event mask
* src/xterm.c (x_detect_focus_change): Handle XInput 2 GenericEvents
(handle_one_xevent): Handle XInput 2 events
(x_term_init): Ask the server for XInput 2 support and set xkb_desc if
available
(x_delete_terminal): Free XKB kb desc if it exists, and free XI2
devices if they exist
(x_free_xi_devices, x_init_master_valuators): New functions
(x_get_scroll_valuator_delta): New function
(init_xterm): Don't tell GTK to only use Core Input when built with
XInput 2 support
* src/xterm.h (struct x_display_info): Add fields for XKB and XI2
support
* src/gtkutil.c (xg_event_is_for_menubar): Handle XIDeviceEvents
(xg_is_menu_window): New function
(xg_event_is_for_scrollbar): Handle XIDeviceEvents
* src/image.c (WebPDecodeRGBA, WebPDecodeRGB, WebPFree): Use
correct names and argument lists in DEF_DLL_FN; fix typos.
(WebPGetFeaturesInternal): Load this instead of WebPGetFeatures,
which is a static inline function in webp/decode.h.
(WebPGetFeatures): Redirect to call WebPGetFeaturesInternal.
* lisp/term/w32-win.el (dynamic-library-alist): Fix the name of
the WebP symbol.
* configure.ac (HAVE_WEBP): Fix detection of libwebp on MinGW.
* nt/INSTALL.W64:
* nt/INSTALL: Update information about libwebp availability.
This fixes the only remaining GCC diagnostics when emacs-28 is
configured with --enable-gcc-warnings. It does so by adding
ATTRIBUTE_RETURNS_NONNULL so that GCC knows certain functions
return nonnull. It also arranges for three of those functions to
always return nonnull; I thought these functions already were
doing so, but apparently not, and it is conceivable (though I
haven’t checked this) that changing these functions to always
return nonnull even on non-GNU platforms may fix unlikely
portability bugs elsewhere in Emacs. I used GCC 11.2.1 20210728
(Red Hat 11.2.1-1) on x86-64 when checking the diagnostics.
* configure.ac: Invoke gl_EEMALLOC before gl_INIT, in case
the regex code doesn't invoke gl_EEMALLOC; needed for src/alloc.c’s
use of MALLOC_0_IS_NONNULL.
* src/alloc.c (xmalloc, xzalloc, xrealloc): Don’t worry about the
special case where SIZE == 0, since lmalloc and lrealloc now
return null only on allocation failure.
(lmalloc, lrealloc): Return null only on allocation failure,
instead of having special cases that treat malloc (0) and
realloc (X, 0) as successes even when they return null.
* src/lisp.h: Add ATTRIBUTE_RETURNS_NONNULL to a few functions
that always return nonnull pointers, so that gcc -fanalyzer
does not issue diagnostics like “alloc.c: In function
‘allocate_vector_block’: alloc.c:2985:15: warning: dereference of
possibly-NULL ‘block’ [CWE-690] [-Wanalyzer-possible-null-dereference]”
as per <https://cwe.mitre.org/data/definitions/690.html>.
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
# Conflicts:
# etc/NEWS
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
# Conflicts:
# etc/NEWS
* configure.ac (module_env_snippet_29): New.
* src/module-env-28.h: Remove the comment with instructions for
the next release.
* src/module-env-29.h: New file.
* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 28.0.60.
* lisp/cus-edit.el (customize-changed-options-previous-release):
Update the last released version of Emacs.
* configure.ac: Check for the "port" command (MacPorts).
Add the required lib/include directories for nativecomp.
* src/Makefile.in (LIBGCCJIT_CFLAGS, LIBGCCJIT_LIBS): Split into
two parts to allow including -L/-I for MacPorts.
(LIBES): Adjust.
(EMACS_CFLAGS): Ditto.
Convert EmacsSurface into a CALayer subclass so we can use the
built-in relationships. Also simplify the macOS versioning code.
This will result in more warnings on older versions of macOS but makes
reading the code easier.
* configure.ac: Add QuartzCore framework.
* src/nsterm.h (NS_DRAW_TO_BUFFER): Remove define and all references.
(EmacsSurface, EmacsLayer): Rename EmacsSurface to EmacsLayer and
modify the definition to fit the new function.
* src/nsterm.m (ns_update_begin):
(ns_update_end):
(ns_focus):
(ns_unfocus): Use the new overridden lockFocus and unlockFocus and
simplify the frame management.
([EmacsView dealloc]):
([EmacsView viewDidResize:]):Don't explicitly release surfaces.
([EmacsView initFrameFromEmacs:]): Move the layer code to after the
NSWindow has been created as creating the layer now relies on some of
it's properties.
([EmacsView makeBackingLayer]): New function.
([EmacsView lockFocus]):
([EmacsView focusOnDrawingBuffer]): Rename to lockFocus.
([EmacsView unlockFocus]):
([EmacsView unfocusDrawingBuffer]): Rename to unlockFocus.
([EmacsView windowDidChangeBackingProperties]): Don't explicitly
release surfaces but reset EmacsLayer properties.
([EmacsView layout]):
([EmacsView viewWillDraw]): Rename to layout.
([EmacsView wantsUpdateLayer]): Remove function and change all callers
to [EmacsView wantsLayer].
(EmacsSurface, EmacsLayer): Rename to EmacsLayer.
([EmacsSurface getSize]):
([EmacsSurface initWithSize:ColorSpace:Scale:]): Remove methods.
([EmacsSurface initWithColorSpace:]):
([EmacsLayer checkDimensions]):
([EmacsLayer releaseSurfaces]):
([EmacsLayer display]): New functions.
* src/nsterm.m ([EmacsLayer dealloc]): Use releaseSurfaces.
([EmacsSurface getContext]): Automatically detect frame property
changes and clear the cache if required. Use built-in CALayer
properties where available.
([EmacsLayer copyContentsTo:]): Use [CALayer contents] as source.
* Makefile.in:
* configure.ac: Change eln file install location to
Contents/Frameworks.
* src/comp.c (hash_native_abi): Replace dots with underscores in the
eln install location as the macOS code-signing tool won't sign the
files if the parent directories have dots.
* configure.ac (NS_SELF_CONTAINED): We need to make lispdirrel the
same as lispdir when building a self contained app bundle as they're
both relative paths.
* Makefile.in (ns_applibexecdir):
(ns_applibdir):
(ns_appdir): New variables.
(.PHONY): Include new rule.
(epaths-force-ns-self-contained): Remove the app bundle directory from
all paths.
* configure.ac (NS_SELF_CONTAINED): Set the default site-lisp
directory instead of hard-coding it in the ObjC code, and use the new
epaths generating make rule.
* src/callproc.c (init_callproc_1):
(init_callproc): Remove all the NS specific code as the special cases
are now handled by decode_env_path.
* src/emacs.c (load_pdump):
(decode_env_path): Use ns_relocate to find the correct directory after
relocation.
* src/lread.c (load_path_default): Remove all the NS specific code as
the special cases are now handled by decode_env_path.
* src/nsterm.h: Update function definitions.
* src/nsterm.m (ns_etc_directory):
(ns_exec_path):
(ns_load_path): Remove functions that are no longer needed.
(ns_relocate): New function to calculate paths within the NS app
bundle.
* nextstep/Makefile.in (ns_applibexecdir): New variable, and update
anything relying on the libexec location.
* src/conf_post.h [HYBRID_MALLOC || DARWIN_OS && HAVE_UNEXEC]:
Include <stdlib.h> here, before redirecting 'malloc' and friends
to their hybrid_* and unexec_* equivalents. #undef malloc and
friends before redefining. Provide prototypes for the
replacements. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
* src/gmalloc.c [HYBRID_MALLOC]: Remove declarations of 'malloc'
and friends, as they are now redundant: we include <stdlib.h> in
conf_post.h before redefining 'malloc' etc., and that provides
prototypes from system headers.
* configure.ac (HYBRID_MALLOC): Remove kludge to avoid replacement
of 'free' by Gnulib. (Bug#36649)
The unexec build on GNU/Linux must use HYBRID_MALLOC (gmalloc.c) and
sheap.c. This was inadvertently disabled because a configure-time
test for 'sbrk' was moved as side effect of an unrelated change.
* configure.ac: Test for 'sbrk' before using the result in the
decision about SYSTEM_MALLOC and HYBRID_MALLOC.
(HYBRID_MALLOC): Prevent Gnulib from redirecting 'free' to its
replacement 'rpl_free'.
* lib/Makefile.in (not_emacs_OBJECTS): Add mallooc/%.o and free.o.
* configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Disable ASLR
when linking for unexec. Reported by Nikolay Kudryavtsev
<nikolay.kudryavtsev@gmail.com>.