commit 395a76ad1c16614adf166a68658f68dd41b2aaa2 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Thu Mar 19 23:02:28 2015 -0700 # ChangeLog fixes Using eg add-change-log-entry-other-window, C-x 4 a, would avoid these issues diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0172cd0..ac99cd5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,7 +6,7 @@ 2015-03-19 Vibhav Pant - * lisp/progmodes/cperl-mode.el (cperl-electric-backspace): + * progmodes/cperl-mode.el (cperl-electric-backspace): Call delete-backward-space interactively instead of delete-char. 2015-03-19 Stefan Monnier @@ -73,9 +73,9 @@ 2015-03-19 Vibhav Pant - * lisp/leim/quail/hangul.el (hangul-delete-backward-char) + * leim/quail/hangul.el (hangul-delete-backward-char) (hangul-to-hanja-conversion): - * lisp/progmodes/cperl-mode.el (cperl-electric-keyword) + * progmodes/cperl-mode.el (cperl-electric-keyword) (cperl-electric-backspace): Use delete-char instead of delete-backward-char, fixes compilation warnings. @@ -115,7 +115,7 @@ 2015-03-18 Dima Kogan Have gud-display-line not display source buffer in gud window. - * lisp/progmodes/gud.el (gud-display-line): Make display-buffer + * progmodes/gud.el (gud-display-line): Make display-buffer not reuse selected window. (Bug#17675, Bug#19901, Bug#20034) 2015-03-17 Tassilo Horn @@ -1767,7 +1767,7 @@ 2015-01-30 Oleh Krehel - * lisp/custom.el (defface): Set `indent' to 1. + * custom.el (defface): Set `indent' to 1. 2015-01-30 Oleh Krehel @@ -1775,21 +1775,21 @@ 2015-01-30 Michal Nazarewicz - * lisp/files.el (save-buffers-kill-emacs): If `confirm-kill-emacs' + * files.el (save-buffers-kill-emacs): If `confirm-kill-emacs' is set, but user has just been asked whether they really want to kill Emacs (for example with a ‘Modified buffers exist; exit anyway?’ prompt), do not ask them for another confirmation. 2015-01-29 Jay Belanger - * lisp/calc/calc-units.el (calc-convert-exact-units): New function. + * calc/calc-units.el (calc-convert-exact-units): New function. (calc-convert-units): Check for missing units. (math-consistent-units-p): Strengthen the test for consistent units. - * lisp/calc/calc-ext.el (calc-init-extensions): Autoload + * calc/calc-ext.el (calc-init-extensions): Autoload `calc-convert-exact-units' and assign it a keybinding. - * lisp/calc/calc-help (calc-u-prefix-help): Add help for the + * calc/calc-help (calc-u-prefix-help): Add help for the "un" keybinding. 2015-01-28 Stefan Monnier commit 8142fc97af742e083fb83e4d0470da59b123a467 Author: Dmitry Gutov Date: Fri Mar 20 07:03:54 2015 +0200 ruby-mode: Fix a "required arguments" confusion * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Move `at_exit' and `callcc' to the "methods with required arguments" section, they need a block argument. Remove a `throw' duplicate. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df2211b..0172cd0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-03-20 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-font-lock-keywords): Move `at_exit' + and `callcc' to the "methods with required arguments" section, + they need a block argument. Remove a `throw' duplicate. + 2015-03-19 Vibhav Pant * lisp/progmodes/cperl-mode.el (cperl-electric-backspace): diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 921ca31..f2fb95c 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2069,8 +2069,10 @@ See `font-lock-syntax-table'.") ruby-font-lock-keyword-beg-re (regexp-opt '( ;; built-in methods on Kernel + "at_exit" "autoload" "autoload?" + "callcc" "catch" "eval" "exec" @@ -2124,10 +2126,8 @@ See `font-lock-syntax-table'.") "__dir__" "__method__" "abort" - "at_exit" "binding" "block_given?" - "callcc" "caller" "exit" "exit!" @@ -2143,8 +2143,7 @@ See `font-lock-syntax-table'.") "readline" "readlines" "sleep" - "srand" - "throw") + "srand") 'symbols)) (1 font-lock-builtin-face)) ;; Here-doc beginnings. commit 13eb26ad38378e0063e9c9313c3ba8af666629dc Author: Paul Eggert Date: Thu Mar 19 18:33:59 2015 -0700 * configure.ac (_THREAD_SAFE): Simplify (Bug#20136). diff --git a/ChangeLog b/ChangeLog index d268ba0..a79863a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,7 @@ Better port of pthread usage to FreeBSD * configure.ac (ac_func_list): Omit pthread_sigmask, since we check for that ourselves rather than relying on gnulib. - (HAVE_PTHREAD, LIB_PTHREAD, _THREAD_SAFE): Port better to FreeBSD, + (HAVE_PTHREAD, LIB_PTHREAD): Port better to FreeBSD, by also checking for pthread_create, pthread_self, pthread_sigmask. Tighten the test for pthread_atfork while we're at it. Fixes: bug#20136 diff --git a/configure.ac b/configure.ac index 520816b1..40c8d2b 100644 --- a/configure.ac +++ b/configure.ac @@ -2234,7 +2234,7 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then hpux* | sol*) AC_DEFINE([_REENTRANT], 1, [Define to 1 if your system requires this in multithreaded code.]);; - aix4-2 | darwin | freebsd) + aix4-2) AC_DEFINE([_THREAD_SAFE], 1, [Define to 1 if your system requires this in multithreaded code.]);; esac commit a68aa2e15be21297d6e8dccb2bcd86422fdebe15 Author: Paul Eggert Date: Thu Mar 19 14:14:07 2015 -0700 Better port of pthread usage to FreeBSD * configure.ac (ac_func_list): Omit pthread_sigmask, since we check for that ourselves rather than relying on gnulib. (HAVE_PTHREAD, LIB_PTHREAD, _THREAD_SAFE): Port better to FreeBSD, by also checking for pthread_create, pthread_self, pthread_sigmask. Tighten the test for pthread_atfork while we're at it. Fixes: bug#20136 diff --git a/ChangeLog b/ChangeLog index 9d7ba93..d268ba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2015-03-19 Paul Eggert + Better port of pthread usage to FreeBSD + * configure.ac (ac_func_list): Omit pthread_sigmask, since + we check for that ourselves rather than relying on gnulib. + (HAVE_PTHREAD, LIB_PTHREAD, _THREAD_SAFE): Port better to FreeBSD, + by also checking for pthread_create, pthread_self, pthread_sigmask. + Tighten the test for pthread_atfork while we're at it. + Fixes: bug#20136 + Merge from gnulib This incorporates: 2015-03-19 fdopendir: port better to MinGW diff --git a/configure.ac b/configure.ac index d65494a..520816b1 100644 --- a/configure.ac +++ b/configure.ac @@ -780,6 +780,12 @@ AC_DEFUN([gl_CRYPTO_CHECK]) # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, # as we don't use them. AC_DEFUN([gl_FCNTL_O_FLAGS]) +# Avoid gnulib's test for pthread_sigmask. +funcs= +for func in $ac_func_list; do + test $func = pthread_sigmask || AS_VAR_APPEND([funcs], [" $func"]) +done +ac_func_list=$funcs # Use the system putenv even if it lacks GNU features, as we don't need them, # and the gnulib replacement runs afoul of a FreeBSD 10.1 bug; see Bug#19874. AC_CHECK_FUNCS_ONCE([putenv]) @@ -2179,39 +2185,62 @@ AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") dnl Check for the POSIX thread library. LIB_PTHREAD= -if test "$opsys" != "mingw32"; then AC_CHECK_HEADERS_ONCE(pthread.h) -if test "$ac_cv_header_pthread_h"; then - dnl gmalloc.c uses pthread_atfork, which is not available on older-style - dnl hosts such as MirBSD 10, so test for pthread_atfork instead of merely - dnl testing for pthread_kill if Emacs uses gmalloc.c. - if test "$GMALLOC_OBJ" = gmalloc.o; then - emacs_pthread_function=pthread_atfork - else - emacs_pthread_function=pthread_kill - fi - OLD_LIBS=$LIBS - AC_SEARCH_LIBS([$emacs_pthread_function], [pthread], - [AC_DEFINE([HAVE_PTHREAD], [1], - [Define to 1 if you have pthread (-lpthread).]) - # Some systems optimize for single-threaded programs by default, and - # need special flags to disable these optimizations. For example, the - # definition of 'errno' in . - case $opsys in - sol*) - AC_DEFINE([_REENTRANT], 1, - [Define to 1 if your system requires this in multithreaded code.]);; - aix4-2) - AC_DEFINE([_THREAD_SAFE], 1, - [Define to 1 if your system requires this in multithreaded code.]);; - esac]) - if test "X$LIBS" != "X$OLD_LIBS"; then - eval LIB_PTHREAD=\$ac_cv_search_$emacs_pthread_function +if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then + AC_CACHE_CHECK([for pthread library], + [emacs_cv_pthread_lib], + [emacs_cv_pthread_lib=no + OLD_CPPFLAGS=$CPPFLAGS + OLD_LIBS=$LIBS + for emacs_pthread_lib in 'none needed' -lpthread; do + case $emacs_pthread_lib in + -*) LIBS="$OLD_LIBS $emacs_pthread_lib";; + esac + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + sigset_t old_mask, new_mask; + void noop (void) {}]], + [[pthread_t th = pthread_self (); + int status = 0; + status += pthread_create (&th, 0, 0, 0); + status += pthread_sigmask (SIG_BLOCK, &new_mask, &old_mask); + status += pthread_kill (th, 0); + #if ! (defined SYSTEM_MALLOC || defined HYBRID_MALLOC \ + || defined DOUG_LEA_MALLOC) + /* Test for pthread_atfork only if gmalloc uses it, + as older-style hosts like MirBSD 10 lack it. */ + status += pthread_atfork (noop, noop, noop); + #endif + return status;]])], + [emacs_cv_pthread_lib=$emacs_pthread_lib]) + LIBS=$OLD_LIBS + if test "$emacs_cv_pthread_lib" != no; then + break + fi + done + CPPFLAGS=$OLD_CPPFLAGS]) + if test "$emacs_cv_pthread_lib" != no; then + AC_DEFINE([HAVE_PTHREAD], 1, [Define to 1 if you have POSIX threads.]) + case $emacs_cv_pthread_lib in + -*) LIB_PTHREAD=$emacs_cv_pthread_lib;; + esac + ac_cv_func_pthread_sigmask=yes + # Some systems optimize for single-threaded programs by default, and + # need special flags to disable these optimizations. For example, the + # definition of 'errno' in . + case $opsys in + hpux* | sol*) + AC_DEFINE([_REENTRANT], 1, + [Define to 1 if your system requires this in multithreaded code.]);; + aix4-2 | darwin | freebsd) + AC_DEFINE([_THREAD_SAFE], 1, + [Define to 1 if your system requires this in multithreaded code.]);; + esac fi - LIBS=$OLD_LIBS fi AC_SUBST([LIB_PTHREAD]) -fi dnl Check for need for bigtoc support on IBM AIX commit 3ffcf0e3dedb94e065733dc0a5923d7fef42de49 Author: Vibhav Pant Date: Fri Mar 20 01:43:37 2015 +0530 Call delete-backward-space interactively. * lisp/progmodes/cperl-mode.el (cperl-electric-backspace): Call delete-backward-space interactively instead of delete-char. * lisp/Changelog: Fix previous changelog. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2500e3..df2211b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-19 Vibhav Pant + + * lisp/progmodes/cperl-mode.el (cperl-electric-backspace): + Call delete-backward-space interactively instead of delete-char. + 2015-03-19 Stefan Monnier * emacs-lisp/pcase.el (pcase-lambda): Rewrite. @@ -62,8 +67,10 @@ 2015-03-19 Vibhav Pant - * lisp/leim/quail/hangul.el - * lisp/progmodes/cperl-mode.el: Use delete-char instead of + * lisp/leim/quail/hangul.el (hangul-delete-backward-char) + (hangul-to-hanja-conversion): + * lisp/progmodes/cperl-mode.el (cperl-electric-keyword) + (cperl-electric-backspace): Use delete-char instead of delete-backward-char, fixes compilation warnings. 2015-03-18 Michael Albinus diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index f207016..2acfc10 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -2588,7 +2588,7 @@ Will untabify if `cperl-electric-backspace-untabify' is non-nil." (delete-region (point) p)) (if cperl-electric-backspace-untabify (backward-delete-char-untabify arg) - (delete-char (- arg)))))) + (call-interactively 'delete-backward-char))))) (put 'cperl-electric-backspace 'delete-selection 'supersede) commit ccf00107f7aa8897cde017bec3717ecc350515f7 Author: Paul Eggert Date: Thu Mar 19 12:32:42 2015 -0700 Merge from gnulib This incorporates: 2015-03-19 fdopendir: port better to MinGW 2015-03-18 fdopendir: fix typo in comment 2015-02-24 glob, etc.: port to MSVC v18 on MS-Windows 8.1 * lib/dirent.in.h, lib/fdopendir.c: Update from gnulib. * lib/dirfd.c, m4/dirfd.m4: New files from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. diff --git a/ChangeLog b/ChangeLog index 4f6523e..9d7ba93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2015-03-19 Paul Eggert + + Merge from gnulib + This incorporates: + 2015-03-19 fdopendir: port better to MinGW + 2015-03-18 fdopendir: fix typo in comment + 2015-02-24 glob, etc.: port to MSVC v18 on MS-Windows 8.1 + * lib/dirent.in.h, lib/fdopendir.c: Update from gnulib. + * lib/dirfd.c, m4/dirfd.m4: New files from gnulib. + * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. + 2015-03-02 Robert Pluim (tiny change) * configure.ac: Error out if with-file-notification=w32 is diff --git a/lib/dirent.in.h b/lib/dirent.in.h index ddd3b84..154d268 100644 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -77,6 +77,7 @@ typedef struct gl_directory DIR; # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef opendir # define opendir rpl_opendir +# define GNULIB_defined_opendir 1 # endif _GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name)); @@ -128,6 +129,7 @@ _GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef closedir # define closedir rpl_closedir +# define GNULIB_defined_closedir 1 # endif _GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (closedir, int, (DIR *dirp)); diff --git a/lib/dirfd.c b/lib/dirfd.c new file mode 100644 index 0000000..c91f8e5 --- /dev/null +++ b/lib/dirfd.c @@ -0,0 +1,32 @@ +/* dirfd.c -- return the file descriptor associated with an open DIR* + + Copyright (C) 2001, 2006, 2008-2015 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 Jim Meyering. */ + +#include + +#include +#include + +int +dirfd (DIR *dir_p) +{ + int fd = DIR_TO_FD (dir_p); + if (fd == -1) + errno = ENOTSUP; + return fd; +} diff --git a/lib/fdopendir.c b/lib/fdopendir.c index 9dc1e7b..837a821 100644 --- a/lib/fdopendir.c +++ b/lib/fdopendir.c @@ -93,7 +93,7 @@ fdopendir (int fd) That way, barring race conditions, fd_clone_opendir returns a stream whose file descriptor is FD. - If REPLACE_CHDIR or CWD is null, use opendir ("/proc/self/fd/...", + If REPLACE_FCHDIR or CWD is null, use opendir ("/proc/self/fd/...", falling back on fchdir metadata. Otherwise, CWD is a saved version of the working directory; use fchdir/opendir(".")/restore_cwd(CWD). */ static DIR * @@ -156,7 +156,16 @@ fd_clone_opendir (int fd, struct saved_cwd const *cwd) if (! dir && EXPECTED_ERRNO (saved_errno)) { char const *name = _gl_directory_name (fd); - return (name ? opendir (name) : NULL); + DIR *dp = name ? opendir (name) : NULL; + + /* The caller has done an elaborate dance to arrange for opendir to + consume just the right file descriptor. If dirfd returns -1, + though, we're on a system like mingw where opendir does not + consume a file descriptor. Consume it via 'dup' instead. */ + if (dp && dirfd (dp) < 0) + dup (fd); + + return dp; } # endif errno = saved_errno; diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 1b671e7..7703cbf 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -237,6 +237,17 @@ EXTRA_DIST += dirent.in.h ## end gnulib module dirent +## begin gnulib module dirfd + +if gl_GNULIB_ENABLED_dirfd + +endif +EXTRA_DIST += dirfd.c + +EXTRA_libgnu_a_SOURCES += dirfd.c + +## end gnulib module dirfd + ## begin gnulib module dosname if gl_GNULIB_ENABLED_dosname diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 new file mode 100644 index 0000000..ce56cff --- /dev/null +++ b/m4/dirfd.m4 @@ -0,0 +1,83 @@ +# serial 22 -*- Autoconf -*- + +dnl Find out how to get the file descriptor associated with an open DIR*. + +# Copyright (C) 2001-2006, 2008-2015 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering + +AC_DEFUN([gl_FUNC_DIRFD], +[ + AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + + dnl Persuade glibc to declare dirfd(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_FUNCS([dirfd]) + AC_CHECK_DECLS([dirfd], , , + [[#include + #include ]]) + if test $ac_cv_have_decl_dirfd = no; then + HAVE_DECL_DIRFD=0 + fi + + AC_CACHE_CHECK([whether dirfd is a macro], + gl_cv_func_dirfd_macro, + [AC_EGREP_CPP([dirent_header_defines_dirfd], [ +#include +#include +#ifdef dirfd + dirent_header_defines_dirfd +#endif], + gl_cv_func_dirfd_macro=yes, + gl_cv_func_dirfd_macro=no)]) + + # Use the replacement only if we have no function or macro with that name. + if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then + if test $ac_cv_have_decl_dirfd = yes; then + # If the system declares dirfd already, let's declare rpl_dirfd instead. + REPLACE_DIRFD=1 + fi + fi +]) + +dnl Prerequisites of lib/dirfd.c. +AC_DEFUN([gl_PREREQ_DIRFD], +[ + AC_CACHE_CHECK([how to get the file descriptor associated with an open DIR*], + [gl_cv_sys_dir_fd_member_name], + [ + dirfd_save_CFLAGS=$CFLAGS + for ac_expr in d_fd dd_fd; do + + CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include ]], + [[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;]])], + [dir_fd_found=yes] + ) + CFLAGS=$dirfd_save_CFLAGS + test "$dir_fd_found" = yes && break + done + test "$dir_fd_found" = yes || ac_expr=no_such_member + + gl_cv_sys_dir_fd_member_name=$ac_expr + ] + ) + if test $gl_cv_sys_dir_fd_member_name != no_such_member; then + AC_DEFINE_UNQUOTED([DIR_FD_MEMBER_NAME], + [$gl_cv_sys_dir_fd_member_name], + [the name of the file descriptor member of DIR]) + fi + AH_VERBATIM([DIR_TO_FD], + [#ifdef DIR_FD_MEMBER_NAME +# define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME) +#else +# define DIR_TO_FD(Dir_p) -1 +#endif +]) +]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 5763fae..949dd0e 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -56,6 +56,7 @@ AC_DEFUN([gl_EARLY], # Code from module crypto/sha256: # Code from module crypto/sha512: # Code from module dirent: + # Code from module dirfd: # Code from module dosname: # Code from module dtoastr: # Code from module dtotimespec: @@ -394,6 +395,7 @@ AC_DEFUN([gl_INIT], gl_UTIMENS AC_C_VARARRAYS gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false + gl_gnulib_enabled_dirfd=false gl_gnulib_enabled_dosname=false gl_gnulib_enabled_euidaccess=false gl_gnulib_enabled_getdtablesize=false @@ -416,6 +418,18 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true fi } + func_gl_gnulib_m4code_dirfd () + { + if ! $gl_gnulib_enabled_dirfd; then + gl_FUNC_DIRFD + if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then + AC_LIBOBJ([dirfd]) + gl_PREREQ_DIRFD + fi + gl_DIRENT_MODULE_INDICATOR([dirfd]) + gl_gnulib_enabled_dirfd=true + fi + } func_gl_gnulib_m4code_dosname () { if ! $gl_gnulib_enabled_dosname; then @@ -595,6 +609,9 @@ AC_DEFUN([gl_INIT], if test $HAVE_FDOPENDIR = 0; then func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b fi + if test $HAVE_FDOPENDIR = 0; then + func_gl_gnulib_m4code_dirfd + fi if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b fi @@ -636,6 +653,7 @@ AC_DEFUN([gl_INIT], fi m4_pattern_allow([^gl_GNULIB_ENABLED_]) AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b]) + 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_getdtablesize], [$gl_gnulib_enabled_getdtablesize]) @@ -822,6 +840,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/count-trailing-zeros.c lib/count-trailing-zeros.h lib/dirent.in.h + lib/dirfd.c lib/dosname.h lib/dtoastr.c lib/dtotimespec.c @@ -940,6 +959,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/count-one-bits.m4 m4/count-trailing-zeros.m4 m4/dirent_h.m4 + m4/dirfd.m4 m4/dup2.m4 m4/environ.m4 m4/errno_h.m4 commit 8aa13d07fe72b8a00ded10602f5c5ce773181b40 Author: Stefan Monnier Date: Thu Mar 19 13:46:36 2015 -0400 * lisp/emacs-lisp/pcase.el (pcase-lambda): Rewrite. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 74a0988..a2500e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2015-03-19 Stefan Monnier + * emacs-lisp/pcase.el (pcase-lambda): Rewrite. + * emacs-lisp/eieio.el (object-slots): Return slot names as before (bug#20141). diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 4706be5..0e8a969 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -166,23 +166,26 @@ like `(,a . ,(pred (< a))) or, with more checks: ;;;###autoload (defmacro pcase-lambda (lambda-list &rest body) - "Like `lambda' but allow each argument to be a pattern. -`&rest' argument is supported." + "Like `lambda' but allow each argument to be a UPattern. +I.e. accepts the usual &optional and &rest keywords, but every +formal argument can be any pattern accepted by `pcase' (a mere +variable name being but a special case of it)." (declare (doc-string 2) (indent defun) - (debug ((&rest pcase-UPAT &optional ["&rest" pcase-UPAT]) body))) - (let ((args (make-symbol "args")) - (pats (mapcar (lambda (u) - (unless (eq u '&rest) - (if (eq (car-safe u) '\`) (cadr u) (list '\, u)))) - lambda-list)) - (body (macroexp-parse-body body))) - ;; Handle &rest - (when (eq nil (car (last pats 2))) - (setq pats (append (butlast pats 2) (car (last pats))))) - `(lambda (&rest ,args) - ,@(car body) - (pcase ,args - (,(list '\` pats) . ,(cdr body)))))) + (debug ((&rest pcase-UPAT) body))) + (let* ((bindings ()) + (parsed-body (macroexp-parse-body body)) + (args (mapcar (lambda (pat) + (if (symbolp pat) + ;; Simple vars and &rest/&optional are just passed + ;; through unchanged. + pat + (let ((arg (make-symbol + (format "arg%s" (length bindings))))) + (push `(,pat ,arg) bindings) + arg))) + lambda-list))) + `(lambda ,args ,@(car parsed-body) + (pcase-let* ,(nreverse bindings) ,@(cdr parsed-body))))) (defun pcase--let* (bindings body) (cond commit 29f7f98b7c3755f8f9e9dcef60bd460794cf2104 Author: Stefan Monnier Date: Thu Mar 19 10:35:52 2015 -0400 Fixes: debbugs:20141 * lisp/emacs-lisp/eieio.el (object-slots): Return slot names as before. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c751f4..74a0988 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,23 +1,9 @@ 2015-03-19 Stefan Monnier - * emacs-lisp/eieio.el (with-slots): Use macroexp-let2. - (object-class-fast): Change recommend replacement. - (eieio-object-class): Rewrite. - (slot-exists-p): Adjust to new slot representation. - (initialize-instance): Adjust to new slot representation. - (object-write): Adjust to new slot representation. - - * emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function - extracted from eieio-help-class-slots. - (eieio-help-class-slots): Use it. Adjust to new slot representation. + * emacs-lisp/eieio.el (object-slots): Return slot names as before + (bug#20141). - * emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): - Declare to silence warnings. - (data-debug-insert-object-button): Avoid `object-slots'. - (data-debug/eieio-insert-slots): Adjust to new slot representation. - - * emacs-lisp/eieio-custom.el (eieio-object-value-create) - (eieio-object-value-get): Adjust to new slot representation. +2015-03-19 Stefan Monnier EIEIO: Change class's representation to unify instance and class slots * emacs-lisp/eieio-core.el (eieio--class): Change field names and order @@ -41,7 +27,27 @@ (eieio--class/struct-parents): New function. (eieio--class-precedence-bfs): Use it. - * emacs-lisp/eieio-compat.el (eieio--generic-static-symbol-specializers): + * emacs-lisp/eieio.el (with-slots): Use macroexp-let2. + (object-class-fast): Change recommend replacement. + (eieio-object-class): Rewrite. + (slot-exists-p): Adjust to new slot representation. + (initialize-instance): Adjust to new slot representation. + (object-write): Adjust to new slot representation. + + * emacs-lisp/eieio-opt.el (eieio--help-print-slot): New function + extracted from eieio-help-class-slots. + (eieio-help-class-slots): Use it. Adjust to new slot representation. + + * emacs-lisp/eieio-datadebug.el (data-debug/eieio-insert-slots): + Declare to silence warnings. + (data-debug-insert-object-button): Avoid `object-slots'. + (data-debug/eieio-insert-slots): Adjust to new slot representation. + + * emacs-lisp/eieio-custom.el (eieio-object-value-create) + (eieio-object-value-get): Adjust to new slot representation. + + * emacs-lisp/eieio-compat.el + (eieio--generic-static-symbol-specializers): Extract from eieio--generic-static-symbol-generalizer. (eieio--generic-static-symbol-generalizer): Use it. diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 4ba6769..8d76df8 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -453,10 +453,11 @@ The CLOS function `class-direct-subclasses' is aliased to this function." (mapcar #'identity (eieio--class-slots class))) (defun object-slots (obj) - "Return list of slots available in OBJ." + "Return list of slot names available in OBJ." (declare (obsolete eieio-class-slots "25.1")) (cl-check-type obj eieio-object) - (eieio-class-slots (eieio--object-class obj))) + (mapcar #'cl--slot-descriptor-name + (eieio-class-slots (eieio--object-class obj)))) (defun eieio--class-slot-initarg (class slot) "Fetch from CLASS, SLOT's :initarg."