commit 106936415d2892fc373842b3aedd805096fc9e0e (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sun May 3 15:06:58 2020 -0700 Simplify by using attribute.h macros attribute.h is partly designed for C2X forward compatibility, since C2X will add some standard attributes. Using its macros should help insulate Emacs from C2X teething problems. * src/conf_post.h: Include attribute.h. (HAS_ATTRIBUTE, HAS_FEATURE): Rename from __has_attribute and __has_feature, to avoid polluting the builtin namespace. All uses changed. (ATTRIBUTE_COLD, ATTRIBUTE_FORMAT, FALLTHROUGH, ATTRIBUTE_CONST) (ATTRIBUTE_PURE, ATTRIBUTE_UNUSED, ATTRIBUTE_MAY_ALIAS) (ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE) (ATTRIBUTE_RETURNS_NONNULL): Remove, as attribute.h does this now. (NO_INLINE, EXTERNALLY_VISIBLE, ARG_NONNULL, ATTRIBUTE_UNUSED): Simplify by defining in terms of attribute.h macros. * src/systhread.h (ATTRIBUTE_WARN_UNUSED_RESULT): Remove. All uses replaced by attribute.h’s NODISCARD. diff --git a/src/conf_post.h b/src/conf_post.h index 8a6b32998d..953b783ebe 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -30,13 +30,15 @@ along with GNU Emacs. If not, see . */ #endif /* To help make dependencies clearer elsewhere, this file typically - does not #include other files. The exceptions are first stdbool.h + does not #include other files. The exceptions are stdbool.h because it is unlikely to interfere with configuration and bool is - such a core part of the C language, and second ms-w32.h (DOS_NT + such a core part of the C language, attribute.h because its + ATTRIBUTE_* macros are used here, and ms-w32.h (DOS_NT only) because it historically was included here and changing that would take some work. */ #include +#include #if defined WINDOWSNT && !defined DEFER_MS_W32_H # include @@ -65,31 +67,30 @@ typedef unsigned int bool_bf; typedef bool bool_bf; #endif -/* Simulate __has_attribute on compilers that lack it. It is used only - on arguments like alloc_size that are handled in this simulation. - __has_attribute should be used only in #if expressions, as Oracle +/* A substitute for __has_attribute on compilers that lack it. + It is used only on arguments like cleanup that are handled here. + This macro should be used only in #if expressions, as Oracle Studio 12.5's __has_attribute does not work in plain code. */ -#ifndef __has_attribute -# define __has_attribute(a) __has_attribute_##a -# define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0) -# define __has_attribute_cleanup GNUC_PREREQ (3, 4, 0) -# define __has_attribute_cold GNUC_PREREQ (4, 3, 0) -# define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0) -# define __has_attribute_no_address_safety_analysis false -# define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0) -# define __has_attribute_no_sanitize_undefined GNUC_PREREQ (4, 9, 0) -# define __has_attribute_returns_nonnull GNUC_PREREQ (4, 9, 0) -# define __has_attribute_warn_unused_result GNUC_PREREQ (3, 4, 0) +#ifdef __has_attribute +# define HAS_ATTRIBUTE(a) __has_attribute (__##a##__) +#else +# define HAS_ATTRIBUTE(a) HAS_ATTR_##a +# define HAS_ATTR_cleanup GNUC_PREREQ (3, 4, 0) +# define HAS_ATTR_no_address_safety_analysis false +# define HAS_ATTR_no_sanitize_address GNUC_PREREQ (4, 8, 0) +# define HAS_ATTR_no_sanitize_undefined GNUC_PREREQ (4, 9, 0) #endif -/* Simulate __has_feature on compilers that lack it. It is used only +/* A substitute for __has_feature on compilers that lack it. It is used only to define ADDRESS_SANITIZER below. */ -#ifndef __has_feature -# define __has_feature(a) false +#ifdef __has_feature +# define HAS_FEATURE(a) __has_feature (a) +#else +# define HAS_FEATURE(a) false #endif /* True if addresses are being sanitized. */ -#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) +#if defined __SANITIZE_ADDRESS__ || HAS_FEATURE (address_sanitizer) # define ADDRESS_SANITIZER true #else # define ADDRESS_SANITIZER false @@ -226,37 +227,8 @@ extern void _DebPrint (const char *fmt, ...); extern char *emacs_getenv_TZ (void); extern int emacs_setenv_TZ (char const *); -/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at - . */ -#if __has_attribute (cold) && !defined __MINGW32__ -# define ATTRIBUTE_COLD __attribute__ ((cold)) -#else -# define ATTRIBUTE_COLD -#endif - -#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ -#define NO_INLINE __attribute__((noinline)) -#else -#define NO_INLINE -#endif - -#if __has_attribute (externally_visible) -#define EXTERNALLY_VISIBLE __attribute__((externally_visible)) -#else -#define EXTERNALLY_VISIBLE -#endif - -#if GNUC_PREREQ (2, 7, 0) -# define ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - -#if GNUC_PREREQ (7, 0, 0) -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -#else -# define FALLTHROUGH ((void) 0) -#endif +#define NO_INLINE ATTRIBUTE_NOINLINE +#define EXTERNALLY_VISIBLE ATTRIBUTE_EXTERNALLY_VISIBLE #if GNUC_PREREQ (4, 4, 0) && defined __GLIBC_MINOR__ # define PRINTF_ARCHETYPE __gnu_printf__ @@ -288,16 +260,8 @@ extern int emacs_setenv_TZ (char const *); #define ATTRIBUTE_FORMAT_PRINTF(string_index, first_to_check) \ ATTRIBUTE_FORMAT ((PRINTF_ARCHETYPE, string_index, first_to_check)) -#define ARG_NONNULL _GL_ARG_NONNULL -#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST -#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE -#define ATTRIBUTE_UNUSED _GL_UNUSED - -#if GNUC_PREREQ (3, 3, 0) && !defined __ICC -# define ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) -#else -# define ATTRIBUTE_MAY_ALIAS -#endif +#define ARG_NONNULL ATTRIBUTE_NONNULL +#define ATTRIBUTE_UNUSED MAYBE_UNUSED /* Declare NAME to be a pointer to an object of type TYPE, initialized to the address ADDR, which may be of a different type. Accesses @@ -308,27 +272,13 @@ extern int emacs_setenv_TZ (char const *); type ATTRIBUTE_MAY_ALIAS *name = (type *) (addr) #if 3 <= __GNUC__ -# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) # define ATTRIBUTE_SECTION(name) __attribute__((section (name))) #else -# define ATTRIBUTE_MALLOC #define ATTRIBUTE_SECTION(name) #endif -#if __has_attribute (alloc_size) -# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) -#else -# define ATTRIBUTE_ALLOC_SIZE(args) -#endif - #define ATTRIBUTE_MALLOC_SIZE(args) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE (args) -#if __has_attribute (returns_nonnull) -# define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((returns_nonnull)) -#else -# define ATTRIBUTE_RETURNS_NONNULL -#endif - /* Work around GCC bug 59600: when a function is inlined, the inlined code may have its addresses sanitized even if the function has the no_sanitize_address attribute. This bug is fixed in GCC 4.9.0 and diff --git a/src/systhread.h b/src/systhread.h index 005388fd5a..73c764a940 100644 --- a/src/systhread.h +++ b/src/systhread.h @@ -21,12 +21,6 @@ along with GNU Emacs. If not, see . */ #include -#if __has_attribute (warn_unused_result) -# define ATTRIBUTE_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) -#else -# define ATTRIBUTE_WARN_UNUSED_RESULT -#endif - #ifdef THREADS_ENABLED #ifdef HAVE_PTHREAD @@ -108,13 +102,13 @@ extern void sys_cond_broadcast (sys_cond_t *); extern void sys_cond_destroy (sys_cond_t *); extern sys_thread_t sys_thread_self (void) - ATTRIBUTE_WARN_UNUSED_RESULT; + NODISCARD; extern bool sys_thread_equal (sys_thread_t, sys_thread_t) - ATTRIBUTE_WARN_UNUSED_RESULT; + NODISCARD; extern bool sys_thread_create (sys_thread_t *, thread_creation_function *, void *) - ATTRIBUTE_WARN_UNUSED_RESULT; + NODISCARD; extern void sys_thread_yield (void); extern void sys_thread_set_name (const char *); commit 6bd47f4477904a55fc08345394bfab9cd7eae2eb Author: Paul Eggert Date: Sun May 3 14:57:10 2020 -0700 Update from Gnulib This incorporates: 2020-05-03 attribute: new module 2020-04-13 explicit_bzero: improve code style 2020-04-13 explicit_bzero: On native Windows, use SecureZeroMemory 2020-04-13 explicit_bzero: use memset_s() when available 2020-04-04 maint: remove a stray inter-word space * build-aux/config.guess, build-aux/config.sub: * build-aux/gitlog-to-changelog, build-aux/update-copyright: * doc/misc/texinfo.tex, lib/explicit_bzero.c, lib/ieee754.in.h: * lib/nstrftime.c, m4/explicit_bzero.m4, m4/gnulib-common.m4: Copy from Gnulib. * lib/attribute.h: New file, copied from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. diff --git a/build-aux/config.guess b/build-aux/config.guess index 45001cfecd..11fda528bc 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2020-01-01' +timestamp='2020-04-26' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1629,6 +1629,12 @@ copies of config.guess and config.sub with the latest versions from: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +EOF + +year=`echo $timestamp | sed 's,-.*,,'` +# shellcheck disable=SC2003 +if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then + cat >&2 <. */ + +/* Written by Paul Eggert. */ + +/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_* + macros used within Gnulib. */ + +#ifndef _GL_ATTRIBUTE_H +#define _GL_ATTRIBUTE_H + +/* C2X standard attributes have macro names that do not begin with + 'ATTRIBUTE_'. */ +#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED +#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH +#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED +#define NODISCARD _GL_ATTRIBUTE_NODISCARD + +/* Selected GCC attributes; see: + https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html + These names begin with 'ATTRIBUTE_' to avoid name clashes. */ +#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE(args) +#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE +#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL +#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD +#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST +#define ATTRIBUTE_DEPRECATED _GL_ATTRIBUTE_DEPRECATED +#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR(msg) +#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE +#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT(spec) +#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF +#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS +#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC +#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE +#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL(args) +#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING +#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW +#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED +#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE +#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL +#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL(pos) +#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING(msg) + +#endif /* _GL_ATTRIBUTE_H */ diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index c82771fb1e..b1f5acb777 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@ -25,8 +25,18 @@ # include #endif +/* memset_s need this define */ +#if HAVE_MEMSET_S +# define __STDC_WANT_LIB_EXT1__ 1 +#endif + #include +#if defined _WIN32 && !defined __CYGWIN__ +# define WIN32_LEAN_AND_MEAN +# include +#endif + #if _LIBC /* glibc-internal users use __explicit_bzero_chk, and explicit_bzero redirects to that. */ @@ -38,8 +48,12 @@ void explicit_bzero (void *s, size_t len) { -#ifdef HAVE_EXPLICIT_MEMSET - explicit_memset (s, 0, len); +#if defined _WIN32 && !defined __CYGWIN__ + (void) SecureZeroMemory (s, len); +#elif HAVE_EXPLICIT_MEMSET + explicit_memset (s, '\0', len); +#elif HAVE_MEMSET_S + (void) memset_s (s, len, '\0', len); #else memset (s, '\0', len); # if defined __GNUC__ && !defined __clang__ diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 0c7c2fb2b6..5c11dfc95c 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -1122,6 +1122,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -1208,6 +1209,15 @@ endif endif ## end gnulib module at-internal +## begin gnulib module attribute +ifeq (,$(OMIT_GNULIB_MODULE_attribute)) + + +EXTRA_DIST += attribute.h + +endif +## end gnulib module attribute + ## begin gnulib module binary-io ifeq (,$(OMIT_GNULIB_MODULE_binary-io)) diff --git a/lib/ieee754.in.h b/lib/ieee754.in.h index 01ca648905..d64bb46e9d 100644 --- a/lib/ieee754.in.h +++ b/lib/ieee754.in.h @@ -67,7 +67,7 @@ union ieee754_float #endif /* Little endian. */ } ieee; - /* This format makes it easier to see if a NaN is a signaling NaN. */ + /* This format makes it easier to see if a NaN is a signalling NaN. */ struct { #if __BYTE_ORDER == __BIG_ENDIAN @@ -118,7 +118,7 @@ union ieee754_double #endif /* Little endian. */ } ieee; - /* This format makes it easier to see if a NaN is a signaling NaN. */ + /* This format makes it easier to see if a NaN is a signalling NaN. */ struct { #if __BYTE_ORDER == __BIG_ENDIAN diff --git a/lib/nstrftime.c b/lib/nstrftime.c index fc5052a549..28b539dc2f 100644 --- a/lib/nstrftime.c +++ b/lib/nstrftime.c @@ -68,16 +68,9 @@ extern char *tzname[]; #include #include +#include "attribute.h" #include -#ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -#endif - #ifdef COMPILE_WIDE # include # define CHAR_T wchar_t diff --git a/m4/explicit_bzero.m4 b/m4/explicit_bzero.m4 index 507816affd..a415e7b4f5 100644 --- a/m4/explicit_bzero.m4 +++ b/m4/explicit_bzero.m4 @@ -19,4 +19,5 @@ AC_DEFUN([gl_FUNC_EXPLICIT_BZERO], AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO], [ AC_CHECK_FUNCS([explicit_memset]) + AC_CHECK_FUNCS_ONCE([memset_s]) ]) diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index b4795c18ae..b0010d0e35 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 48 +# gnulib-common.m4 serial 49 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,6 +15,15 @@ AC_DEFUN([gl_COMMON], [ AC_REQUIRE([gl_ZZGNULIB]) ]) AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([_GL_GNUC_PREREQ], +[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define _GL_GNUC_PREREQ(major, minor) \ + ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__)) +#else +# define _GL_GNUC_PREREQ(major, minor) 0 +#endif +]) AH_VERBATIM([_Noreturn], [/* The _Noreturn keyword of C11. */ #ifndef _Noreturn @@ -31,12 +40,12 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _Noreturn [[noreturn]] # elif ((!defined __cplusplus || defined __clang__) \ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ + || _GL_GNUC_PREREQ (4, 7) \ || (defined __apple_build_version__ \ ? 6000000 <= __apple_build_version__ \ : 3 < __clang_major__ + (5 <= __clang_minor__)))) /* _Noreturn works as-is. */ -# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C +# elif _GL_GNUC_PREREQ (2, 8) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) @@ -55,48 +64,206 @@ AC_DEFUN([gl_COMMON_BODY], [ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) - AH_VERBATIM([unused_parameter], -[/* Define as a marker that can be attached to declarations that might not - be used. This helps to reduce warnings, such as from - GCC -Wunused-parameter. */ -#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_UNUSED __attribute__ ((__unused__)) + AH_VERBATIM([attribute], +[/* Attributes. */ +#ifdef __has_attribute +# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) #else -# define _GL_UNUSED +# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr +# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) +# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) +# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) +# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) +# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6) +# ifdef _ICC +# define _GL_ATTR_may_alias 0 +# else +# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) +# endif +# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0) +# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) +# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) +# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) +# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) +# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_warn_unused_result_GL_GNUC_PREREQ (3, 4) #endif -/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name - is a misnomer outside of parameter lists. */ -#define _UNUSED_PARAMETER_ _GL_UNUSED - -/* gcc supports the "unused" attribute on possibly unused labels, and - g++ has since version 4.5. Note to support C++ as well as C, - _GL_UNUSED_LABEL should be used with a trailing ; */ -#if !defined __cplusplus || __GNUC__ > 4 \ - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -# define _GL_UNUSED_LABEL _GL_UNUSED + +]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead. +[ +#if _GL_HAS_ATTRIBUTE (alloc_size) +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) #else -# define _GL_UNUSED_LABEL +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) #endif -/* The __pure__ attribute was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#if _GL_HAS_ATTRIBUTE (always_inline) +# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) #else -# define _GL_ATTRIBUTE_PURE /* empty */ +# define _GL_ATTRIBUTE_ALWAYS_INLINE #endif -/* The __const__ attribute was added in gcc 2.95. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#if _GL_HAS_ATTRIBUTE (artificial) +# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__)) +#else +# define _GL_ATTRIBUTE_ARTIFICIAL +#endif + +/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at + . */ +#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__ +# define _GL_ATTRIBUTE_COLD __attribute__ ((cold)) +#else +# define _GL_ATTRIBUTE_COLD +#endif + +#if _GL_HAS_ATTRIBUTE (const) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) #else -# define _GL_ATTRIBUTE_CONST /* empty */ +# define _GL_ATTRIBUTE_CONST #endif -/* The __malloc__ attribute was added in gcc 3. */ -#if 3 <= __GNUC__ +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] +#elif _GL_HAS_ATTRIBUTE (deprecated) +# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) +#else +# define _GL_ATTRIBUTE_DEPRECATED +#endif + +#if _GL_HAS_ATTRIBUTE (error) +# define _GL_ATTRIBUTE_ERROR(msg) __attribute__((__error__ (msg))) +# define _GL_ATTRIBUTE_WARNING(msg) __attribute__((__warning__ (msg))) +#else +# define _GL_ATTRIBUTE_ERROR(msg) +# define _GL_ATTRIBUTE_WARNING(msg) +#endif + +#if _GL_HAS_ATTRIBUTE (externally_visible) +# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible)) +#else +# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE +#endif + +/* FALLTHROUGH is special, because it always expands to something. */ +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] +#elif _GL_HAS_ATTRIBUTE (fallthrough) +# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) +#else +# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0) +#endif + +#if _GL_HAS_ATTRIBUTE (format) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) +#endif + +#if _GL_HAS_ATTRIBUTE (leaf) +# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__)) +#else +# define _GL_ATTRIBUTE_LEAF +#endif + +#if _GL_HAS_ATTRIBUTE (may_alias) +# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) +#else +# define _GL_ATTRIBUTE_MAY_ALIAS +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] +#elif _GL_HAS_ATTRIBUTE (unused) +# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_ATTRIBUTE_MAYBE_UNUSED +#endif +/* Earlier spellings of this macro. */ +#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED +#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED + +#if _GL_HAS_ATTRIBUTE (malloc) # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) #else -# define _GL_ATTRIBUTE_MALLOC /* empty */ +# define _GL_ATTRIBUTE_MALLOC +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] +#elif _GL_HAS_ATTRIBUTE (warn_unused_result) +# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__)) +#else +# define _GL_ATTRIBUTE_NODISCARD +#endif + +#if _GL_HAS_ATTRIBUTE (noinline) +# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__)) +#else +# define _GL_ATTRIBUTE_NOINLINE +#endif + +#if _GL_HAS_ATTRIBUTE (nonnull) +# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args)) +#else +# define _GL_ATTRIBUTE_NONNULL(args) +#endif + +#if _GL_HAS_ATTRIBUTE (nonstring) +# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) +#else +# define _GL_ATTRIBUTE_NONSTRING +#endif + +/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */ + +#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus +# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +#else +# define _GL_ATTRIBUTE_NOTHROW +#endif + +#if _GL_HAS_ATTRIBUTE (packed) +# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) +#else +# define _GL_ATTRIBUTE_PACKED +#endif + +#if _GL_HAS_ATTRIBUTE (pure) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE +#endif + +#if _GL_HAS_ATTRIBUTE (returns_nonnull) +# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) +#else +# define _GL_ATTRIBUTE_RETURNS_NONNULL +#endif + +#if _GL_HAS_ATTRIBUTE (sentinel) +# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos)) +#else +# define _GL_ATTRIBUTE_SENTINEL(pos) +#endif + +]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead. +[ +/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */ +#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5) +# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED +#else +# define _GL_UNUSED_LABEL #endif ]) AH_VERBATIM([async_safe], diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index d5faa9a195..3717024788 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -47,6 +47,7 @@ AC_DEFUN([gl_EARLY], # Code from module alloca-opt: # Code from module allocator: # Code from module at-internal: + # Code from module attribute: # Code from module binary-io: # Code from module builtin-expect: # Code from module byteswap: @@ -934,6 +935,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/allocator.h lib/arg-nonnull.h lib/at-func.c + lib/attribute.h lib/binary-io.c lib/binary-io.h lib/byteswap.in.h commit 40149b871889461713dc73634498f9d2150b0249 Author: Stefan Monnier Date: Sun May 3 18:05:16 2020 -0400 * lisp/emacs-lisp/eieio.el (oset, oset-default): Mark as obsolete diff --git a/etc/NEWS b/etc/NEWS index 753b7a7fd3..0f4b6244c6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -101,6 +101,8 @@ horizontal movements now stop at the edge of the board. * Changes in Specialized Modes and Packages in Emacs 28.1 +** EIEIO: 'oset' and 'oset-default' are declared obsolete + ** New minor mode 'cl-font-lock-built-in-mode' for `lisp-mode' The mode provides refined highlighting of built-in functions, types, and variables. diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 9f8b639e52..fe2b80be01 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -517,7 +517,8 @@ The CLOS function `class-direct-subclasses' is aliased to this function." "Set the value in OBJ for slot SLOT to VALUE. SLOT is the slot name as specified in `defclass' or the tag created with in the :initarg slot. VALUE can be any Lisp object." - (declare (debug (form symbolp form))) + (declare (obsolete "use (setf (oref ..) ..) instead" "28.1") + (debug (form symbolp form))) `(eieio-oset ,obj (quote ,slot) ,value)) (defmacro oset-default (class slot value) @@ -525,7 +526,8 @@ with in the :initarg slot. VALUE can be any Lisp object." The default value is usually set with the :initform tag during class creation. This allows users to change the default behavior of classes after they are created." - (declare (debug (form symbolp form))) + (declare (obsolete "use (setf (oref-default ..) ..) instead" "28.1") + (debug (form symbolp form))) `(eieio-oset-default ,class (quote ,slot) ,value)) ;;; CLOS queries into classes and slots commit 7db0093bc2c2ae3470167eb7490b69baa1904052 Author: Simen Heggestøyl Date: Sun May 3 19:49:55 2020 +0200 Use lexical-binding in check-declare.el and add tests * lisp/emacs-lisp/check-declare.el: Use lexical-binding. (check-declare-warn): Silence byte compiler warning about unused lexical argument. * test/lisp/emacs-lisp/check-declare-tests.el: New file with tests for check-declare.el. diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index 144385ea27..52cda95f4c 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -1,4 +1,4 @@ -;;; check-declare.el --- Check declare-function statements +;;; check-declare.el --- Check declare-function statements -*- lexical-binding: t; -*- ;; Copyright (C) 2007-2020 Free Software Foundation, Inc. @@ -248,7 +248,7 @@ TYPE is a string giving the nature of the error. Optional LINE is the claim's line number; otherwise, search for the claim. Display warning in `check-declare-warning-buffer'." (let ((warning-prefix-function - (lambda (level entry) + (lambda (_level entry) (insert (format "%s:%d:" (file-relative-name file) (or line 0))) entry)) (warning-fill-prefix " ")) diff --git a/test/lisp/emacs-lisp/check-declare-tests.el b/test/lisp/emacs-lisp/check-declare-tests.el new file mode 100644 index 0000000000..bb9542114c --- /dev/null +++ b/test/lisp/emacs-lisp/check-declare-tests.el @@ -0,0 +1,116 @@ +;;; check-declare-tests.el --- Tests for check-declare.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Simen Heggestøyl +;; Keywords: + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'check-declare) +(require 'ert) +(eval-when-compile (require 'subr-x)) + +(ert-deftest check-declare-tests-locate () + (should (file-exists-p (check-declare-locate "check-declare" ""))) + (should + (string-prefix-p "ext:" (check-declare-locate "ext:foo" "")))) + +(ert-deftest check-declare-tests-scan () + (let ((file (make-temp-file "check-declare-tests-"))) + (unwind-protect + (progn + (with-temp-file file + (insert + (string-join + '(";; foo comment" + "(declare-function ring-insert \"ring\" (ring item))" + "(let ((foo 'code)) foo)") + "\n"))) + (let ((res (check-declare-scan file))) + (should (= (length res) 1)) + (pcase-let ((`((,fnfile ,fn ,arglist ,fileonly)) res)) + (should (string-match-p "ring" fnfile)) + (should (equal "ring-insert" fn)) + (should (equal '(ring item) arglist)) + (should-not fileonly)))) + (delete-file file)))) + +(ert-deftest check-declare-tests-verify () + (let ((file (make-temp-file "check-declare-tests-"))) + (unwind-protect + (progn + (with-temp-file file + (insert + (string-join + '(";; foo comment" + "(defun foo-fun ())" + "(defun ring-insert (ring item)" + "\"Insert onto ring RING the item ITEM.\"" + "nil)") + "\n"))) + (should-not + (check-declare-verify + file '(("foo.el" "ring-insert" (ring item)))))) + (delete-file file)))) + +(ert-deftest check-declare-tests-verify-mismatch () + (let ((file (make-temp-file "check-declare-tests-"))) + (unwind-protect + (progn + (with-temp-file file + (insert + (string-join + '(";; foo comment" + "(defun foo-fun ())" + "(defun ring-insert (ring)" + "\"Insert onto ring RING the item ITEM.\"" + "nil)") + "\n"))) + (should + (equal + (check-declare-verify + file '(("foo.el" "ring-insert" (ring item)))) + '(("foo.el" "ring-insert" "arglist mismatch"))))) + (delete-file file)))) + +(ert-deftest check-declare-tests-sort () + (should-not (check-declare-sort '())) + (should (equal (check-declare-sort '((a (1 a)) (b (2)) (d (1 d)))) + '((2 (b)) (1 (a a) (d d)))))) + +(ert-deftest check-declare-tests-warn () + (with-temp-buffer + (let ((check-declare-warning-buffer (buffer-name))) + (check-declare-warn + "foo-file" "foo-fun" "bar-file" "it wasn't" 999) + (let ((res (buffer-string))) + ;; Don't care too much about the format of the output, but + ;; check that key information is present. + (should (string-match-p "foo-file" res)) + (should (string-match-p "foo-fun" res)) + (should (string-match-p "bar-file" res)) + (should (string-match-p "it wasn't" res)) + (should (string-match-p "999" res)))))) + +(provide 'check-declare-tests) +;;; check-declare-tests.el ends here commit 82c506192b5ae1a454dccfae2f41fa3ee6d5e990 Author: Glenn Morris Date: Sun May 3 10:21:21 2020 -0700 ; admin/notes/git-workflow Mention reverting on release branch. diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index 63e96d0397..d109cdaa35 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -75,6 +75,17 @@ and add "Backport:" to the commit string. Then git push +Reverting on release branch +=========================== + +If a commit is made to the release branch, and then it is later +decided that this change should only be on the master branch, the +simplest way to handle this is to revert the commit on the release +branch, and include in the associated log entry "do not merge to master". +(Otherwise, the reversion may get merged to master, and inadvertently +clobber the change on master if it has been manually made there.) + + Merging release branch to the master ==================================== commit 97146efdc62914a99cce5a9bf4db4770c4aaa3ca Author: Glenn Morris Date: Sun May 3 10:18:04 2020 -0700 ; admin/notes/git-workflow Prefer "release branch" to a specific branch that can only ever get outdated. diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index 28b6f91a25..63e96d0397 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -15,14 +15,15 @@ Initial setup ============= Then we want to clone the repository. We normally want to have both -the current master and the emacs-26 branch. +the current master and (if there is one) the active release branch +(eg emacs-27). mkdir ~/emacs cd ~/emacs git clone @git.sv.gnu.org:/srv/git/emacs.git master cd master git config push.default current -git worktree add ../emacs-26 emacs-26 +git worktree add ../emacs-27 emacs-27 You now have both branches conveniently accessible, and you can do "git pull" in them once in a while to keep updated. @@ -52,11 +53,11 @@ you commit your change locally and then send a patch file as a bug report as described in ../../CONTRIBUTE. -Backporting to emacs-26 -======================= +Backporting to release branch +============================= If you have applied a fix to the master, but then decide that it should -be applied to the emacs-26 branch, too, then +be applied to the release branch, too, then cd ~/emacs/master git log @@ -66,7 +67,7 @@ which will look like commit 958b768a6534ae6e77a8547a56fc31b46b63710b -cd ~/emacs/emacs-26 +cd ~/emacs/emacs-27 git cherry-pick -xe 958b768a6534ae6e77a8547a56fc31b46b63710b and add "Backport:" to the commit string. Then @@ -74,17 +75,17 @@ and add "Backport:" to the commit string. Then git push -Merging emacs-26 to the master -============================== +Merging release branch to the master +==================================== It is recommended to use the file gitmerge.el in the admin directory -for merging 'emacs-26' into 'master'. It will take care of many +for merging the release branch into 'master'. It will take care of many things which would otherwise have to be done manually, like ignoring commits that should not land in master, fixing up ChangeLogs and automatically dealing with certain types of conflicts. If you really want to, you can do the merge manually, but then you're on your own. If you still choose to do that, make absolutely sure that you *always* -use the 'merge' command to transport commits from 'emacs-26' to +use the 'merge' command to transport commits from the release branch to 'master'. *Never* use 'cherry-pick'! If you don't know why, then you shouldn't manually do the merge in the first place; just use gitmerge.el instead. @@ -97,11 +98,11 @@ up-to-date by doing a pull. Then start Emacs with emacs -l admin/gitmerge.el -f gitmerge You'll be asked for the branch to merge, which will default to -'origin/emacs-26', which you should accept. Merging a local tracking +(eg) 'origin/emacs-27', which you should accept. Merging a local tracking branch is discouraged, since it might not be up-to-date, or worse, contain commits from you which are not yet pushed upstream. -You will now see the list of commits from 'emacs-26' which are not yet +You will now see the list of commits from the release branch that are not yet merged to 'master'. You might also see commits that are already marked for "skipping", which means that they will be merged with a different merge strategy ('ours'), which will effectively ignore the commit 20c1e7f8af08dadba1d69ff93ca9671cb26cd246 Author: Mattias Engdegård Date: Thu Apr 30 15:06:06 2020 +0200 Fix calculator division truncation (bug#40892) * lisp/calculator.el (calculator-string-to-number): Convert decimal numbers input to float, fixing a regression introduced in f248292ede. Reported by Aitor Soroa. diff --git a/lisp/calculator.el b/lisp/calculator.el index 6996990814..7e0b2fcc6a 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -864,7 +864,7 @@ The result should not exceed the screen width." "\\.\\([^0-9].*\\)?$" ".0\\1" str)) (str (replace-regexp-in-string "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) - (string-to-number str)))) + (float (string-to-number str))))) (defun calculator-push-curnum () "Push the numeric value of the displayed number to the stack." commit 2c306146d2a4a12b291ab81ed4ff2968a9ba22e6 Author: Alan Third Date: Sat Apr 18 16:22:06 2020 +0100 Fix initial frame resizing issue on NS (bug#40200) * src/nsterm.m ([EmacsView viewDidResize:]): Don't try to determine the old size when not drawing to the buffer. diff --git a/src/nsterm.m b/src/nsterm.m index a8f7540ea2..1953138954 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7335,48 +7335,39 @@ - (void)viewDidEndLiveResize - (void)viewDidResize:(NSNotification *)notification { NSRect frame = [self frame]; - int oldw, oldh, neww, newh; + int neww, newh; if (! FRAME_LIVE_P (emacsframe)) return; + NSTRACE ("[EmacsView viewDidResize]"); + + neww = (int)NSWidth (frame); + newh = (int)NSHeight (frame); + NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); + #ifdef NS_DRAW_TO_BUFFER -#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 if ([self wantsUpdateLayer]) { -#endif CGFloat scale = [[self window] backingScaleFactor]; - oldw = (CGFloat)CGBitmapContextGetWidth (drawingBuffer) / scale; - oldh = (CGFloat)CGBitmapContextGetHeight (drawingBuffer) / scale; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 - } - else - { -#endif -#endif /* NS_DRAW_TO_BUFFER */ -#if !defined (NS_DRAW_TO_BUFFER) || MAC_OS_X_VERSION_MIN_REQUIRED < 101400 - oldw = FRAME_PIXEL_WIDTH (emacsframe); - oldh = FRAME_PIXEL_HEIGHT (emacsframe); -#endif -#if defined (NS_DRAW_TO_BUFFER) && MAC_OS_X_VERSION_MIN_REQUIRED < 101400 - } -#endif - - neww = (int)NSWidth (frame); - newh = (int)NSHeight (frame); + int oldw = (CGFloat)CGBitmapContextGetWidth (drawingBuffer) / scale; + int oldh = (CGFloat)CGBitmapContextGetHeight (drawingBuffer) / scale; - NSTRACE ("[EmacsView viewDidResize]"); + NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); - /* Don't want to do anything when the view size hasn't changed. */ - if ((oldh == newh && oldw == neww)) - { - NSTRACE_MSG ("No change"); - return; + /* Don't want to do anything when the view size hasn't changed. */ + if ((oldh == newh && oldw == neww)) + { + NSTRACE_MSG ("No change"); + return; + } } +#endif - NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); - NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); - + /* I'm not sure if it's safe to call this every time the view + changes size, as Emacs may already know about the change. + Unfortunately there doesn't seem to be a bullet-proof method of + determining whether we need to call it or not. */ change_frame_size (emacsframe, FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww), FRAME_PIXEL_TO_TEXT_HEIGHT (emacsframe, newh), commit 22bff6e87b5f1e0d11f582e0639ca44d3d229f47 Author: Michal Nazarewicz Date: Sun May 3 16:12:05 2020 +0100 cc-mode: document Doxygen ‘c-doc-comment-style’ (bug#40877) * doc/misc/cc-mode.texi (Documentation Comments): mention Doxygen markup. diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index f99a890670..f9c9f5e183 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -2132,6 +2132,11 @@ For Pike autodoc markup, the standard in Pike. @item gtkdoc @cindex GtkDoc markup For GtkDoc markup, widely used in the Gnome community. + +@item doxygen +@cindex Doxygen markup +For Doxygen markup, which can be used with C, C++, Java and variety of +other languages. @end table The above is by no means complete. If you'd like to see support for commit 4c1a28b47bc2c702d1b5c7939ddf3af565499c3a Merge: 99a544c807 e90b7b9ef2 Author: Glenn Morris Date: Sun May 3 07:50:21 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: e90b7b9ef2 (origin/emacs-27) Revert "Mark breakpoints in edebug with ... commit 99a544c8076013daeff707ec7967e527ab989393 Merge: 8b4a61d33b 0a3731feef Author: Glenn Morris Date: Sun May 3 07:50:21 2020 -0700 Merge from origin/emacs-27 0a3731feef Make memq etc. examples more like they were ed25282b82 Document effect of 'search-upper-case' on replacement comm... 5a5d8a8ec0 * lisp/desktop.el (desktop-save): Doc fix. (Bug#41007) commit 8b4a61d33b9b275320c1963b2d4058bd3558229e Merge: 76cf14f9ca fc8e02a4d5 Author: Glenn Morris Date: Sun May 3 07:50:21 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: fc8e02a4d5 (emacs-27) ; Auto-commit of loaddefs files. commit 76cf14f9ca312d6862515d7b9dc12c878eaa1d6b Merge: f696dc883f 1d477a0fec Author: Glenn Morris Date: Sun May 3 07:50:21 2020 -0700 Merge from origin/emacs-27 1d477a0fec Recommend to avoid unnecessary abbreviations in doc aea1b4db72 Revert "Fix calculator division truncation (bug#40892)" commit f696dc883f332da27d6385a683c201e569b6da16 Merge: c6d70f890c 82140c510c Author: Glenn Morris Date: Sun May 3 07:50:21 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: 82140c510c Fix calculator division truncation (bug#40892) commit c6d70f890cee2f5a561dcea0a5ef2de0cbbf1baf Merge: 5f516dc944 1f17193e00 Author: Glenn Morris Date: Sun May 3 07:50:20 2020 -0700 Merge from origin/emacs-27 1f17193e00 Expand file name for remote dirs as well 7a12ab5ea2 Fix project.el commands in "transient" projects 274ec97e3c Make sure alist-related functions say so in their doc commit 5f516dc94419d8ccfad6bf31a752d33f797f837c Author: Stefan Kangas Date: Sun May 3 16:21:51 2020 +0200 Remove redundant :groups args missed in last commit * lisp/emacs-lisp/cl-indent.el (lisp-lambda-list-keyword-alignment) (lisp-lambda-list-keyword-parameter-indentation) (lisp-lambda-list-keyword-parameter-alignment) (lisp-indent-backquote-substitution-mode): Remove redundant :group args. diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 361414ef1f..66502da668 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -103,16 +103,14 @@ If non-nil, alignment is done with the first keyword &key key1 key2) #|...|#)" :version "24.1" - :type 'boolean - :group 'lisp-indent) + :type 'boolean) (defcustom lisp-lambda-list-keyword-parameter-indentation 2 "Indentation of lambda list keyword parameters. See `lisp-lambda-list-keyword-parameter-alignment' for more information." :version "24.1" - :type 'integer - :group 'lisp-indent) + :type 'integer) (defcustom lisp-lambda-list-keyword-parameter-alignment nil "Whether to vertically align lambda-list keyword parameters together. @@ -131,8 +129,7 @@ If non-nil, alignment is done with the first parameter key3 key4) #|...|#)" :version "24.1" - :type 'boolean - :group 'lisp-indent) + :type 'boolean) (defcustom lisp-indent-backquote-substitution-mode t "How to indent substitutions in backquotes. @@ -144,8 +141,7 @@ In any case, do not backtrack beyond a backquote substitution. Until Emacs 25.1, the nil behavior was hard-wired." :version "25.1" - :type '(choice (const corrected) (const nil) (const t)) - :group 'lisp-indent) + :type '(choice (const corrected) (const nil) (const t))) (defvar lisp-indent-defun-method '(4 &lambda &body) commit d55b3b59666c6c0d966f2ddbc7b88e84b9499812 Author: Stefan Kangas Date: Sun May 3 16:19:09 2020 +0200 Improve indentation of 'loop' forms * lisp/emacs-lisp/cl-indent.el (lisp-loop-keyword-indentation) (lisp-loop-forms-indentation, lisp-simple-loop-indentation): Use a more standard indentation of 'loop' forms. (Bug#2160) (lisp-indent-maximum-backtracking, lisp-tag-indentation) (lisp-tag-body-indentation, lisp-backquote-indentation) (lisp-loop-keyword-indentation, lisp-loop-forms-indentation) (lisp-simple-loop-indentation): Remove redundant :group args. diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index fd8715962a..361414ef1f 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -46,14 +46,12 @@ "Maximum depth to backtrack out from a sublist for structured indentation. If this variable is 0, no backtracking will occur and forms such as `flet' may not be correctly indented." - :type 'integer - :group 'lisp-indent) + :type 'integer) (defcustom lisp-tag-indentation 1 "Indentation of tags relative to containing list. This variable is used by the function `lisp-indent-tagbody'." - :type 'integer - :group 'lisp-indent) + :type 'integer) (defcustom lisp-tag-body-indentation 3 "Indentation of non-tagged lines relative to containing list. @@ -64,32 +62,30 @@ the special form. If the value is t, the body of tags will be indented as a block at the same indentation as the first s-expression following the tag. In this case, any forms before the first tag are indented by `lisp-body-indent'." - :type 'integer - :group 'lisp-indent) + :type 'integer) (defcustom lisp-backquote-indentation t "Whether or not to indent backquoted lists as code. If nil, indent backquoted lists as data, i.e., like quoted lists." - :type 'boolean - :group 'lisp-indent) + :type 'boolean) -(defcustom lisp-loop-keyword-indentation 3 +(defcustom lisp-loop-keyword-indentation 6 "Indentation of loop keywords in extended loop forms." :type 'integer - :group 'lisp-indent) + :version "28.1") -(defcustom lisp-loop-forms-indentation 5 +(defcustom lisp-loop-forms-indentation 6 "Indentation of forms in extended loop forms." :type 'integer - :group 'lisp-indent) + :version "28.1") -(defcustom lisp-simple-loop-indentation 3 +(defcustom lisp-simple-loop-indentation 1 "Indentation of forms in simple loop forms." :type 'integer - :group 'lisp-indent) + :version "28.1") (defcustom lisp-lambda-list-keyword-alignment nil "Whether to vertically align lambda-list keywords together. commit b82dbba5e0d0e35e8944e517f05f726ac70fd43d Author: Stefan Kangas Date: Sun May 3 16:17:08 2020 +0200 Use lexical-binding in w32-vars.el * lisp/w32-vars.el: Use lexical-binding. (w32-use-w32-font-dialog, w32-allow-system-shell (w32-system-shells, w32-fixed-font-alist): Remove redundant :group args. diff --git a/lisp/w32-vars.el b/lisp/w32-vars.el index 307490dc4b..642a48446e 100644 --- a/lisp/w32-vars.el +++ b/lisp/w32-vars.el @@ -1,4 +1,4 @@ -;;; w32-vars.el --- MS-Windows specific user options +;;; w32-vars.el --- MS-Windows specific user options -*- lexical-binding:t -*- ;; Copyright (C) 2002-2020 Free Software Foundation, Inc. @@ -44,22 +44,19 @@ after changing the value of this variable." :type 'boolean :set (lambda (symbol value) (set symbol value) - (setq mouse-appearance-menu-map nil)) - :group 'w32) + (setq mouse-appearance-menu-map nil))) (unless (eq system-type 'cygwin) (defcustom w32-allow-system-shell nil "Disable startup warning when using \"system\" shells." - :type 'boolean - :group 'w32)) + :type 'boolean)) (unless (eq system-type 'cygwin) (defcustom w32-system-shells '("cmd" "cmd.exe" "command" "command.com" "4nt" "4nt.exe" "4dos" "4dos.exe" "tcc" "tcc.exe" "ndos" "ndos.exe") "List of strings recognized as Windows system shells." - :type '(repeat string) - :group 'w32)) + :type '(repeat string))) ;; Want "menu" custom type for this. (defcustom w32-fixed-font-alist @@ -149,8 +146,7 @@ menu if the variable `w32-use-w32-font-dialog' is nil." (const :tag "Separator" ("")) (list :tag "Font Entry" (string :tag "Menu text") - (string :tag "Font"))))))) - :group 'w32) + (string :tag "Font")))))))) (make-obsolete-variable 'w32-enable-synthesized-fonts nil "24.4") commit cb1e73d1bc964f61626955e950e660602f2014f5 Author: Eli Zaretskii Date: Sun May 3 16:53:53 2020 +0300 Improve accuracy of apropos commands that search doc strings It is conceptually wrong for apropos commands that search doc strings to look for matches of several words only on the same line, because division of doc strings between lines is ephemeral. * lisp/apropos.el (apropos-parse-pattern): Accept an optional argument MULTILINE-P, and if that is non-nil, produce regexps that match words in the list even if they are separated by line boundaries. (apropos-value, apropos-local-value, apropos-documentation): Use the new optional argument in apropos commands that search multiline text, such as doc strings. * src/search.c (Fposix_looking_at, Fposix_string_match) (Fposix_search_backward, Fposix_search_forward): Make sure Posix appears in the doc strings near REGEXP, for better matches. diff --git a/lisp/apropos.el b/lisp/apropos.el index e40f94ccb8..7cbda3cb67 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -373,9 +373,11 @@ kind of objects to search." (user-error "No word list given")) pattern))) -(defun apropos-parse-pattern (pattern) +(defun apropos-parse-pattern (pattern &optional multiline-p) "Rewrite a list of words to a regexp matching all permutations. If PATTERN is a string, that means it is already a regexp. +MULTILINE-P, if non-nil, means produce a regexp that will match +the words even if separated by newlines. This updates variables `apropos-pattern', `apropos-pattern-quoted', `apropos-regexp', `apropos-words', and `apropos-all-words-regexp'." (setq apropos-words nil @@ -386,6 +388,9 @@ This updates variables `apropos-pattern', `apropos-pattern-quoted', ;; any combination of two or more words like this: ;; (a|b|c).*(a|b|c) which may give some false matches, ;; but as long as it also gives the right ones, that's ok. + ;; (Actually, when MULTILINE-P is non-nil, instead of '.' we + ;; use a trick that would find a match even if the words are + ;; on different lines. (let ((words pattern)) (setq apropos-pattern (mapconcat 'identity pattern " ") apropos-pattern-quoted (regexp-quote apropos-pattern)) @@ -402,9 +407,13 @@ This updates variables `apropos-pattern', `apropos-pattern-quoted', (setq apropos-words (cons s apropos-words) apropos-all-words (cons a apropos-all-words)))) (setq apropos-all-words-regexp - (apropos-words-to-regexp apropos-all-words ".+")) + (apropos-words-to-regexp apropos-all-words + ;; The [^b-a] trick matches any + ;; character including a newline. + (if multiline-p "[^b-a]+?" ".+"))) (setq apropos-regexp - (apropos-words-to-regexp apropos-words ".*?"))) + (apropos-words-to-regexp apropos-words + (if multiline-p "[^b-a]*?" ".*?")))) (setq apropos-pattern-quoted (regexp-quote pattern) apropos-all-words-regexp pattern apropos-pattern pattern @@ -787,7 +796,7 @@ Returns list of symbols and values found." (interactive (list (apropos-read-pattern "value") current-prefix-arg)) (setq apropos--current (list #'apropos-value pattern do-all)) - (apropos-parse-pattern pattern) + (apropos-parse-pattern pattern t) (or do-all (setq do-all apropos-do-all)) (setq apropos-accumulator ()) (let (f v p) @@ -827,7 +836,7 @@ Optional arg BUFFER (default: current buffer) is the buffer to check." (interactive (list (apropos-read-pattern "value of buffer-local variable"))) (unless buffer (setq buffer (current-buffer))) (setq apropos--current (list #'apropos-local-value pattern buffer)) - (apropos-parse-pattern pattern) + (apropos-parse-pattern pattern t) (setq apropos-accumulator ()) (let ((var nil)) (mapatoms @@ -869,7 +878,7 @@ Returns list of symbols and documentation found." (interactive (list (apropos-read-pattern "documentation") current-prefix-arg)) (setq apropos--current (list #'apropos-documentation pattern do-all)) - (apropos-parse-pattern pattern) + (apropos-parse-pattern pattern t) (or do-all (setq do-all apropos-do-all)) (setq apropos-accumulator () apropos-files-scanned ()) (let ((standard-input (get-buffer-create " apropos-temp")) diff --git a/src/search.c b/src/search.c index 567270a84c..ec076c1803 100644 --- a/src/search.c +++ b/src/search.c @@ -353,8 +353,8 @@ data if you want to preserve them. */) } DEFUN ("posix-looking-at", Fposix_looking_at, Sposix_looking_at, 1, 1, 0, - doc: /* Return t if text after point matches regular expression REGEXP. -Find the longest match, in accord with Posix regular expression rules. + doc: /* Return t if text after point matches REGEXP according to Posix rules. +Find the longest match, in accordance with Posix regular expression rules. This function modifies the match data that `match-beginning', `match-end' and `match-data' access; save and restore the match data if you want to preserve them. */) @@ -449,7 +449,7 @@ matched by the parenthesis constructions in REGEXP. */) } DEFUN ("posix-string-match", Fposix_string_match, Sposix_string_match, 2, 3, 0, - doc: /* Return index of start of first match for REGEXP in STRING, or nil. + doc: /* Return index of start of first match for Posix REGEXP in STRING, or nil. Find the longest match, in accord with Posix regular expression rules. Case is ignored if `case-fold-search' is non-nil in the current buffer. If third arg START is non-nil, start search at that index in STRING. @@ -2276,7 +2276,7 @@ and `replace-match'. */) DEFUN ("posix-search-backward", Fposix_search_backward, Sposix_search_backward, 1, 4, "sPosix search backward: ", - doc: /* Search backward from point for match for regular expression REGEXP. + doc: /* Search backward from point for match for REGEXP according to Posix rules. Find the longest match in accord with Posix regular expression rules. Set point to the beginning of the occurrence found, and return point. An optional second argument bounds the search; it is a buffer position. @@ -2304,7 +2304,7 @@ and `replace-match'. */) DEFUN ("posix-search-forward", Fposix_search_forward, Sposix_search_forward, 1, 4, "sPosix search: ", - doc: /* Search forward from point for regular expression REGEXP. + doc: /* Search forward from point for REGEXP according to Posix rules. Find the longest match in accord with Posix regular expression rules. Set point to the end of the occurrence found, and return point. An optional second argument bounds the search; it is a buffer position. commit 63268253d21c57d991cba3f3b083d74f154a26fe Author: Mattias Engdegård Date: Sun May 3 14:22:50 2020 +0200 Regexps cannot infloop; fix manual * doc/lispref/searching.texi (Regexp Special): Edit erroneous statements about infinite looping in regexps. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 83c154938c..c8a12bdd66 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -338,16 +338,14 @@ first tries to match all three @samp{a}s; but the rest of the pattern is The next alternative is for @samp{a*} to match only two @samp{a}s. With this choice, the rest of the regexp matches successfully. -@strong{Warning:} Nested repetition operators can run for an -indefinitely long time, if they lead to ambiguous matching. For +@strong{Warning:} Nested repetition operators can run for a very +long time, if they lead to ambiguous matching. For example, trying to match the regular expression @samp{\(x+y*\)*a} against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could take hours before it ultimately fails. Emacs must try each way of grouping the @samp{x}s before concluding that none of them can work. -Even worse, @samp{\(x*\)*} can match the null string in infinitely -many ways, so it causes an infinite loop. To avoid these problems, -check nested repetitions carefully, to make sure that they do not -cause combinatorial explosions in backtracking. +In general, avoid expressions that can match the same string in +multiple ways. @item @samp{+} @cindex @samp{+} in regexp commit 7f51ab5163635aa6bc369b5173af955c6a27f927 Author: Michael Albinus Date: Sun May 3 13:59:50 2020 +0200 Do not delete asynchronous Tramp processes due to session timeout * lisp/net/tramp-cmds.el (tramp-cleanup-connection): New optional argument KEEP-PROCESSES. * lisp/net/tramp-sh.el (tramp-timeout-session): Use it. (Bug#41042) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 7d353e262a..1742da8630 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -74,11 +74,13 @@ SYNTAX can be one of the symbols `default' (default), Each function is called with the current vector as argument.") ;;;###tramp-autoload -(defun tramp-cleanup-connection (vec &optional keep-debug keep-password) +(defun tramp-cleanup-connection + (vec &optional keep-debug keep-password keep-processes) "Flush all connection related objects. This includes password cache, file cache, connection cache, -buffers. KEEP-DEBUG non-nil preserves the debug buffer. -KEEP-PASSWORD non-nil preserves the password cache. +buffers, processes. KEEP-DEBUG non-nil preserves the debug +buffer. KEEP-PASSWORD non-nil preserves the password cache. +KEEP-PROCESSES non-nil preserves the asynchronous processes. When called interactively, a Tramp connection has to be selected." (interactive ;; When interactive, select the Tramp remote identification. @@ -116,7 +118,9 @@ When called interactively, a Tramp connection has to be selected." ;; Delete processes. (dolist (key (hash-table-keys tramp-cache-data)) (when (and (processp key) - (tramp-file-name-equal-p (process-get key 'vector) vec)) + (tramp-file-name-equal-p (process-get key 'vector) vec) + (or (not keep-processes) + (eq key (tramp-get-process vec)))) (tramp-flush-connection-properties key) (delete-process key))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a39d503e22..21ef1efa0d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4915,7 +4915,7 @@ If there is just some editing, retry it after 5 seconds." (run-at-time 5 nil 'tramp-timeout-session vec)) (tramp-message vec 3 "Timeout session %s" (tramp-make-tramp-file-name vec 'noloc)) - (tramp-cleanup-connection vec 'keep-debug))) + (tramp-cleanup-connection vec 'keep-debug nil 'keep-processes))) (defun tramp-maybe-open-connection (vec) "Maybe open a connection VEC. commit a9432bd2cc01016b0fbdf3b8631070d95fc7600c Author: Michael Albinus Date: Sun May 3 13:59:08 2020 +0200 Improve Tramp debug messages * lisp/net/tramp-cache.el (tramp-get-file-property) (tramp-get-connection-property): Improve debug messages. Suggested by Marc Herbert . diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 14a64382ac..02400f9deb 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -139,23 +139,29 @@ Return DEFAULT if not set." (tramp-run-real-handler #'directory-file-name (list file)) (tramp-file-name-hop key) nil) (let* ((hash (tramp-get-hash-table key)) - (value (when (hash-table-p hash) (gethash property hash)))) - (if ;; We take the value only if there is any, and - ;; `remote-file-name-inhibit-cache' indicates that it is still - ;; valid. Otherwise, DEFAULT is set. - (and (consp value) + (cached (and (hash-table-p hash) (gethash property hash))) + (cached-at (and (consp cached) (format-time-string "%T" (car cached)))) + (value default) + use-cache) + + (when ;; We take the value only if there is any, and + ;; `remote-file-name-inhibit-cache' indicates that it is + ;; still valid. Otherwise, DEFAULT is set. + (and (consp cached) (or (null remote-file-name-inhibit-cache) (and (integerp remote-file-name-inhibit-cache) (time-less-p nil - (time-add (car value) remote-file-name-inhibit-cache))) + (time-add (car cached) remote-file-name-inhibit-cache))) (and (consp remote-file-name-inhibit-cache) (time-less-p - remote-file-name-inhibit-cache (car value))))) - (setq value (cdr value)) - (setq value default)) + remote-file-name-inhibit-cache (car cached))))) + (setq value (cdr cached) + use-cache t)) - (tramp-message key 8 "%s %s %s" file property value) + (tramp-message key 8 "%s %s %s; inhibit: %s; cache used: %s; cached at: %s" + file property value + remote-file-name-inhibit-cache use-cache cached-at) (when (>= tramp-verbose 10) (let* ((var (intern (concat "tramp-cache-get-count-" property))) (val (or (numberp (bound-and-true-p var)) @@ -310,15 +316,19 @@ the connection, return DEFAULT." (setf (tramp-file-name-localname key) nil (tramp-file-name-hop key) nil)) (let* ((hash (tramp-get-hash-table key)) - (value - ;; If the key is an auxiliary process object, check whether - ;; the process is still alive. - (if (and (processp key) (not (process-live-p key))) - default - (if (hash-table-p hash) - (gethash property hash default) - default)))) - (tramp-message key 7 "%s %s" property value) + (cached (if (hash-table-p hash) + (gethash property hash tramp-cache-undefined) + tramp-cache-undefined)) + (value default) + use-cache) + + (when (and (not (eq cached tramp-cache-undefined)) + ;; If the key is an auxiliary process object, check + ;; whether the process is still alive. + (not (and (processp key) (not (process-live-p key))))) + (setq value cached + use-cache t)) + (tramp-message key 7 "%s %s; cache used: %s" property value use-cache) value)) ;;;###tramp-autoload commit e90b7b9ef2af00fb206052bc4458d7e692e5d413 Author: Alan Mackenzie Date: Sun May 3 11:25:19 2020 +0000 Revert "Mark breakpoints in edebug with highlights". This fixes bug #40992 Do not merge to master. This reverts commit e8b3a15cb6ff187ce08afcb43bd9a0b7907268ca. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index e6aed3a120..dd1a17eb51 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2755,7 +2755,6 @@ See `edebug-behavior-alist' for implementations.") (edebug-stop)) (edebug-overlay-arrow) - (edebug--overlay-breakpoints edebug-function) (unwind-protect (if (or edebug-stop @@ -3230,45 +3229,7 @@ the breakpoint." (setcar (cdr edebug-data) edebug-breakpoints) (goto-char position) - (edebug--overlay-breakpoints edebug-def-name))))) - -(define-fringe-bitmap 'edebug-breakpoint - "\x3c\x7e\xff\xff\xff\xff\x7e\x3c") - -(defun edebug--overlay-breakpoints (function) - (let* ((data (get function 'edebug)) - (start (nth 0 data)) - (breakpoints (nth 1 data)) - (offsets (nth 2 data))) - ;; First remove all old breakpoint overlays. - (edebug--overlay-breakpoints-remove - start (+ start (aref offsets (1- (length offsets))))) - ;; Then make overlays for the breakpoints (but only when we are in - ;; edebug mode). - (when edebug-active - (dolist (breakpoint breakpoints) - (let* ((pos (+ start (aref offsets (car breakpoint)))) - (overlay (make-overlay pos (1+ pos))) - (face (if (nth 4 breakpoint) - (progn - (overlay-put overlay - 'help-echo "Disabled breakpoint") - (overlay-put overlay - 'face 'edebug-disabled-breakpoint)) - (overlay-put overlay 'help-echo "Breakpoint") - (overlay-put overlay 'face 'edebug-enabled-breakpoint)))) - (overlay-put overlay 'edebug t) - (let ((fringe (make-overlay pos pos))) - (overlay-put fringe 'edebug t) - (overlay-put fringe 'before-string - (propertize - "x" 'display - `(left-fringe edebug-breakpoint ,face))))))))) - -(defun edebug--overlay-breakpoints-remove (start end) - (dolist (overlay (overlays-in start end)) - (when (overlay-get overlay 'edebug) - (delete-overlay overlay)))) + )))) (defun edebug-set-breakpoint (arg) "Set the breakpoint of nearest sexp. commit 0a3731feef351f6af47bed1458aefb6cb481b5f9 Author: Paul Eggert Date: Sat May 2 13:48:21 2020 -0700 Make memq etc. examples more like they were Problem reported by Štěpán Němec in: https://lists.gnu.org/r/emacs-devel/2020-05/msg00130.html * doc/lispref/lists.texi (Sets And Lists, Association Lists): Revert examples to be more like the way they were, using self-evaluating expressions. Be more consistent about listing unspecified results. diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index ea44e01f48..fcaf4386b1 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -1242,8 +1242,8 @@ compare @var{object} against the elements of the list. For example: @result{} (b c b a) @end group @group -(memq '(2) '((1) (2))) ; @r{@code{(2)} and @code{(2)} are not @code{eq}.} - @result{} nil +(memq '(2) '((1) (2))) ; @r{The two @code{(2)}s need not be @code{eq}.} + @result{} @r{Unspecified; might be @code{nil} or @code{((2))}.} @end group @end example @end defun @@ -1356,12 +1356,12 @@ Compare this with @code{memq}: @example @group -(memql 1.2 '(1.1 1.2 1.3)) ; @r{@code{1.2} and @code{1.2} must be @code{eql}.} +(memql 1.2 '(1.1 1.2 1.3)) ; @r{@code{1.2} and @code{1.2} are @code{eql}.} @result{} (1.2 1.3) @end group @group -(memq 1.2 '(1.1 1.2 1.3)) ; @r{@code{1.2} and @code{1.2} need not be @code{eq}.} - @result{} nil ; @r{... or it might be @code{(1.2 1.3)}.} +(memq 1.2 '(1.1 1.2 1.3)) ; @r{The two @code{1.2}s need not be @code{eq}.} + @result{} @r{Unspecified; might be @code{nil} or @code{(1.2 1.3)}.} @end group @end example @end defun @@ -1380,12 +1380,12 @@ Compare this with @code{memq}: @example @group -(member (list 2) '((1) (2))) ; @r{@code{(list 2)} and @code{(2)} are @code{equal}.} +(member '(2) '((1) (2))) ; @r{@code{(2)} and @code{(2)} are @code{equal}.} @result{} ((2)) @end group @group -(memq (list 2) '((1) (2))) ; @r{@code{(list 2)} and @code{(2)} are not @code{eq}.} - @result{} nil +(memq '(2) '((1) (2))) ; @r{The two @code{(2)}s need not be @code{eq}.} + @result{} @r{Unspecified; might be @code{nil} or @code{(2)}.} @end group @group ;; @r{Two strings with the same contents are @code{equal}.} @@ -1626,7 +1626,7 @@ keys may not be symbols: ("compound leaves" . horsechestnut))) (assq "simple leaves" leaves) - @result{} @r{Unspecified; might be @code{nil} or non-@code{nil}.} + @result{} @r{Unspecified; might be @code{nil} or @code{("simple leaves" . oak)}.} (assoc "simple leaves" leaves) @result{} ("simple leaves" . oak) @end smallexample commit ed25282b82732a7370a4a55633c5830fd473a9b7 Author: Eli Zaretskii Date: Sat May 2 10:54:01 2020 +0300 Document effect of 'search-upper-case' on replacement commands * doc/emacs/search.texi (Replacement and Lax Matches): Document the role of 'search-upper-case' in replacement commands. (Lax Search): Document the value 'not-yanks' of 'search-upper-case' where the variable itself is documented. * lisp/replace.el (query-replace-regexp, query-replace): Mention 'search-upper-case' and its effect in doc strings. (Bug#40940) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 16916617a2..2e094f3ad9 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1324,10 +1324,14 @@ case-sensitive. Thus, searching for @samp{Foo} does not find @samp{foo} or @samp{FOO}. This applies to regular expression search as well as to literal string search. The effect ceases if you delete the upper-case letter from the search string. The variable -@code{search-upper-case} controls this: if it is non-@code{nil} (the -default), an upper-case character in the search string makes the -search case-sensitive; setting it to @code{nil} disables this effect -of upper-case characters. +@code{search-upper-case} controls this: if it is non-@code{nil}, an +upper-case character in the search string makes the search +case-sensitive; setting it to @code{nil} disables this effect of +upper-case characters. The default value of this variable is +@code{not-yanks}, which makes search case-sensitive if there are +upper-case letters in the search string, and also causes text yanked +into the search string (@pxref{Isearch Yank}) to be down-cased, so +that such searches are case-insensitive by default. @vindex case-fold-search If you set the variable @code{case-fold-search} to @code{nil}, then @@ -1572,9 +1576,13 @@ searching for patterns. @cindex case folding in replace commands If the first argument of a replace command is all lower case, the command ignores case while searching for occurrences to -replace---provided @code{case-fold-search} is non-@code{nil}. If -@code{case-fold-search} is set to @code{nil}, case is always significant -in all searches. +replace---provided @code{case-fold-search} is non-@code{nil} and +@code{search-upper-case} is also non-@code{nil}. If +@code{search-upper-case} (@pxref{Lax Search, search-upper-case}) is +@code{nil}, whether searching ignores case is determined by +@code{case-fold-search} alone, regardless of letter-case of the +command's first argument. If @code{case-fold-search} is set to +@code{nil}, case is always significant in all searches. @vindex case-replace In addition, when the @var{newstring} argument is all or partly lower diff --git a/lisp/replace.el b/lisp/replace.el index 491bf33ea4..0880cbdb1e 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -340,13 +340,17 @@ that reads FROM-STRING, or invoke replacements from incremental search with a key sequence like `C-s C-s M-%' to use its current search string as the string to replace. -Matching is independent of case if `case-fold-search' is non-nil and -FROM-STRING has no uppercase letters. Replacement transfers the case -pattern of the old text to the new text, if `case-replace' and -`case-fold-search' are non-nil and FROM-STRING has no uppercase -letters. (Transferring the case pattern means that if the old text -matched is all caps, or capitalized, then its replacement is upcased -or capitalized.) +Matching is independent of case if both `case-fold-search' +and `search-upper-case' are non-nil and FROM-STRING has no +uppercase letters; if `search-upper-case' is nil, then +whether matching ignores case depends on `case-fold-search' +regardless of whether there are uppercase letters in FROM-STRING. +Replacement transfers the case pattern of the old text to the +new text, if both `case-fold-search' and `case-replace' are +non-nil and FROM-STRING has no uppercase letters. +\(Transferring the case pattern means that if the old text +matched is all caps, or capitalized, then its replacement is +respectively upcased or capitalized.) Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more @@ -402,13 +406,16 @@ that reads REGEXP, or invoke replacements from incremental search with a key sequence like `C-M-s C-M-s C-M-%' to use its current search regexp as the regexp to replace. -Matching is independent of case if `case-fold-search' is non-nil and -REGEXP has no uppercase letters. Replacement transfers the case -pattern of the old text to the new text, if `case-replace' and -`case-fold-search' are non-nil and REGEXP has no uppercase letters. -\(Transferring the case pattern means that if the old text matched is -all caps, or capitalized, then its replacement is upcased or -capitalized.) +Matching is independent of case if both `case-fold-search' +and `search-upper-case' are non-nil and REGEXP has no uppercase +letters; if `search-upper-case' is nil, then whether matching +ignores case depends on `case-fold-search' regardless of whether +there are uppercase letters in REGEXP. +Replacement transfers the case pattern of the old text to the new +text, if both `case-fold-search' and `case-replace' are non-nil +and REGEXP has no uppercase letters. (Transferring the case pattern +means that if the old text matched is all caps, or capitalized, +then its replacement is respectively upcased or capitalized.) Ignore read-only matches if `query-replace-skip-read-only' is non-nil, ignore hidden matches if `search-invisible' is nil, and ignore more commit 5a5d8a8ec0610aa4b26011ebae434bcf3e11c993 Author: Eli Zaretskii Date: Fri May 1 22:59:27 2020 +0300 * lisp/desktop.el (desktop-save): Doc fix. (Bug#41007) diff --git a/lisp/desktop.el b/lisp/desktop.el index 7745b50b64..b15ebc9b03 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1017,13 +1017,16 @@ Frames with a non-nil `desktop-dont-save' parameter are not saved." ;;;###autoload (defun desktop-save (dirname &optional release only-if-changed version) - "Save the desktop in a desktop file. -Parameter DIRNAME specifies where to save the desktop file. -Optional parameter RELEASE says whether we're done with this -desktop. If ONLY-IF-CHANGED is non-nil, compare the current -desktop information to that in the desktop file, and if the -desktop information has not changed since it was last saved then -do not rewrite the file. + "Save the state of Emacs in a desktop file in directory DIRNAME. +Optional argument RELEASE non-nil says we're done with this +desktop, in which case this function releases the lock of the +desktop file in DIRNAME. +If ONLY-IF-CHANGED is non-nil, compare the current desktop +information to that in the desktop file, and if the desktop +information has not changed since it was last saved, then do +not rewrite the file. + +To restore the desktop, use `desktop-read'. This function can save the desktop in either format version 208 (which only Emacs 25.1 and later can read) or version @@ -1033,14 +1036,20 @@ it was last saved, or version 208 when writing a fresh desktop file. To upgrade a version 206 file to version 208, call this command -explicitly with a bare prefix argument: C-u M-x desktop-save. -You are recommended to do this once you have firmly upgraded to -Emacs 25.1 (or later). To downgrade a version 208 file to version -206, use a double command prefix: C-u C-u M-x desktop-save. -Confirmation will be requested in either case. In a non-interactive -call, VERSION can be given as an integer, either 206 or 208, which -will be accepted as the format version in which to save the file -without further confirmation." +explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. +If you are upgrading from Emacs 24 or older, we recommed to do +this once you decide you no longer need compatibility with versions +of Emacs before 25.1. + +To downgrade a version 208 file to version 206, use a double prefix +argument: \\[universal-argument] \\[universal-argument] \\[desktop-save]. + +Emacs will ask for confirmation when you upgrade or downgrade your +desktop file. + +In a non-interactive call, VERSION can be given as an integer, either +206 or 208, to specify the format version in which to save the file, +no questions asked." (interactive (list ;; Or should we just use (car desktop-path)? (let ((default (if (member "." desktop-path) commit fc8e02a4d5ed87f53215d3ffff3b35ff650b0176 Author: Glenn Morris Date: Fri May 1 06:12:54 2020 -0700 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 8b4d21b3ce..fd0cd3efee 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -18799,8 +18799,8 @@ Check comments and strings in the current buffer for spelling errors." t nil) Check the current buffer for spelling errors interactively." t nil) (autoload 'ispell-buffer-with-debug "ispell" "\ -`ispell-buffer' with some output sent to `ispell-debug-buffer' buffer. -If APPEND is non-n il, append the info to previous buffer if exists. +`ispell-buffer' with some output sent to `ispell-debug-buffer'. +If APPEND is non-nil, don't erase previous debugging output. \(fn &optional APPEND)" t nil) @@ -21833,7 +21833,7 @@ unless the display width of STR is equal to or less than the display width of ELLIPSIS. If it is non-nil and not a string, then ELLIPSIS defaults to `truncate-string-ellipsis'. -If ELLIPSIS-TEXT-PROPERTY in non-nil, a too-long string will not +If ELLIPSIS-TEXT-PROPERTY is non-nil, a too-long string will not be truncated, but instead the elided parts will be covered by a `display' text property showing the ellipsis. @@ -30965,7 +30965,8 @@ as start and end positions), and with `string<' otherwise. \(fn REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN PREDICATE)" nil nil) (autoload 'sort-lines "sort" "\ -Sort lines in region alphabetically; argument means descending order. +Sort lines in region alphabetically; REVERSE non-nil means descending order. +Interactively, REVERSE is the prefix argument, and BEG and END are the region. Called from a program, there are three arguments: REVERSE (non-nil means reverse order), BEG and END (region to sort). The variable `sort-fold-case' determines whether alphabetic case affects @@ -34438,7 +34439,9 @@ You can call this function to add internal values in the trace buffer. (autoload 'trace-function-foreground "trace" "\ Trace calls to function FUNCTION. With a prefix argument, also prompt for the trace buffer (default -`trace-buffer'), and a Lisp expression CONTEXT. +`trace-buffer'), and a Lisp expression CONTEXT. When called from +Lisp, CONTEXT should be a function of no arguments which returns +a value to insert into BUFFER during the trace. Tracing a function causes every call to that function to insert into BUFFER Lisp-style trace messages that display the function's @@ -38850,19 +38853,10 @@ Zone out, completely." t nil) ;;;;;; "eshell/em-unix.el" "eshell/em-xtra.el" "facemenu.el" "faces.el" ;;;;;; "files.el" "font-core.el" "font-lock.el" "format.el" "frame.el" ;;;;;; "help.el" "hfy-cmap.el" "ibuf-ext.el" "indent.el" "international/characters.el" -;;;;;; "international/charprop.el" "international/charscript.el" -;;;;;; "international/cp51932.el" "international/eucjp-ms.el" "international/mule-cmds.el" -;;;;;; "international/mule-conf.el" "international/mule.el" "international/uni-bidi.el" -;;;;;; "international/uni-brackets.el" "international/uni-category.el" -;;;;;; "international/uni-combining.el" "international/uni-comment.el" -;;;;;; "international/uni-decimal.el" "international/uni-decomposition.el" -;;;;;; "international/uni-digit.el" "international/uni-lowercase.el" -;;;;;; "international/uni-mirrored.el" "international/uni-name.el" -;;;;;; "international/uni-numeric.el" "international/uni-old-name.el" -;;;;;; "international/uni-special-lowercase.el" "international/uni-special-titlecase.el" -;;;;;; "international/uni-special-uppercase.el" "international/uni-titlecase.el" -;;;;;; "international/uni-uppercase.el" "isearch.el" "jit-lock.el" -;;;;;; "jka-cmpr-hook.el" "language/burmese.el" "language/cham.el" +;;;;;; "international/charscript.el" "international/cp51932.el" +;;;;;; "international/eucjp-ms.el" "international/mule-cmds.el" +;;;;;; "international/mule-conf.el" "international/mule.el" "isearch.el" +;;;;;; "jit-lock.el" "jka-cmpr-hook.el" "language/burmese.el" "language/cham.el" ;;;;;; "language/chinese.el" "language/cyrillic.el" "language/czech.el" ;;;;;; "language/english.el" "language/ethiopic.el" "language/european.el" ;;;;;; "language/georgian.el" "language/greek.el" "language/hebrew.el" commit 1d477a0fec2b31101960a75702d8ae1c99ed21e1 Author: Stefan Kangas Date: Thu Apr 30 18:02:28 2020 +0200 Recommend to avoid unnecessary abbreviations in doc * doc/lispref/tips.texi (Documentation Tips): Recommend to avoid unnecessary abbreviations. (Bug#40011) diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 3b8da35b6c..5b09b2ccea 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -820,6 +820,14 @@ since many people are unfamiliar with it and mistake it for a typo. In most cases, the meaning is clear with just ``if''. Otherwise, try to find an alternate phrasing that conveys the meaning. +@item +Try to avoid using abbreviations such as ``e.g.'' (for ``for +example''), ``i.e.'' (for ``that is''), ``no.'' (for ``number''), +``c.f.'' (for ``in contrast to'') and ``w.r.t.'' (for ``with respect +to'') as much as possible. It is almost always clearer and easier to +read the expanded version.@footnote{We do use these occasionally, but +try not to overdo it.} + @item When a command is meaningful only in a certain mode or situation, do mention that in the documentation string. For example, commit aea1b4db72df92595a3f642d18bf57254d74772b Author: Eli Zaretskii Date: Thu Apr 30 17:02:57 2020 +0300 Revert "Fix calculator division truncation (bug#40892)" This reverts commit 82140c510c4d27e639b4bca1e9bf158f0f66c375. (Bug#40892) diff --git a/lisp/calculator.el b/lisp/calculator.el index 7e0b2fcc6a..6996990814 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -864,7 +864,7 @@ The result should not exceed the screen width." "\\.\\([^0-9].*\\)?$" ".0\\1" str)) (str (replace-regexp-in-string "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) - (float (string-to-number str))))) + (string-to-number str)))) (defun calculator-push-curnum () "Push the numeric value of the displayed number to the stack." commit 82140c510c4d27e639b4bca1e9bf158f0f66c375 Author: Mattias Engdegård Date: Thu Apr 30 15:06:06 2020 +0200 Fix calculator division truncation (bug#40892) * lisp/calculator.el (calculator-string-to-number): Convert decimal numbers input to float, fixing a regression introduced in f248292ede. Reported by Aitor Soroa. diff --git a/lisp/calculator.el b/lisp/calculator.el index 6996990814..7e0b2fcc6a 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -864,7 +864,7 @@ The result should not exceed the screen width." "\\.\\([^0-9].*\\)?$" ".0\\1" str)) (str (replace-regexp-in-string "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) - (string-to-number str)))) + (float (string-to-number str))))) (defun calculator-push-curnum () "Push the numeric value of the displayed number to the stack." commit 1f17193e00692b1bb9739415b0b56ed8f16f049f Author: Dmitry Gutov Date: Wed Apr 29 22:46:17 2020 +0300 Expand file name for remote dirs as well * lisp/progmodes/project.el (project--files-in-directory): Expand file name for remote dirs as well (bug#40940). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index dbc967b885..f5f4092bab 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -186,16 +186,14 @@ to find the list of ignores for each directory." (require 'xref) (defvar find-name-arg) (let* ((default-directory dir) - (dirname (file-remote-p dir 'localname)) - (dirname (or dirname - ;; Make sure ~/ etc. in local directory name is - ;; expanded and not left for the shell command - ;; to interpret. - (expand-file-name dir))) + ;; Make sure ~/ etc. in local directory name is + ;; expanded and not left for the shell command + ;; to interpret. + (localdir (file-local-name (expand-file-name dir))) (command (format "%s %s %s -type f %s -print0" find-program - dirname - (xref--find-ignores-arguments ignores dirname) + localdir + (xref--find-ignores-arguments ignores localdir) (if files (concat (shell-quote-argument "(") " " find-name-arg " " commit 7a12ab5ea2257f8e9d3f4ba03918cf9709a728e1 Author: Eli Zaretskii Date: Wed Apr 29 18:58:42 2020 +0300 Fix project.el commands in "transient" projects * lisp/progmodes/project.el (project--files-in-directory): Run local DIR directory names through 'expand-file-name', so that "~/" is expanded, in case the shell doesn't or the shell's notion of the home directory is different from that of Emacs. (Bug#40940) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1f4cbe96ad..dbc967b885 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -185,23 +185,27 @@ to find the list of ignores for each directory." (require 'find-dired) (require 'xref) (defvar find-name-arg) - (let ((default-directory dir) - (command (format "%s %s %s -type f %s -print0" - find-program - (file-local-name dir) - (xref--find-ignores-arguments - ignores - (expand-file-name dir)) - (if files - (concat (shell-quote-argument "(") - " " find-name-arg " " - (mapconcat - #'shell-quote-argument - (split-string files) - (concat " -o " find-name-arg " ")) - " " - (shell-quote-argument ")"))"") - ))) + (let* ((default-directory dir) + (dirname (file-remote-p dir 'localname)) + (dirname (or dirname + ;; Make sure ~/ etc. in local directory name is + ;; expanded and not left for the shell command + ;; to interpret. + (expand-file-name dir))) + (command (format "%s %s %s -type f %s -print0" + find-program + dirname + (xref--find-ignores-arguments ignores dirname) + (if files + (concat (shell-quote-argument "(") + " " find-name-arg " " + (mapconcat + #'shell-quote-argument + (split-string files) + (concat " -o " find-name-arg " ")) + " " + (shell-quote-argument ")"))"") + ))) (project--remote-file-names (sort (split-string (shell-command-to-string command) "\0" t) #'string<)))) commit 274ec97e3c65ab082264867ba3531cb853f491a9 Author: Eli Zaretskii Date: Wed Apr 29 17:52:53 2020 +0300 Make sure alist-related functions say so in their doc * src/fns.c (Fassq, assq_no_quit, Fassoc, assoc_no_quit, Frassq) (Frassoc): Rename argument LIST to ALIST. Doc strings updated. diff --git a/src/fns.c b/src/fns.c index 3b5feace52..392196e2c7 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1604,16 +1604,16 @@ The value is actually the tail of LIST whose car is ELT. */) } DEFUN ("assq", Fassq, Sassq, 2, 2, 0, - doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. -The value is actually the first element of LIST whose car is KEY. -Elements of LIST that are not conses are ignored. */) - (Lisp_Object key, Lisp_Object list) + doc: /* Return non-nil if KEY is `eq' to the car of an element of ALIST. +The value is actually the first element of ALIST whose car is KEY. +Elements of ALIST that are not conses are ignored. */) + (Lisp_Object key, Lisp_Object alist) { - Lisp_Object tail = list; + Lisp_Object tail = alist; FOR_EACH_TAIL (tail) if (CONSP (XCAR (tail)) && EQ (XCAR (XCAR (tail)), key)) return XCAR (tail); - CHECK_LIST_END (tail, list); + CHECK_LIST_END (tail, alist); return Qnil; } @@ -1621,22 +1621,22 @@ Elements of LIST that are not conses are ignored. */) Use only on objects known to be non-circular lists. */ Lisp_Object -assq_no_quit (Lisp_Object key, Lisp_Object list) +assq_no_quit (Lisp_Object key, Lisp_Object alist) { - for (; ! NILP (list); list = XCDR (list)) - if (CONSP (XCAR (list)) && EQ (XCAR (XCAR (list)), key)) - return XCAR (list); + for (; ! NILP (alist); alist = XCDR (alist)) + if (CONSP (XCAR (alist)) && EQ (XCAR (XCAR (alist)), key)) + return XCAR (alist); return Qnil; } DEFUN ("assoc", Fassoc, Sassoc, 2, 3, 0, - doc: /* Return non-nil if KEY is equal to the car of an element of LIST. -The value is actually the first element of LIST whose car equals KEY. + doc: /* Return non-nil if KEY is equal to the car of an element of ALIST. +The value is actually the first element of ALIST whose car equals KEY. Equality is defined by TESTFN if non-nil or by `equal' if nil. */) - (Lisp_Object key, Lisp_Object list, Lisp_Object testfn) + (Lisp_Object key, Lisp_Object alist, Lisp_Object testfn) { - Lisp_Object tail = list; + Lisp_Object tail = alist; FOR_EACH_TAIL (tail) { Lisp_Object car = XCAR (tail); @@ -1647,7 +1647,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil. */) : !NILP (call2 (testfn, XCAR (car), key)))) return car; } - CHECK_LIST_END (tail, list); + CHECK_LIST_END (tail, alist); return Qnil; } @@ -1656,11 +1656,11 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil. */) that are not too deep and are not window configurations. */ Lisp_Object -assoc_no_quit (Lisp_Object key, Lisp_Object list) +assoc_no_quit (Lisp_Object key, Lisp_Object alist) { - for (; ! NILP (list); list = XCDR (list)) + for (; ! NILP (alist); alist = XCDR (alist)) { - Lisp_Object car = XCAR (list); + Lisp_Object car = XCAR (alist); if (CONSP (car) && (EQ (XCAR (car), key) || equal_no_quit (XCAR (car), key))) return car; @@ -1669,24 +1669,24 @@ assoc_no_quit (Lisp_Object key, Lisp_Object list) } DEFUN ("rassq", Frassq, Srassq, 2, 2, 0, - doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST. -The value is actually the first element of LIST whose cdr is KEY. */) - (Lisp_Object key, Lisp_Object list) + doc: /* Return non-nil if KEY is `eq' to the cdr of an element of ALIST. +The value is actually the first element of ALIST whose cdr is KEY. */) + (Lisp_Object key, Lisp_Object alist) { - Lisp_Object tail = list; + Lisp_Object tail = alist; FOR_EACH_TAIL (tail) if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key)) return XCAR (tail); - CHECK_LIST_END (tail, list); + CHECK_LIST_END (tail, alist); return Qnil; } DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0, - doc: /* Return non-nil if KEY is `equal' to the cdr of an element of LIST. -The value is actually the first element of LIST whose cdr equals KEY. */) - (Lisp_Object key, Lisp_Object list) + doc: /* Return non-nil if KEY is `equal' to the cdr of an element of ALIST. +The value is actually the first element of ALIST whose cdr equals KEY. */) + (Lisp_Object key, Lisp_Object alist) { - Lisp_Object tail = list; + Lisp_Object tail = alist; FOR_EACH_TAIL (tail) { Lisp_Object car = XCAR (tail); @@ -1694,7 +1694,7 @@ The value is actually the first element of LIST whose cdr equals KEY. */) && (EQ (XCDR (car), key) || !NILP (Fequal (XCDR (car), key)))) return car; } - CHECK_LIST_END (tail, list); + CHECK_LIST_END (tail, alist); return Qnil; }