Merge remote-tracking branch 'origin/master' into feature/android
This commit is contained in:
commit
0ee01457a8
24 changed files with 204 additions and 78 deletions
|
@ -18,7 +18,7 @@ To configure Git for Emacs development, you can run the following:
|
|||
|
||||
The following shell commands then build and run Emacs from scratch:
|
||||
|
||||
git clone git://git.sv.gnu.org/emacs.git
|
||||
git clone https://git.savannah.gnu.org/git/emacs.git
|
||||
cd emacs
|
||||
./autogen.sh
|
||||
./configure
|
||||
|
|
|
@ -4,7 +4,7 @@ The Emacs repository is hosted on Savannah. The following Git command
|
|||
will clone the repository to the 'emacs' subdirectory of the current
|
||||
directory on your local machine:
|
||||
|
||||
git clone git://git.sv.gnu.org/emacs.git
|
||||
git clone https://git.savannah.gnu.org/git/emacs.git
|
||||
|
||||
To build the repository code, simply run 'make' in the 'emacs'
|
||||
directory. This should work if your files are freshly checked out
|
||||
|
|
|
@ -294,7 +294,7 @@ Po Lu
|
|||
|
||||
Tramp
|
||||
Maintainer: Michael Albinus
|
||||
Repository: git://git.savannah.gnu.org/tramp.git
|
||||
Repository: https://git.savannah.gnu.org/git/tramp.git
|
||||
Mailing List: tramp-devel@gnu.org
|
||||
Bug Reports: M-x tramp-bug
|
||||
Notes: For backward compatibility requirements, see
|
||||
|
@ -316,7 +316,7 @@ Modus themes
|
|||
Org Mode
|
||||
Home Page: https://orgmode.org/
|
||||
Maintainer: Org Mode developers
|
||||
Repository: git://git.sv.gnu.org/emacs/org-mode.git
|
||||
Repository: https://git.savannah.gnu.org/git/emacs/org-mode.git
|
||||
Mailing list: emacs-orgmode@gnu.org
|
||||
Bug Reports: M-x org-submit-bug-report
|
||||
Notes: Org Mode is maintained as a separate project that is
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
# written by Paul Eggert
|
||||
|
||||
GNULIB_URL=git://git.savannah.gnu.org/gnulib.git
|
||||
GNULIB_URL=https://git.savannah.gnu.org/git/gnulib.git
|
||||
|
||||
GNULIB_MODULES='
|
||||
alloca-opt binary-io byteswap c-ctype c-strcase
|
||||
alignasof alloca-opt binary-io byteswap c-ctype c-strcase
|
||||
canonicalize-lgpl
|
||||
careadlinkat close-stream copy-file-range
|
||||
count-leading-zeros count-one-bits count-trailing-zeros
|
||||
|
@ -44,7 +44,7 @@ GNULIB_MODULES='
|
|||
nanosleep nproc nstrftime
|
||||
pathmax pipe2 printf-posix vasprintf-posix pselect pthread_sigmask
|
||||
qcopy-acl readlink readlinkat regex
|
||||
sig2str sigdescr_np socklen stat-time std-gnu11 stdalign stdbool stddef stdio
|
||||
sig2str sigdescr_np socklen stat-time std-gnu11 stdbool stddef stdio
|
||||
stpcpy strnlen strtoimax symlink sys_stat sys_time
|
||||
tempname time time_r time_rz timegm timer-time timespec-add timespec-sub
|
||||
update-copyright unlocked-io utimensat
|
||||
|
|
|
@ -3,7 +3,7 @@ NOTES ON THE EMACS PACKAGE ARCHIVE
|
|||
The GNU Emacs package archive, at elpa.gnu.org, is managed using a Git
|
||||
repository named "elpa", hosted on Savannah. To check it out:
|
||||
|
||||
git clone git://git.sv.gnu.org/emacs/elpa
|
||||
git clone https://git.savannah.gnu.org/git/emacs/elpa
|
||||
cd elpa
|
||||
make setup
|
||||
|
||||
|
|
|
@ -732,14 +732,15 @@ Emacs session.
|
|||
@section C Dialect
|
||||
@cindex C programming language
|
||||
|
||||
The C part of Emacs is portable to C99 or later: C11-specific features such
|
||||
as @samp{<stdalign.h>} and @samp{_Noreturn} are not used without a check,
|
||||
The C part of Emacs is portable to C99 or later: later C features such
|
||||
as @samp{<stdckdint.h>} and @samp{[[noreturn]]} are not used without a check,
|
||||
typically at configuration time, and the Emacs build procedure
|
||||
provides a substitute implementation if necessary. Some C11 features,
|
||||
provides a substitute implementation if necessary. Some later features,
|
||||
such as anonymous structures and unions, are too difficult to emulate,
|
||||
so they are avoided entirely.
|
||||
|
||||
At some point in the future the base C dialect will no doubt change to C11.
|
||||
At some point in the future the base C dialect will no doubt change to
|
||||
something later than C99.
|
||||
|
||||
@node Writing Emacs Primitives
|
||||
@section Writing Emacs Primitives
|
||||
|
@ -894,15 +895,17 @@ Currently, only the following attributes are recognized:
|
|||
@table @code
|
||||
@item noreturn
|
||||
Declares the C function as one that never returns. This corresponds
|
||||
to the C11 keyword @code{_Noreturn} and to @w{@code{__attribute__
|
||||
((__noreturn__))}} attribute of GCC (@pxref{Function Attributes,,,
|
||||
gcc, Using the GNU Compiler Collection}).
|
||||
to C23's @code{[[noreturn]]}, to C11's @code{_Noreturn}, and to GCC's
|
||||
@w{@code{__attribute__ ((__noreturn__))}} (@pxref{Function
|
||||
Attributes,,, gcc, Using the GNU Compiler Collection}). (Internally,
|
||||
Emacs's own C code uses @code{_Noreturn} as it can be defined as a
|
||||
macro on C platforms that do not support it.)
|
||||
|
||||
@item const
|
||||
Declares that the function does not examine any values except its
|
||||
arguments, and has no effects except the return value. This
|
||||
corresponds to @w{@code{__attribute__ ((__const__))}} attribute of
|
||||
GCC.
|
||||
corresponds to C23's @code{[[unsequenced]]} and to GCC's
|
||||
@w{@code{__attribute__ ((__const__))}}.
|
||||
|
||||
@item noinline
|
||||
This corresponds to @w{@code{__attribute__ ((__noinline__))}}
|
||||
|
|
|
@ -361,7 +361,7 @@ Another way is to follow the terminal session below:
|
|||
@example
|
||||
@group
|
||||
$ cd ~/emacs
|
||||
$ git clone git://git.savannah.gnu.org/tramp.git
|
||||
$ git clone https://git.savannah.gnu.org/git/tramp.git
|
||||
@end group
|
||||
@end example
|
||||
|
||||
|
|
40
lib/cdefs.h
40
lib/cdefs.h
|
@ -140,32 +140,37 @@
|
|||
#endif
|
||||
|
||||
|
||||
/* Gnulib avoids these definitions, as they don't work on non-glibc platforms.
|
||||
In particular, __bos and __bos0 are defined differently in the Android libc.
|
||||
*/
|
||||
#ifndef __GNULIB_CDEFS
|
||||
|
||||
/* Fortify support. */
|
||||
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
#define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
# define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
# define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
|
||||
/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
|
||||
#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
|
||||
|| __GNUC_PREREQ (12, 0))
|
||||
# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
|
||||
# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
|
||||
#else
|
||||
# define __glibc_objsize0(__o) __bos0 (__o)
|
||||
# define __glibc_objsize(__o) __bos (__o)
|
||||
#endif
|
||||
# if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
|
||||
|| __GNUC_PREREQ (12, 0))
|
||||
# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
|
||||
# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
|
||||
# else
|
||||
# define __glibc_objsize0(__o) __bos0 (__o)
|
||||
# define __glibc_objsize(__o) __bos (__o)
|
||||
# endif
|
||||
|
||||
/* Compile time conditions to choose between the regular, _chk and _chk_warn
|
||||
variants. These conditions should get evaluated to constant and optimized
|
||||
away. */
|
||||
|
||||
#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
|
||||
#define __glibc_unsigned_or_positive(__l) \
|
||||
# define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
|
||||
# define __glibc_unsigned_or_positive(__l) \
|
||||
((__typeof (__l)) 0 < (__typeof (__l)) -1 \
|
||||
|| (__builtin_constant_p (__l) && (__l) > 0))
|
||||
|
||||
/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
|
||||
condition can be folded to a constant and if it is true, or unknown (-1) */
|
||||
#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
|
||||
# define __glibc_safe_or_unknown_len(__l, __s, __osz) \
|
||||
((__osz) == (__SIZE_TYPE__) -1 \
|
||||
|| (__glibc_unsigned_or_positive (__l) \
|
||||
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
|
||||
|
@ -175,7 +180,7 @@
|
|||
/* Conversely, we know at compile time that the length is unsafe if the
|
||||
__L * __S <= __OBJSZ condition can be folded to a constant and if it is
|
||||
false. */
|
||||
#define __glibc_unsafe_len(__l, __s, __osz) \
|
||||
# define __glibc_unsafe_len(__l, __s, __osz) \
|
||||
(__glibc_unsigned_or_positive (__l) \
|
||||
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
|
||||
__s, __osz)) \
|
||||
|
@ -184,7 +189,7 @@
|
|||
/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
|
||||
declared. */
|
||||
|
||||
#define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
# define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: (__glibc_unsafe_len (__l, __s, __osz) \
|
||||
|
@ -194,13 +199,16 @@
|
|||
/* Fortify function f, where object size argument passed to f is the number of
|
||||
elements and not total size. */
|
||||
|
||||
#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: (__glibc_unsafe_len (__l, __s, __osz) \
|
||||
? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __warnattr(msg) __attribute__((__warning__ (msg)))
|
||||
# define __errordecl(name, msg) \
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
# --avoid=wchar \
|
||||
# --avoid=wcrtomb \
|
||||
# --avoid=wctype-h \
|
||||
# alignasof \
|
||||
# alloca-opt \
|
||||
# binary-io \
|
||||
# byteswap \
|
||||
|
@ -147,7 +148,6 @@
|
|||
# socklen \
|
||||
# stat-time \
|
||||
# std-gnu11 \
|
||||
# stdalign \
|
||||
# stdbool \
|
||||
# stddef \
|
||||
# stdio \
|
||||
|
@ -351,7 +351,6 @@ GL_GENERATE_GMP_H_CONDITION = @GL_GENERATE_GMP_H_CONDITION@
|
|||
GL_GENERATE_IEEE754_H_CONDITION = @GL_GENERATE_IEEE754_H_CONDITION@
|
||||
GL_GENERATE_LIMITS_H_CONDITION = @GL_GENERATE_LIMITS_H_CONDITION@
|
||||
GL_GENERATE_MINI_GMP_H_CONDITION = @GL_GENERATE_MINI_GMP_H_CONDITION@
|
||||
GL_GENERATE_STDALIGN_H_CONDITION = @GL_GENERATE_STDALIGN_H_CONDITION@
|
||||
GL_GENERATE_STDCKDINT_H_CONDITION = @GL_GENERATE_STDCKDINT_H_CONDITION@
|
||||
GL_GENERATE_STDDEF_H_CONDITION = @GL_GENERATE_STDDEF_H_CONDITION@
|
||||
GL_GENERATE_STDINT_H_CONDITION = @GL_GENERATE_STDINT_H_CONDITION@
|
||||
|
@ -934,11 +933,14 @@ HAVE_GETUMASK = @HAVE_GETUMASK@
|
|||
HAVE_GRANTPT = @HAVE_GRANTPT@
|
||||
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
|
||||
HAVE_GSETTINGS = @HAVE_GSETTINGS@
|
||||
<<<<<<< HEAD
|
||||
HAVE_HYPOTF = @HAVE_HYPOTF@
|
||||
HAVE_HYPOTL = @HAVE_HYPOTL@
|
||||
HAVE_ILOGB = @HAVE_ILOGB@
|
||||
HAVE_ILOGBF = @HAVE_ILOGBF@
|
||||
HAVE_ILOGBL = @HAVE_ILOGBL@
|
||||
=======
|
||||
>>>>>>> origin/master
|
||||
HAVE_IMAXABS = @HAVE_IMAXABS@
|
||||
HAVE_IMAXDIV = @HAVE_IMAXDIV@
|
||||
HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
|
||||
|
@ -1391,6 +1393,7 @@ REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
|
|||
REPLACE_GETSUBOPT = @REPLACE_GETSUBOPT@
|
||||
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
|
||||
REPLACE_GMTIME = @REPLACE_GMTIME@
|
||||
<<<<<<< HEAD
|
||||
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
|
||||
REPLACE_HYPOT = @REPLACE_HYPOT@
|
||||
REPLACE_HYPOTF = @REPLACE_HYPOTF@
|
||||
|
@ -1398,6 +1401,8 @@ REPLACE_HYPOTL = @REPLACE_HYPOTL@
|
|||
REPLACE_ILOGB = @REPLACE_ILOGB@
|
||||
REPLACE_ILOGBF = @REPLACE_ILOGBF@
|
||||
REPLACE_ILOGBL = @REPLACE_ILOGBL@
|
||||
=======
|
||||
>>>>>>> origin/master
|
||||
REPLACE_IMAXABS = @REPLACE_IMAXABS@
|
||||
REPLACE_IMAXDIV = @REPLACE_IMAXDIV@
|
||||
REPLACE_INITSTATE = @REPLACE_INITSTATE@
|
||||
|
@ -1570,7 +1575,6 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
|
|||
SMALL_JA_DIC = @SMALL_JA_DIC@
|
||||
SQLITE3_CFLAGS = @SQLITE3_CFLAGS@
|
||||
SQLITE3_LIBS = @SQLITE3_LIBS@
|
||||
STDALIGN_H = @STDALIGN_H@
|
||||
STDCKDINT_H = @STDCKDINT_H@
|
||||
STDDEF_H = @STDDEF_H@
|
||||
STDINT_H = @STDINT_H@
|
||||
|
@ -3767,6 +3771,7 @@ EXTRA_DIST += stat-time.h
|
|||
endif
|
||||
## end gnulib module stat-time
|
||||
|
||||
<<<<<<< HEAD
|
||||
## begin gnulib module stdalign
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_stdalign))
|
||||
|
||||
|
@ -3796,6 +3801,8 @@ EXTRA_DIST += stdalign.in.h
|
|||
endif
|
||||
## end gnulib module stdalign
|
||||
|
||||
=======
|
||||
>>>>>>> origin/master
|
||||
## begin gnulib module stdckdint
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_stdckdint))
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@
|
|||
# undef __attribute_returns_twice__
|
||||
# undef __attribute_used__
|
||||
# undef __attribute_warn_unused_result__
|
||||
# undef __bos
|
||||
# undef __bos0
|
||||
# undef __errordecl
|
||||
# undef __extension__
|
||||
# undef __extern_always_inline
|
||||
|
@ -147,21 +145,13 @@
|
|||
# undef __fortified_attr_access
|
||||
# undef __fortify_function
|
||||
# undef __glibc_c99_flexarr_available
|
||||
# undef __glibc_fortify
|
||||
# undef __glibc_fortify_n
|
||||
# undef __glibc_has_attribute
|
||||
# undef __glibc_has_builtin
|
||||
# undef __glibc_has_extension
|
||||
# undef __glibc_likely
|
||||
# undef __glibc_macro_warning
|
||||
# undef __glibc_macro_warning1
|
||||
# undef __glibc_objsize
|
||||
# undef __glibc_objsize0
|
||||
# undef __glibc_safe_len_cond
|
||||
# undef __glibc_safe_or_unknown_len
|
||||
# undef __glibc_unlikely
|
||||
# undef __glibc_unsafe_len
|
||||
# undef __glibc_unsigned_or_positive
|
||||
# undef __inline
|
||||
# undef __ptr_t
|
||||
# undef __restrict
|
||||
|
@ -170,6 +160,18 @@
|
|||
# undef __va_arg_pack_len
|
||||
# undef __warnattr
|
||||
# undef __wur
|
||||
# ifndef __GNULIB_CDEFS
|
||||
# undef __bos
|
||||
# undef __bos0
|
||||
# undef __glibc_fortify
|
||||
# undef __glibc_fortify_n
|
||||
# undef __glibc_objsize
|
||||
# undef __glibc_objsize0
|
||||
# undef __glibc_safe_len_cond
|
||||
# undef __glibc_safe_or_unknown_len
|
||||
# undef __glibc_unsafe_len
|
||||
# undef __glibc_unsigned_or_positive
|
||||
# endif
|
||||
|
||||
/* Include our copy of glibc <sys/cdefs.h>. */
|
||||
# include <cdefs.h>
|
||||
|
|
|
@ -30,9 +30,12 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __KLIBC__
|
||||
#ifdef __KLIBC__ /* OS/2 */
|
||||
# include <InnoTekLIBC/backend.h>
|
||||
#endif
|
||||
#ifdef __MVS__ /* z/OS */
|
||||
# include <termios.h>
|
||||
#endif
|
||||
|
||||
#include "intprops.h"
|
||||
|
||||
|
@ -53,7 +56,8 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
|
|||
return buf;
|
||||
}
|
||||
|
||||
#ifndef __KLIBC__
|
||||
#if !(defined __KLIBC__ || defined __MVS__)
|
||||
/* Generic code for Linux, Solaris, and similar platforms. */
|
||||
# define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/"
|
||||
{
|
||||
enum {
|
||||
|
@ -107,14 +111,29 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
|
|||
dirlen = sprintf (result, PROC_SELF_FD_FORMAT, fd);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#else /* (defined __KLIBC__ || defined __MVS__), i.e. OS/2 or z/OS */
|
||||
/* OS/2 kLIBC provides a function to retrieve a path from a fd. */
|
||||
{
|
||||
char dir[_MAX_PATH];
|
||||
size_t bufsize;
|
||||
|
||||
# ifdef __KLIBC__
|
||||
char dir[_MAX_PATH];
|
||||
if (__libc_Back_ioFHToPath (fd, dir, sizeof dir))
|
||||
return NULL;
|
||||
# endif
|
||||
# ifdef __MVS__
|
||||
char dir[_XOPEN_PATH_MAX];
|
||||
/* Documentation:
|
||||
https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-w-ioctl-w-pioctl-control-devices */
|
||||
if (w_ioctl (fd, _IOCC_GPN, sizeof dir, dir) < 0)
|
||||
return NULL;
|
||||
/* Documentation:
|
||||
https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-e2a-l-convert-characters-from-ebcdic-ascii */
|
||||
dirlen = __e2a_l (dir, strlen (dir));
|
||||
if (dirlen < 0 || dirlen >= sizeof dir)
|
||||
return NULL;
|
||||
dir[dirlen] = '\0';
|
||||
# endif
|
||||
|
||||
dirlen = strlen (dir);
|
||||
bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */
|
||||
|
|
17
lib/verify.h
17
lib/verify.h
|
@ -222,7 +222,21 @@ template <int w>
|
|||
|
||||
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
|
||||
#ifdef _GL_STATIC_ASSERT_H
|
||||
# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
|
||||
/* Define _Static_assert if needed. */
|
||||
/* With clang ≥ 3.8.0 in C++ mode, _Static_assert already works and accepts
|
||||
1 or 2 arguments. We better don't override it, because clang's standard
|
||||
C++ library uses static_assert inside classes in several places, and our
|
||||
replacement via _GL_VERIFY does not work in these contexts. */
|
||||
# if (defined __cplusplus && defined __clang__ \
|
||||
&& (4 <= __clang_major__ + (8 <= __clang_minor__)))
|
||||
# if 5 <= __clang_major__
|
||||
/* Avoid "warning: 'static_assert' with no message is a C++17 extension". */
|
||||
# pragma clang diagnostic ignored "-Wc++17-extensions"
|
||||
# else
|
||||
/* Avoid "warning: static_assert with no message is a C++1z extension". */
|
||||
# pragma clang diagnostic ignored "-Wc++1z-extensions"
|
||||
# endif
|
||||
# elif !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
|
||||
# if !defined _MSC_VER || defined __clang__
|
||||
# define _Static_assert(...) \
|
||||
_GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
|
||||
|
@ -233,6 +247,7 @@ template <int w>
|
|||
_GL_VERIFY ((R), "static assertion failed", -)
|
||||
# endif
|
||||
# endif
|
||||
/* Define static_assert if needed. */
|
||||
# if (!defined static_assert \
|
||||
&& __STDC_VERSION__ < 202311 \
|
||||
&& (!defined __cplusplus \
|
||||
|
|
|
@ -483,10 +483,13 @@ places where they originally did not directly appear."
|
|||
(bf (if (stringp (car body)) (cdr body) body))
|
||||
(if (when (eq 'interactive (car-safe (car bf)))
|
||||
(gethash form cconv--interactive-form-funs)))
|
||||
(wrapped (pcase if (`#'(lambda (_cconv--dummy) .,_) t) (_ nil)))
|
||||
(cif (when if (cconv-convert if env extend)))
|
||||
(_ (pcase cif
|
||||
(`#'(lambda () ,form) (setf (cadr (car bf)) form) (setq cif nil))
|
||||
('nil nil)
|
||||
(`#',f
|
||||
(setf (cadr (car bf)) (if wrapped (nth 2 f) f))
|
||||
(setq cif nil))
|
||||
;; The interactive form needs special treatment, so the form
|
||||
;; inside the `interactive' won't be used any further.
|
||||
(_ (setf (cadr (car bf)) nil))))
|
||||
|
@ -494,7 +497,8 @@ places where they originally did not directly appear."
|
|||
(if (not cif)
|
||||
;; Normal case, the interactive form needs no special treatment.
|
||||
cf
|
||||
`(cconv--interactive-helper ,cf ,cif))))
|
||||
`(cconv--interactive-helper
|
||||
,cf ,(if wrapped cif `(list 'quote ,cif))))))
|
||||
|
||||
(`(internal-make-closure . ,_)
|
||||
(byte-compile-report-error
|
||||
|
@ -742,7 +746,8 @@ This function does not return anything but instead fills the
|
|||
(when (eq 'interactive (car-safe (car bf)))
|
||||
(let ((if (cadr (car bf))))
|
||||
(unless (macroexp-const-p if) ;Optimize this common case.
|
||||
(let ((f `#'(lambda () ,if)))
|
||||
(let ((f (if (eq 'function (car-safe if)) if
|
||||
`#'(lambda (_cconv--dummy) ,if))))
|
||||
(setf (gethash form cconv--interactive-form-funs) f)
|
||||
(cconv-analyze-form f env))))))
|
||||
(cconv--analyze-function vrs body-forms env form))
|
||||
|
|
|
@ -178,20 +178,38 @@ DOC is a string where \"FUNCTION\" and \"OLDFUN\" are expected.")
|
|||
;; ((functionp spec) (funcall spec))
|
||||
(t (eval spec))))
|
||||
|
||||
(defun advice--interactive-form-1 (function)
|
||||
"Like `interactive-form' but preserves the static context if needed."
|
||||
(let ((if (interactive-form function)))
|
||||
(if (or (null if) (not (eq 'closure (car-safe function))))
|
||||
if
|
||||
(cl-assert (eq 'interactive (car if)))
|
||||
(let ((form (cadr if)))
|
||||
(if (macroexp-const-p form)
|
||||
if
|
||||
;; The interactive is expected to be run in the static context
|
||||
;; that the function captured.
|
||||
(let ((ctx (nth 1 function)))
|
||||
`(interactive
|
||||
,(let* ((f (if (eq 'function (car-safe form)) (cadr form) form)))
|
||||
;; If the form jut returns a function, preserve the fact that
|
||||
;; it just returns a function, which is an info we use in
|
||||
;; `advice--make-interactive-form'.
|
||||
(if (eq 'lambda (car-safe f))
|
||||
`',(eval form ctx)
|
||||
`(eval ',form ',ctx))))))))))
|
||||
|
||||
(defun advice--interactive-form (function)
|
||||
"Like `interactive-form' but tries to avoid autoloading functions."
|
||||
(if (not (and (symbolp function) (autoloadp (indirect-function function))))
|
||||
(interactive-form function)
|
||||
(advice--interactive-form-1 function)
|
||||
(when (commandp function)
|
||||
`(interactive (advice-eval-interactive-spec
|
||||
(cadr (interactive-form ',function)))))))
|
||||
(cadr (advice--interactive-form-1 ',function)))))))
|
||||
|
||||
(defun advice--make-interactive-form (iff ifm)
|
||||
;; TODO: make it so that interactive spec can be a constant which
|
||||
;; dynamically checks the advice--car/cdr to do its job.
|
||||
;; For that, advice-eval-interactive-spec needs to be more faithful.
|
||||
(let* ((fspec (cadr iff)))
|
||||
(when (eq 'function (car-safe fspec)) ;; Macroexpanded lambda?
|
||||
(when (memq (car-safe fspec) '(function quote)) ;; Macroexpanded lambda?
|
||||
(setq fspec (eval fspec t)))
|
||||
(if (functionp fspec)
|
||||
`(funcall ',fspec ',(cadr ifm))
|
||||
|
|
|
@ -568,7 +568,7 @@ This has 2 uses:
|
|||
(defun cconv--interactive-helper (fun if)
|
||||
"Add interactive \"form\" IF to FUN.
|
||||
Returns a new command that otherwise behaves like FUN.
|
||||
IF should actually not be a form but a function of no arguments."
|
||||
IF can be an ELisp form to be interpreted or a function of no arguments."
|
||||
(oclosure-lambda (cconv--interactive-helper (fun fun) (if if))
|
||||
(&rest args)
|
||||
(apply (if (called-interactively-p 'any)
|
||||
|
|
|
@ -2738,7 +2738,8 @@ instead."
|
|||
nil)
|
||||
|
||||
(cl-defmethod oclosure-interactive-form ((f cconv--interactive-helper))
|
||||
`(interactive (funcall ',(cconv--interactive-helper--if f))))
|
||||
(let ((if (cconv--interactive-helper--if f)))
|
||||
`(interactive ,(if (functionp if) `(funcall ',if) if))))
|
||||
|
||||
(defun command-execute (cmd &optional record-flag keys special)
|
||||
;; BEWARE: Called directly from the C code.
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<<<<<<< HEAD
|
||||
# gnulib-common.m4 serial 78
|
||||
=======
|
||||
# gnulib-common.m4 serial 80
|
||||
>>>>>>> origin/master
|
||||
dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -351,9 +355,21 @@ AC_DEFUN([gl_COMMON_BODY], [
|
|||
in C++ also: class. */
|
||||
/* In C++ and C23, this is spelled [[__maybe_unused__]].
|
||||
GCC's syntax is __attribute__ ((__unused__)).
|
||||
<<<<<<< HEAD
|
||||
clang supports both syntaxes. */
|
||||
#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
|
||||
# ifdef __has_c_attribute
|
||||
=======
|
||||
clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
|
||||
__has_c_attribute (__maybe_unused__) yields true but the use of
|
||||
[[__maybe_unused__]] nevertheless produces a warning. */
|
||||
#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
|
||||
# if defined __clang__ && defined __cplusplus
|
||||
# if __clang_major__ >= 10
|
||||
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
|
||||
# endif
|
||||
# elif defined __has_c_attribute
|
||||
>>>>>>> origin/master
|
||||
# if __has_c_attribute (__maybe_unused__)
|
||||
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
|
||||
# endif
|
||||
|
@ -373,7 +389,20 @@ AC_DEFUN([gl_COMMON_BODY], [
|
|||
the return value, unless the caller uses something like ignore_value. */
|
||||
/* Applies to: function, enumeration, class. */
|
||||
#ifndef _GL_ATTRIBUTE_NODISCARD
|
||||
<<<<<<< HEAD
|
||||
# ifdef __has_c_attribute
|
||||
=======
|
||||
# if defined __clang__ && defined __cplusplus
|
||||
/* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
|
||||
a warning.
|
||||
The 1000 below means a yet unknown threshold. When clang++ version X
|
||||
starts supporting [[__nodiscard__]] without warning about it, you can
|
||||
replace the 1000 with X. */
|
||||
# if __clang_major__ >= 1000
|
||||
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
|
||||
# endif
|
||||
# elif defined __has_c_attribute
|
||||
>>>>>>> origin/master
|
||||
# if __has_c_attribute (__nodiscard__)
|
||||
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
|
||||
# endif
|
||||
|
|
|
@ -188,7 +188,6 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module ssize_t:
|
||||
# Code from module stat-time:
|
||||
# Code from module std-gnu11:
|
||||
# Code from module stdalign:
|
||||
# Code from module stdbool:
|
||||
# Code from module stdckdint:
|
||||
# Code from module stddef:
|
||||
|
@ -564,9 +563,6 @@ AC_DEFUN([gl_INIT],
|
|||
gt_TYPE_SSIZE_T
|
||||
gl_STAT_TIME
|
||||
gl_STAT_BIRTHTIME
|
||||
gl_STDALIGN_H
|
||||
gl_CONDITIONAL_HEADER([stdalign.h])
|
||||
AC_PROG_MKDIR_P
|
||||
gl_C_BOOL
|
||||
AC_CHECK_HEADERS_ONCE([stdckdint.h])
|
||||
if test $ac_cv_header_stdckdint_h = yes; then
|
||||
|
@ -1127,9 +1123,12 @@ AC_DEFUN([gl_INIT],
|
|||
if test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1; then
|
||||
func_gl_gnulib_m4code_utimens
|
||||
fi
|
||||
<<<<<<< HEAD
|
||||
if test $REPLACE_GETLINE = 1; then
|
||||
func_gl_gnulib_m4code_getdelim
|
||||
fi
|
||||
=======
|
||||
>>>>>>> origin/master
|
||||
if case $host_os in mingw*) false;; *) test $HAVE_GETLOADAVG = 0 || test $REPLACE_GETLOADAVG = 1;; esac; then
|
||||
func_gl_gnulib_m4code_open
|
||||
fi
|
||||
|
@ -1582,7 +1581,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/size_max.h
|
||||
lib/stat-time.c
|
||||
lib/stat-time.h
|
||||
lib/stdalign.in.h
|
||||
lib/stdckdint.in.h
|
||||
lib/stddef.in.h
|
||||
lib/stdint.in.h
|
||||
|
|
|
@ -115,7 +115,7 @@ put the Emacs source into C:\emacs\emacs-master:
|
|||
|
||||
mkdir /c/emacs
|
||||
cd /c/emacs
|
||||
git clone git://git.sv.gnu.org/emacs.git emacs-master
|
||||
git clone https://git.savannah.gnu.org/git/emacs.git emacs-master
|
||||
|
||||
This will produce the development sources, i.e. the master branch of
|
||||
the Emacs Git repository, in the directory C:\emacs\emacs-master.
|
||||
|
|
|
@ -27,19 +27,22 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|||
frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh,
|
||||
sqrt, tan, *tanh.
|
||||
|
||||
C99 and C11 require the following math.h functions in addition to
|
||||
C99, C11 and C17 require the following math.h functions in addition to
|
||||
the C89 functions. Of these, Emacs currently exports only the
|
||||
starred ones to Lisp, since we haven't found a use for the others.
|
||||
Also, it uses the ones marked "+" internally:
|
||||
acosh, atanh, cbrt, copysign (implemented by signbit), erf, erfc,
|
||||
exp2, expm1, fdim, fma, fmax, fmin, fpclassify, hypot, +ilogb,
|
||||
isfinite, isgreater, isgreaterequal, isinf, isless, islessequal,
|
||||
+isfinite, isgreater, isgreaterequal, +isinf, isless, islessequal,
|
||||
islessgreater, *isnan, isnormal, isunordered, lgamma, log1p, *log2
|
||||
[via (log X 2)], logb (approximately; implemented by frexp),
|
||||
+lrint/llrint, +lround/llround, nan, nearbyint, nextafter,
|
||||
nexttoward, remainder, remquo, *rint, round, scalbln, +scalbn,
|
||||
+signbit, tgamma, *trunc.
|
||||
|
||||
C23 requires many more math.h functions. Emacs does not yet export
|
||||
or use them.
|
||||
|
||||
The C standard also requires functions for float and long double
|
||||
that are not listed above. Of these functions, Emacs uses only the
|
||||
following internally: fabsf, powf, sprintf.
|
||||
|
|
|
@ -277,7 +277,7 @@ DEFINE_GDB_SYMBOL_END (VALMASK)
|
|||
emacs_align_type union in alloc.c.
|
||||
|
||||
Although these macros are reasonably portable, they are not
|
||||
guaranteed on non-GCC platforms, as C11 does not require support
|
||||
guaranteed on non-GCC platforms, as the C standard does not require support
|
||||
for alignment to GCALIGNMENT and older compilers may ignore
|
||||
alignment requests. For any type T where garbage collection
|
||||
requires alignment, use verify (GCALIGNED (T)) to verify the
|
||||
|
@ -2967,9 +2967,10 @@ XFLOAT_DATA (Lisp_Object f)
|
|||
/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
|
||||
representations, have infinities and NaNs, and do not trap on
|
||||
exceptions. Define IEEE_FLOATING_POINT to 1 if this host is one of the
|
||||
typical ones. The C11 macro __STDC_IEC_559__ is close to what is
|
||||
typical ones. The C23 macro __STDC_IEC_60559_BFP__ (or its
|
||||
obsolescent C11 counterpart __STDC_IEC_559__) is close to what is
|
||||
wanted here, but is not quite right because Emacs does not require
|
||||
all the features of C11 Annex F (and does not require C11 at all,
|
||||
all the features of C23 Annex F (and does not require C11 or later,
|
||||
for that matter). */
|
||||
|
||||
#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \
|
||||
|
|
|
@ -12448,7 +12448,7 @@ display_echo_area (struct window *w)
|
|||
reset the echo_area_buffer in question to nil at the end because
|
||||
with_echo_area_buffer will set it to an empty buffer. */
|
||||
bool i = display_last_displayed_message_p;
|
||||
/* According to the C99, C11 and C++11 standards, the integral value
|
||||
/* According to the C standard, the integral value
|
||||
of a "bool" is always 0 or 1, so this array access is safe here,
|
||||
if oddly typed. */
|
||||
no_message_p = NILP (echo_area_buffer[i]);
|
||||
|
|
|
@ -213,8 +213,16 @@ function being an around advice."
|
|||
(should (equal (cl-prin1-to-string (car x))
|
||||
"#f(advice first :before #f(advice car :after cdr))"))))
|
||||
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
(ert-deftest advice-test-bug61179 ()
|
||||
(let* ((magic 42)
|
||||
(ad (lambda (&rest _)
|
||||
(interactive (lambda (is)
|
||||
(cons magic (advice-eval-interactive-spec is))))
|
||||
nil))
|
||||
(sym (make-symbol "adtest")))
|
||||
(defalias sym (lambda (&rest args) (interactive (list 'main)) args))
|
||||
(should (equal (call-interactively sym) '(main)))
|
||||
(advice-add sym :before ad)
|
||||
(should (equal (call-interactively sym) '(42 main)))))
|
||||
|
||||
;;; nadvice-tests.el ends here
|
||||
|
|
|
@ -42,3 +42,12 @@ if (x) {
|
|||
return;
|
||||
}
|
||||
=-=-=
|
||||
|
||||
Name: Field declaration without access modifier (bug#61115)
|
||||
|
||||
=-=
|
||||
public class T {
|
||||
@Autowired
|
||||
String a;
|
||||
}
|
||||
=-=-=
|
||||
|
|
Loading…
Add table
Reference in a new issue