commit ba5d32398ba42fcf14ad5242d95c68133981744f (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Thu Sep 8 08:28:59 2016 +0200 New file test/src/marker-tests.el diff --git a/test/src/marker-tests.el b/test/src/marker-tests.el new file mode 100644 index 0000000..18d49ad --- /dev/null +++ b/test/src/marker-tests.el @@ -0,0 +1,60 @@ +;;; marker-tests.el --- tests for marker.c functions -*- lexical-binding: t -*- + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; 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 . + +;;; Code: + +(require 'ert) + +;; The following three tests assert that Emacs survives operations +;; copying a marker whose character position differs from its byte +;; position into a buffer whose character size equals its byte size +;; (Bug#24368). + +(ert-deftest marker-set-window-start-from-other-buffer () + "`set-window-start' from other buffer's marker." + (let ((text-quoting-style 'curve)) + (describe-function 'describe-function)) + (let* ((help (get-buffer "*Help*")) + (marker (with-current-buffer help + (copy-marker (point-max))))) + (should (set-window-start (selected-window) marker)))) + +(ert-deftest marker-set-window-point-from-other-buffer () + "`set-window-point' from another buffer's marker." + (let ((text-quoting-style 'curve)) + (describe-function 'describe-function)) + (let* ((help (get-buffer "*Help*")) + (marker (with-current-buffer help + (copy-marker (point-max))))) + (with-selected-window (get-buffer-window help) + (should (set-window-point (get-buffer-window "*scratch*") marker))))) + +(ert-deftest marker-goto-char-from-other-buffer () + "`goto-char' from another buffer's marker." + (let ((text-quoting-style 'curve)) + (describe-function 'describe-function)) + (let ((marker-1 (make-marker)) + (marker-2 (make-marker))) + (describe-function 'describe-function) + (with-current-buffer "*Help*" + (set-marker marker-1 (point-max))) + (set-marker marker-2 marker-1) + (should (goto-char marker-2)))) + +;;; marker-tests.el ends here. commit d2f1971dd570439da4198fa76603b53b072060f8 Author: Paul Eggert Date: Wed Sep 7 18:08:45 2016 -0700 Port flexible array members to GCC + valgrind These changes are needed to conform to the C standard's rule for allocating structs containing flexible array members. C11 says that malloc (offsetof (struct s, m) + n) does not suffice to allocate a struct with an n-byte tail; instead, malloc’s arg should be rounded up to the nearest multiple of alignof (struct s). Although this is arguably a defect in C11, gcc -O2 + valgrind sometimes complains when this rule is violated, and when debugging it’s better to keep valgrind happy. For details please see the thread containing the message at: https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00416.html * lib-src/ebrowse.c, src/alloc.c, src/image.c, src/process.c: Include flexmember.h. * lib-src/ebrowse.c (add_sym, add_member, make_namespace) (register_namespace_alias): * src/alloc.c (SDATA_SIZE, allocate_string_data): * src/image.c (xpm_cache_color, imagemagick_create_cache): * src/process.c (Fmake_network_process): Use FLEXSIZEOF instead of offsetof and addition. * src/alloc.c (SDATA_SIZE, vector_alignment): Use FLEXALIGNOF instead of sizeof (ptrdiff_t). * src/lisp.h (ALIGNOF_STRUCT_LISP_VECTOR): Remove, as alloc.c can now calculate this on its own. diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index c59181f..7a26200 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -32,6 +32,7 @@ along with GNU Emacs. If not, see . */ #define SEEK_END 2 #endif +#include #include /* Files are read in chunks of this number of bytes. */ @@ -582,7 +583,7 @@ add_sym (const char *name, struct sym *nested_in_class) puts (name); } - sym = xmalloc (offsetof (struct sym, name) + strlen (name) + 1); + sym = xmalloc (FLEXSIZEOF (struct sym, name, strlen (name) + 1)); memset (sym, 0, offsetof (struct sym, name)); strcpy (sym->name, name); sym->namesp = scope; @@ -867,8 +868,8 @@ add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, static struct member * add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) { - struct member *m = xmalloc (offsetof (struct member, name) - + strlen (name) + 1); + struct member *m = xmalloc (FLEXSIZEOF (struct member, name, + strlen (name) + 1)); struct member **list; struct member *p; struct member *prev; @@ -978,7 +979,7 @@ mark_inherited_virtual (void) static struct sym * make_namespace (char *name, struct sym *context) { - struct sym *s = xmalloc (offsetof (struct sym, name) + strlen (name) + 1); + struct sym *s = xmalloc (FLEXSIZEOF (struct sym, name, strlen (name) + 1)); memset (s, 0, offsetof (struct sym, name)); strcpy (s->name, name); s->next = all_namespaces; @@ -1062,7 +1063,7 @@ register_namespace_alias (char *new_name, struct link *old_name) if (streq (new_name, al->name) && (al->namesp == current_namespace)) return; - al = xmalloc (offsetof (struct alias, name) + strlen (new_name) + 1); + al = xmalloc (FLEXSIZEOF (struct alias, name, strlen (new_name) + 1)); strcpy (al->name, new_name); al->next = namespace_alias_table[h]; al->namesp = current_namespace; diff --git a/src/alloc.c b/src/alloc.c index 67187f1..5bbd5e5 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -46,6 +46,7 @@ along with GNU Emacs. If not, see . */ #include TERM_HEADER #endif /* HAVE_WINDOW_SYSTEM */ +#include #include #include /* For backtrace. */ @@ -1757,27 +1758,23 @@ static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = #ifdef GC_CHECK_STRING_BYTES -#define SDATA_SIZE(NBYTES) \ - ((SDATA_DATA_OFFSET \ - + (NBYTES) + 1 \ - + sizeof (ptrdiff_t) - 1) \ - & ~(sizeof (ptrdiff_t) - 1)) +#define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, NBYTES) #else /* not GC_CHECK_STRING_BYTES */ /* The 'max' reserves space for the nbytes union member even when NBYTES + 1 is less than the size of that member. The 'max' is not needed when - SDATA_DATA_OFFSET is a multiple of sizeof (ptrdiff_t), because then the - alignment code reserves enough space. */ + SDATA_DATA_OFFSET is a multiple of FLEXALIGNOF (struct sdata), + because then the alignment code reserves enough space. */ #define SDATA_SIZE(NBYTES) \ ((SDATA_DATA_OFFSET \ - + (SDATA_DATA_OFFSET % sizeof (ptrdiff_t) == 0 \ + + (SDATA_DATA_OFFSET % FLEXALIGNOF (struct sdata) == 0 \ ? NBYTES \ - : max (NBYTES, sizeof (ptrdiff_t) - 1)) \ + : max (NBYTES, FLEXALIGNOF (struct sdata) - 1)) \ + 1 \ - + sizeof (ptrdiff_t) - 1) \ - & ~(sizeof (ptrdiff_t) - 1)) + + FLEXALIGNOF (struct sdata) - 1) \ + & ~(FLEXALIGNOF (struct sdata) - 1)) #endif /* not GC_CHECK_STRING_BYTES */ @@ -1997,7 +1994,7 @@ allocate_string_data (struct Lisp_String *s, if (nbytes > LARGE_STRING_BYTES) { - size_t size = offsetof (struct sblock, data) + needed; + size_t size = FLEXSIZEOF (struct sblock, data, needed); #ifdef DOUG_LEA_MALLOC if (!mmap_lisp_allowed_p ()) @@ -2953,15 +2950,15 @@ set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p) enum { /* Alignment of struct Lisp_Vector objects. */ - vector_alignment = COMMON_MULTIPLE (ALIGNOF_STRUCT_LISP_VECTOR, - GCALIGNMENT), + vector_alignment = COMMON_MULTIPLE (FLEXALIGNOF (struct Lisp_Vector), + GCALIGNMENT), /* Vector size requests are a multiple of this. */ roundup_size = COMMON_MULTIPLE (vector_alignment, word_size) }; /* Verify assumptions described above. */ -verify ((VECTOR_BLOCK_SIZE % roundup_size) == 0); +verify (VECTOR_BLOCK_SIZE % roundup_size == 0); verify (VECTOR_BLOCK_SIZE <= (1 << PSEUDOVECTOR_SIZE_BITS)); /* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at compile time. */ diff --git a/src/image.c b/src/image.c index 7a554ef..f15c278 100644 --- a/src/image.c +++ b/src/image.c @@ -30,7 +30,9 @@ along with GNU Emacs. If not, see . */ #endif #include + #include +#include #include "lisp.h" #include "frame.h" @@ -3347,7 +3349,7 @@ xpm_cache_color (struct frame *f, char *color_name, XColor *color, int bucket) if (bucket < 0) bucket = xpm_color_bucket (color_name); - nbytes = offsetof (struct xpm_cached_color, name) + strlen (color_name) + 1; + nbytes = FLEXSIZEOF (struct xpm_cached_color, name, strlen (color_name) + 1); p = xmalloc (nbytes); strcpy (p->name, color_name); p->color = *color; @@ -8328,8 +8330,8 @@ static struct animation_cache * imagemagick_create_cache (char *signature) { struct animation_cache *cache - = xmalloc (offsetof (struct animation_cache, signature) - + strlen (signature) + 1); + = xmalloc (FLEXSIZEOF (struct animation_cache, signature, + strlen (signature) + 1)); cache->wand = 0; cache->index = 0; cache->next = 0; diff --git a/src/lisp.h b/src/lisp.h index 97c8d9f..29ed9fe 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1429,13 +1429,6 @@ struct Lisp_Vector Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; }; -/* C11 prohibits alignof (struct Lisp_Vector), so compute it manually. */ -enum - { - ALIGNOF_STRUCT_LISP_VECTOR - = alignof (union { struct vectorlike_header a; Lisp_Object b; }) - }; - /* A boolvector is a kind of vectorlike, with contents like a string. */ struct Lisp_Bool_Vector diff --git a/src/process.c b/src/process.c index 9895119..29bf43e 100644 --- a/src/process.c +++ b/src/process.c @@ -88,6 +88,7 @@ along with GNU Emacs. If not, see . */ #endif #include +#include #include #include @@ -3807,8 +3808,8 @@ usage: (make-network-process &rest ARGS) */) struct gaicb gaicb; struct addrinfo hints; char str[FLEXIBLE_ARRAY_MEMBER]; - } *req = xmalloc (offsetof (struct req, str) - + hostlen + 1 + portstringlen + 1); + } *req = xmalloc (FLEXSIZEOF (struct req, str, + hostlen + 1 + portstringlen + 1)); dns_request = &req->gaicb; dns_request->ar_name = req->str; dns_request->ar_service = req->str + hostlen + 1; commit 12a7e0f88eaa68aabe7e32589e2d5c8f776f6346 Author: Paul Eggert Date: Wed Sep 7 17:04:49 2016 -0700 Update from gnulib This incorporates: 2016-09-07 flexmember: new macro FLEXALIGNOF 2016-09-07 flexmember: port better to GCC + valgrind 2016-08-18 Port modules to use getprogname explicitly 2016-09-02 manywarnings: add -fno-common * admin/merge-gnulib (GNULIB_TOOL_FLAGS): Don’t avoid flexmember, since time_rz now uses part of it. Instead, remove m4/flexmember.m4. * configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Define away, since Emacs assumes C99 and therefore removes m4/flexmember.m4. * lib/euidaccess.c, lib/group-member.c, lib/time_rz.c: * m4/manywarnings.m4: Copy from gnulib. * lib/flexmember.h: New file, from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 5d65127..1e3b759 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -44,7 +44,7 @@ GNULIB_MODULES=' GNULIB_TOOL_FLAGS=' --avoid=close --avoid=dup - --avoid=fchdir --avoid=flexmember --avoid=fstat + --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise @@ -93,7 +93,8 @@ test -x "$gnulib_srcdir"/gnulib-tool || { } "$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS $GNULIB_MODULES && -rm -- "$src"lib/gl_openssl.h "$src"m4/fcntl-o.m4 "$src"m4/gl-openssl.m4 \ +rm -- "$src"lib/gl_openssl.h "$src"m4/fcntl-o.m4 "$src"m4/flexmember.m4 \ + "$src"m4/gl-openssl.m4 \ "$src"m4/gnulib-cache.m4"$src" m4/warn-on-use.m4 && cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux && diff --git a/configure.ac b/configure.ac index e8aeae2..9856228 100644 --- a/configure.ac +++ b/configure.ac @@ -775,6 +775,8 @@ dnl alternative to lib/gnulib.mk, so as to avoid generating header files dnl that clash with MinGW. AM_CONDITIONAL([BUILDING_FOR_WINDOWSNT], [test "x$opsys" = "xmingw32"]) +# Skip gnulib's tests for flexible array members, as Emacs assumes C99. +AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER]) # Avoid gnulib's tests for -lcrypto, so that there's no static dependency on it. AC_DEFUN([gl_CRYPTO_CHECK]) # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, diff --git a/lib/euidaccess.c b/lib/euidaccess.c index 82af941..e9eb0e9 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -197,8 +197,6 @@ weak_alias (__euidaccess, euidaccess) # include # include -char *program_name; - int main (int argc, char **argv) { @@ -206,7 +204,6 @@ main (int argc, char **argv) int mode; int err; - program_name = argv[0]; if (argc < 3) abort (); file = argv[1]; diff --git a/lib/flexmember.h b/lib/flexmember.h new file mode 100644 index 0000000..62c556b --- /dev/null +++ b/lib/flexmember.h @@ -0,0 +1,42 @@ +/* Sizes of structs with flexible array members. + + Copyright 2016 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program. If not, see . + + Written by Paul Eggert. */ + +#include + +/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below. + On older platforms without _Alignof, use a pessimistic bound that is + safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1. + On newer platforms, use _Alignof to get a tighter bound. */ + +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1)) +#else +# define FLEXALIGNOF(type) _Alignof (type) +#endif + +/* Upper bound on the size of a struct of type TYPE with a flexible + array member named MEMBER that is followed by N bytes of other data. + This is not simply sizeof (TYPE) + N, since it may require + alignment on unusually picky C11 platforms, and + FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. + Yield a value less than N if and only if arithmetic overflow occurs. */ + +#define FLEXSIZEOF(type, member, n) \ + ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \ + & ~ (FLEXALIGNOF (type) - 1)) diff --git a/lib/gnulib.mk b/lib/gnulib.mk index cc84296..c431de6 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=flexmember --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=unsetenv --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings +# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=unsetenv --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings MOSTLYCLEANFILES += core *.stackdump @@ -449,6 +449,15 @@ EXTRA_DIST += filevercmp.h ## end gnulib module filevercmp +## begin gnulib module flexmember + +if gl_GNULIB_ENABLED_flexmember + +endif +EXTRA_DIST += flexmember.h + +## end gnulib module flexmember + ## begin gnulib module fpending diff --git a/lib/group-member.c b/lib/group-member.c index 365e166..6bbab89 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -97,15 +97,11 @@ group_member (gid_t gid) #ifdef TEST -char *program_name; - int main (int argc, char **argv) { int i; - program_name = argv[0]; - for (i = 1; i < argc; i++) { gid_t gid; diff --git a/lib/time_rz.c b/lib/time_rz.c index 55b764e..38afb5f 100644 --- a/lib/time_rz.c +++ b/lib/time_rz.c @@ -32,6 +32,7 @@ #include #include +#include "flexmember.h" #include "time-internal.h" #if !HAVE_TZSET @@ -94,7 +95,7 @@ tzalloc (char const *name) { size_t name_size = name ? strlen (name) + 1 : 0; size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; - timezone_t tz = malloc (offsetof (struct tm_zone, abbrs) + abbr_size); + timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); if (tz) { tz->next = NULL; diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 5a3fc98..5fc667c 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -79,6 +79,7 @@ AC_DEFUN([gl_EARLY], # Code from module fdopendir: # Code from module filemode: # Code from module filevercmp: + # Code from module flexmember: # Code from module fpending: # Code from module fstatat: # Code from module fsync: @@ -413,6 +414,7 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_dirfd=false gl_gnulib_enabled_dosname=false gl_gnulib_enabled_euidaccess=false + gl_gnulib_enabled_flexmember=false gl_gnulib_enabled_getdtablesize=false gl_gnulib_enabled_getgroups=false gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false @@ -472,6 +474,13 @@ AC_DEFUN([gl_INIT], fi fi } + func_gl_gnulib_m4code_flexmember () + { + if ! $gl_gnulib_enabled_flexmember; then + AC_C_FLEXIBLE_ARRAY_MEMBER + gl_gnulib_enabled_flexmember=true + fi + } func_gl_gnulib_m4code_getdtablesize () { if ! $gl_gnulib_enabled_getdtablesize; then @@ -679,6 +688,9 @@ AC_DEFUN([gl_INIT], if { test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; } && test $ac_cv_type_unsigned_long_long_int = yes; then func_gl_gnulib_m4code_strtoull fi + if test "$HAVE_TIMEZONE_T" = 0; then + func_gl_gnulib_m4code_flexmember + fi if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 fi @@ -687,6 +699,7 @@ AC_DEFUN([gl_INIT], AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd]) AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname]) AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_flexmember], [$gl_gnulib_enabled_flexmember]) AM_CONDITIONAL([gl_GNULIB_ENABLED_getdtablesize], [$gl_gnulib_enabled_getdtablesize]) AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups]) AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) @@ -892,6 +905,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/filemode.h lib/filevercmp.c lib/filevercmp.h + lib/flexmember.h lib/fpending.c lib/fpending.h lib/fstatat.c @@ -1013,6 +1027,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/fdatasync.m4 m4/fdopendir.m4 m4/filemode.m4 + m4/flexmember.m4 m4/fpending.m4 m4/fstatat.m4 m4/fsync.m4 diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 90823b0..89fd0ae 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -103,6 +103,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], gl_manywarn_set= for gl_manywarn_item in \ + -fno-common \ -W \ -Wabi \ -Waddress \ commit a08ce41ed8e9fd8768dcd1ecd22ff6bc4c4c7f8f Author: Noam Postavsky Date: Sun Aug 21 10:51:38 2016 -0400 Don't --load directories * lisp/startup.el (command-line-1): Only pass expanded FILENAME argument of --load when it refers to a normal file, since `load' doesn't handle directories (Bug #16406). diff --git a/lisp/startup.el b/lisp/startup.el index fcdc376..d5225bd 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2393,7 +2393,7 @@ nil default-directory" name) ;; Take file from default dir if it exists there; ;; otherwise let `load' search for it. (file-ex (expand-file-name file))) - (when (file-exists-p file-ex) + (when (file-regular-p file-ex) (setq file file-ex)) (load file nil t))) commit 55dde6c1a21a792d3d75c19e612c74dd054aaf1e Author: Peder O. Klingenberg Date: Tue Aug 30 14:44:16 2016 +0200 Avoid error in icalendar--read-element * lisp/calendar/icalendar.el (icalendar--read-element): Avoid a regex stack overflow by not using regex to extract values from calendar events. (Bug#24315) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 386c554..c88f4ab 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -361,7 +361,8 @@ Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to INVALUE gives the current iCalendar element we are reading. INPARAMS gives the current parameters..... This function calls itself recursively for each nested calendar element -it finds." +it finds. The current buffer should be an unfolded buffer as returned +from `icalendar--get-unfolded-buffer'." (let (element children line name params param param-name param-value value (continue t)) @@ -391,8 +392,9 @@ it finds." (unless (looking-at ":") (error "Oops")) (forward-char 1) - (re-search-forward "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t) - (setq value (icalendar--rris "\r?\n[ \t]" "" (match-string 0))) + (let ((start (point))) + (end-of-line) + (setq value (buffer-substring start (point)))) (setq line (list name params value)) (cond ((eq name 'BEGIN) (setq children commit 32078ec8c444cd886a51c1a63103b230371d7a54 Author: Kaushal Modi Date: Thu Aug 25 11:06:45 2016 -0400 Fix back-white <-> black-white typo * lisp/ps-print.el (ps-begin-job): back-white -> black-white (Bug#24308) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 2ea0919..54ffe28 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -5828,7 +5828,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-default-background (ps-rgb-color (cond ((or (member ps-print-color-p - '(nil back-white)) + '(nil black-white)) (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-bg 'frame-parameter) @@ -5842,7 +5842,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-default-foreground (ps-rgb-color (cond ((or (member ps-print-color-p - '(nil back-white)) + '(nil black-white)) (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-fg 'frame-parameter) @@ -5857,12 +5857,12 @@ XSTART YSTART are the relative position for the first page in a sheet.") #'(lambda (arg) (ps-rgb-color arg "unspecified-fg" 0.0)) (append (and (not (member ps-print-color-p - '(nil back-white))) + '(nil black-white))) ps-fg-list) (list ps-default-foreground "black"))) ps-default-color (and (not (member ps-print-color-p - '(nil back-white))) + '(nil black-white))) ps-default-foreground) ps-current-color ps-default-color ;; Set up default functions. commit 3b3bc36b0d0b273534cf08a51d6a10c015875e2c Author: Alan Third Date: Sun Sep 4 22:58:37 2016 +0100 Fix cursor at bottom left of rectangle (bug#24364) * lisp/rect.el (rectangle--col-pos): Don't assume point at EOL doesn't require rectangle--point-crutches to be set. diff --git a/lisp/rect.el b/lisp/rect.el index 13499d6..f9bebc4 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -108,7 +108,7 @@ Point is at the end of the segment of this line within the rectangle." (defun rectangle--col-pos (col kind) (let ((c (move-to-column col))) - (if (= c col) + (if (and (= c col) (not (eolp))) (if (eq kind 'point) (if (window-parameter nil 'rectangle--point-crutches) (setf (window-parameter nil 'rectangle--point-crutches) nil)) commit ec12c6705f91106c4f4c53e76447dafa21e12f9f Author: Eli Zaretskii Date: Wed Sep 7 19:21:08 2016 +0300 Fix documentation of convert-standard-filename on MS-Windows * lisp/files.el (convert-standard-filename): Doc fix. (Bug#24387) * etc/NEWS: Suggest a way for mirroring slashes where previously 'convert-standard-filename' was used. diff --git a/etc/NEWS b/etc/NEWS index 79a476c..82eb2b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -605,7 +605,16 @@ still apply.) ** 'convert-standard-filename' no longer mirrors slashes on MS-Windows. Previously, on MS-Windows this function converted slash characters in -file names into backslashes. It no longer does that. +file names into backslashes. It no longer does that. If your Lisp +program used 'convert-standard-filename' to prepare file names to be +passed to subprocesses (which is not the recommended usage of that +function), you will now have to mirror slashes in your application +code. One possible way is this: + + (let ((start 0)) + (while (string-match "/" file-name start) + (aset file-name (match-beginning 0) ?\\) + (setq start (match-end 0)))) ** GUI sessions now treat SIGINT like Posix platforms do. The effect of delivering a Ctrl-C (SIGINT) signal to a GUI Emacs on diff --git a/lisp/files.el b/lisp/files.el index ff39008..4bd708d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -609,9 +609,7 @@ is a valid DOS file name, but c:/bar/c:/foo is not. This function's standard definition is trivial; it just returns the argument. However, on Windows and DOS, replace invalid characters. On DOS, make sure to obey the 8.3 limitations. -In the native Windows build, turn Cygwin names into native names, -and also turn slashes into backslashes if the shell requires it (see -`w32-shell-dos-semantics'). +In the native Windows build, turn Cygwin names into native names. See Info node `(elisp)Standard File Names' for more details." (cond