diff options
58 files changed, 3087 insertions, 2061 deletions
diff --git a/.bzrignore b/.bzrignore index c0f45b40534..6bc921f8c15 100644 --- a/.bzrignore +++ b/.bzrignore @@ -110,3 +110,5 @@ test/indent/*.new +* src/globals.h src/gl-stamp +lisp/mh-e/mh-autoloads.el +lisp/mh-e/mh-cus-load.el diff --git a/ChangeLog b/ChangeLog index 4bf89e35776..3fb10e14974 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-06-27 Bill Wohler <wohler@newt.com> + + * .bzrignore: Add lisp/mh-e/mh-autoloads.el and lisp/mh-e/mh-cus-load.el. + 2011-06-25 Paul Eggert <eggert@cs.ucla.edu> Use gnulib's dup2 module instead of rolling our own. diff --git a/autogen/Makefile.in b/autogen/Makefile.in index 41763bc9ba3..d3151304c5f 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -24,7 +24,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -52,9 +52,10 @@ subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/c-strtod.m4 \ - $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filemode.m4 \ - $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gl-comp.m4 $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/extensions.m4 \ + $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/getloadavg.m4 \ + $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gl-comp.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ @@ -738,14 +739,14 @@ BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h c++defs.h $(GETOPT_H) \ stdio.h stdlib.h sys/stat.h time.h unistd.h warn-on-use.h EXTRA_DIST = alloca.in.h allocator.h $(top_srcdir)/./arg-nonnull.h \ $(top_srcdir)/./c++defs.h careadlinkat.h md5.h sha1.h sha256.h \ - sha512.h dosname.h ftoastr.c ftoastr.h filemode.h getloadavg.c \ - getopt.c getopt.in.h getopt1.c getopt_int.h ignore-value.h \ - intprops.h inttypes.in.h lstat.c mktime-internal.h mktime.c \ - readlink.c stat.c stdarg.in.h stdbool.in.h stddef.in.h \ - stdint.in.h stdio.in.h stdlib.in.h strftime.h strtol.c \ - strtoul.c strtoull.c strtoimax.c strtoumax.c symlink.c \ - sys_stat.in.h time.in.h time_r.c u64.h unistd.in.h verify.h \ - $(top_srcdir)/./warn-on-use.h + sha512.h dosname.h ftoastr.c ftoastr.h dup2.c filemode.h \ + getloadavg.c getopt.c getopt.in.h getopt1.c getopt_int.h \ + ignore-value.h intprops.h inttypes.in.h lstat.c \ + mktime-internal.h mktime.c readlink.c stat.c stdarg.in.h \ + stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \ + strftime.h strtol.c strtoul.c strtoull.c strtoimax.c \ + strtoumax.c symlink.c sys_stat.in.h time.in.h time_r.c u64.h \ + unistd.in.h verify.h $(top_srcdir)/./warn-on-use.h MOSTLYCLEANDIRS = sys MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \ arg-nonnull.h-t c++defs.h c++defs.h-t getopt.h getopt.h-t \ @@ -759,9 +760,10 @@ libgnu_a_SOURCES = allocator.c careadlinkat.c md5.c sha1.c sha256.c \ sha512.c dtoastr.c filemode.c $(am__append_1) strftime.c libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) -EXTRA_libgnu_a_SOURCES = ftoastr.c getloadavg.c getopt.c getopt1.c \ - lstat.c mktime.c readlink.c stat.c strtol.c strtoul.c \ - strtoull.c strtoimax.c strtoumax.c symlink.c time_r.c +EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c getloadavg.c getopt.c \ + getopt1.c lstat.c mktime.c readlink.c stat.c strtol.c \ + strtoul.c strtoull.c strtoimax.c strtoumax.c symlink.c \ + time_r.c ARG_NONNULL_H = arg-nonnull.h CXXDEFS_H = c++defs.h WARN_ON_USE_H = warn-on-use.h @@ -817,6 +819,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ diff --git a/autogen/aclocal.m4 b/autogen/aclocal.m4 index 08bef24413f..8c0a25eba14 100644 --- a/autogen/aclocal.m4 +++ b/autogen/aclocal.m4 @@ -987,6 +987,7 @@ AC_SUBST([am__untar]) m4_include([m4/00gnulib.m4]) m4_include([m4/alloca.m4]) m4_include([m4/c-strtod.m4]) +m4_include([m4/dup2.m4]) m4_include([m4/extensions.m4]) m4_include([m4/filemode.m4]) m4_include([m4/getloadavg.m4]) diff --git a/autogen/configure b/autogen/configure index 06e293b170b..cf8fada0a36 100755 --- a/autogen/configure +++ b/autogen/configure @@ -894,6 +894,72 @@ PRAGMA_COLUMNS PRAGMA_SYSTEM_HEADER INCLUDE_NEXT_AS_FIRST_DIRECTIVE INCLUDE_NEXT +GETLOADAVG_LIBS +REPLACE_WCTOMB +REPLACE_UNSETENV +REPLACE_STRTOD +REPLACE_SETENV +REPLACE_REALPATH +REPLACE_REALLOC +REPLACE_PUTENV +REPLACE_MKSTEMP +REPLACE_MBTOWC +REPLACE_MALLOC +REPLACE_CANONICALIZE_FILE_NAME +REPLACE_CALLOC +HAVE_DECL_UNSETENV +HAVE_UNLOCKPT +HAVE_SYS_LOADAVG_H +HAVE_STRUCT_RANDOM_DATA +HAVE_STRTOULL +HAVE_STRTOLL +HAVE_STRTOD +HAVE_DECL_SETENV +HAVE_SETENV +HAVE_RPMATCH +HAVE_REALPATH +HAVE_RANDOM_R +HAVE_RANDOM_H +HAVE_PTSNAME +HAVE_MKSTEMPS +HAVE_MKSTEMP +HAVE_MKOSTEMPS +HAVE_MKOSTEMP +HAVE_MKDTEMP +HAVE_GRANTPT +HAVE_GETSUBOPT +HAVE_DECL_GETLOADAVG +HAVE_CANONICALIZE_FILE_NAME +HAVE_ATOLL +HAVE__EXIT +GNULIB_WCTOMB +GNULIB_UNSETENV +GNULIB_UNLOCKPT +GNULIB_SYSTEM_POSIX +GNULIB_STRTOULL +GNULIB_STRTOLL +GNULIB_STRTOD +GNULIB_SETENV +GNULIB_RPMATCH +GNULIB_REALPATH +GNULIB_REALLOC_POSIX +GNULIB_RANDOM_R +GNULIB_PUTENV +GNULIB_PTSNAME +GNULIB_MKSTEMPS +GNULIB_MKSTEMP +GNULIB_MKOSTEMPS +GNULIB_MKOSTEMP +GNULIB_MKDTEMP +GNULIB_MBTOWC +GNULIB_MALLOC_POSIX +GNULIB_GRANTPT +GNULIB_GETSUBOPT +GNULIB_GETLOADAVG +GNULIB_CANONICALIZE_FILE_NAME +GNULIB_CALLOC_POSIX +GNULIB_ATOLL +GNULIB__EXIT UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS UNISTD_H_HAVE_WINSOCK2_H REPLACE_WRITE @@ -1004,72 +1070,6 @@ GNULIB_DUP3 GNULIB_DUP2 GNULIB_CLOSE GNULIB_CHOWN -GETLOADAVG_LIBS -REPLACE_WCTOMB -REPLACE_UNSETENV -REPLACE_STRTOD -REPLACE_SETENV -REPLACE_REALPATH -REPLACE_REALLOC -REPLACE_PUTENV -REPLACE_MKSTEMP -REPLACE_MBTOWC -REPLACE_MALLOC -REPLACE_CANONICALIZE_FILE_NAME -REPLACE_CALLOC -HAVE_DECL_UNSETENV -HAVE_UNLOCKPT -HAVE_SYS_LOADAVG_H -HAVE_STRUCT_RANDOM_DATA -HAVE_STRTOULL -HAVE_STRTOLL -HAVE_STRTOD -HAVE_DECL_SETENV -HAVE_SETENV -HAVE_RPMATCH -HAVE_REALPATH -HAVE_RANDOM_R -HAVE_RANDOM_H -HAVE_PTSNAME -HAVE_MKSTEMPS -HAVE_MKSTEMP -HAVE_MKOSTEMPS -HAVE_MKOSTEMP -HAVE_MKDTEMP -HAVE_GRANTPT -HAVE_GETSUBOPT -HAVE_DECL_GETLOADAVG -HAVE_CANONICALIZE_FILE_NAME -HAVE_ATOLL -HAVE__EXIT -GNULIB_WCTOMB -GNULIB_UNSETENV -GNULIB_UNLOCKPT -GNULIB_SYSTEM_POSIX -GNULIB_STRTOULL -GNULIB_STRTOLL -GNULIB_STRTOD -GNULIB_SETENV -GNULIB_RPMATCH -GNULIB_REALPATH -GNULIB_REALLOC_POSIX -GNULIB_RANDOM_R -GNULIB_PUTENV -GNULIB_PTSNAME -GNULIB_MKSTEMPS -GNULIB_MKSTEMP -GNULIB_MKOSTEMPS -GNULIB_MKOSTEMP -GNULIB_MKDTEMP -GNULIB_MBTOWC -GNULIB_MALLOC_POSIX -GNULIB_GRANTPT -GNULIB_GETSUBOPT -GNULIB_GETLOADAVG -GNULIB_CANONICALIZE_FILE_NAME -GNULIB_CALLOC_POSIX -GNULIB_ATOLL -GNULIB__EXIT GL_GENERATE_ALLOCA_H_FALSE GL_GENERATE_ALLOCA_H_TRUE ALLOCA_H @@ -3083,6 +3083,7 @@ as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" as_fn_append ac_func_list " readlinkat" +as_fn_append ac_func_list " dup2" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" as_fn_append ac_header_list " wchar.h" @@ -6549,6 +6550,7 @@ esac # Code from module crypto/sha512: # Code from module dosname: # Code from module dtoastr: + # Code from module dup2: # Code from module extensions: # Code from module filemode: @@ -13586,7 +13588,7 @@ esac -for ac_func in gethostname getdomainname dup2 \ +for ac_func in gethostname getdomainname \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ random lrand48 logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select euidaccess getpagesize tzset setlocale \ @@ -14292,119 +14294,6 @@ $as_echo "#define HAVE_C99_STRTOLD 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 -$as_echo_n "checking for st_dm_mode in struct stat... " >&6; } -if test "${ac_cv_struct_st_dm_mode+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <sys/types.h> -#include <sys/stat.h> -int -main () -{ -struct stat s; s.st_dm_mode; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_st_dm_mode=yes -else - ac_cv_struct_st_dm_mode=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_dm_mode" >&5 -$as_echo "$ac_cv_struct_st_dm_mode" >&6; } - - if test $ac_cv_struct_st_dm_mode = yes; then - -$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h - - fi - - -ac_fn_c_check_decl "$LINENO" "strmode" "ac_cv_have_decl_strmode" "$ac_includes_default" -if test "x$ac_cv_have_decl_strmode" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRMODE $ac_have_decl -_ACEOF - - - GNULIB__EXIT=0; - GNULIB_ATOLL=0; - GNULIB_CALLOC_POSIX=0; - GNULIB_CANONICALIZE_FILE_NAME=0; - GNULIB_GETLOADAVG=0; - GNULIB_GETSUBOPT=0; - GNULIB_GRANTPT=0; - GNULIB_MALLOC_POSIX=0; - GNULIB_MBTOWC=0; - GNULIB_MKDTEMP=0; - GNULIB_MKOSTEMP=0; - GNULIB_MKOSTEMPS=0; - GNULIB_MKSTEMP=0; - GNULIB_MKSTEMPS=0; - GNULIB_PTSNAME=0; - GNULIB_PUTENV=0; - GNULIB_RANDOM_R=0; - GNULIB_REALLOC_POSIX=0; - GNULIB_REALPATH=0; - GNULIB_RPMATCH=0; - GNULIB_SETENV=0; - GNULIB_STRTOD=0; - GNULIB_STRTOLL=0; - GNULIB_STRTOULL=0; - GNULIB_SYSTEM_POSIX=0; - GNULIB_UNLOCKPT=0; - GNULIB_UNSETENV=0; - GNULIB_WCTOMB=0; - HAVE__EXIT=1; - HAVE_ATOLL=1; - HAVE_CANONICALIZE_FILE_NAME=1; - HAVE_DECL_GETLOADAVG=1; - HAVE_GETSUBOPT=1; - HAVE_GRANTPT=1; - HAVE_MKDTEMP=1; - HAVE_MKOSTEMP=1; - HAVE_MKOSTEMPS=1; - HAVE_MKSTEMP=1; - HAVE_MKSTEMPS=1; - HAVE_PTSNAME=1; - HAVE_RANDOM_H=1; - HAVE_RANDOM_R=1; - HAVE_REALPATH=1; - HAVE_RPMATCH=1; - HAVE_SETENV=1; - HAVE_DECL_SETENV=1; - HAVE_STRTOD=1; - HAVE_STRTOLL=1; - HAVE_STRTOULL=1; - HAVE_STRUCT_RANDOM_DATA=1; - HAVE_SYS_LOADAVG_H=0; - HAVE_UNLOCKPT=1; - HAVE_DECL_UNSETENV=1; - REPLACE_CALLOC=0; - REPLACE_CANONICALIZE_FILE_NAME=0; - REPLACE_MALLOC=0; - REPLACE_MBTOWC=0; - REPLACE_MKSTEMP=0; - REPLACE_PUTENV=0; - REPLACE_REALLOC=0; - REPLACE_REALPATH=0; - REPLACE_SETENV=0; - REPLACE_STRTOD=0; - REPLACE_UNSETENV=0; - REPLACE_WCTOMB=0; - GNULIB_CHOWN=0; GNULIB_CLOSE=0; @@ -14520,6 +14409,121 @@ _ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_dm_mode in struct stat" >&5 +$as_echo_n "checking for st_dm_mode in struct stat... " >&6; } +if test "${ac_cv_struct_st_dm_mode+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <sys/stat.h> +int +main () +{ +struct stat s; s.st_dm_mode; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_st_dm_mode=yes +else + ac_cv_struct_st_dm_mode=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_dm_mode" >&5 +$as_echo "$ac_cv_struct_st_dm_mode" >&6; } + + if test $ac_cv_struct_st_dm_mode = yes; then + +$as_echo "#define HAVE_ST_DM_MODE 1" >>confdefs.h + + fi + + +ac_fn_c_check_decl "$LINENO" "strmode" "ac_cv_have_decl_strmode" "$ac_includes_default" +if test "x$ac_cv_have_decl_strmode" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRMODE $ac_have_decl +_ACEOF + + + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_PTSNAME=0; + GNULIB_PUTENV=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_PTSNAME=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PUTENV=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } if test "${gl_cv_have_include_next+set}" = set; then : @@ -16760,6 +16764,114 @@ fi +$as_echo "#define HAVE_DUP2 1" >>confdefs.h + + + if test $HAVE_DUP2 = 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +$as_echo_n "checking whether dup2 works... " >&6; } +if test "${gl_cv_func_dup2_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works=no;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works=no;; + linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a + # closed fd may yield -EBADF instead of -1 / errno=EBADF. + gl_cv_func_dup2_works=no;; + freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF. + gl_cv_func_dup2_works=no;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works=no;; + *) gl_cv_func_dup2_works=yes;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <unistd.h> +#include <fcntl.h> +#include <errno.h> +int +main () +{ +int result = 0; +#ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; +#endif + if (dup2 (1, 1) == 0) + result |= 2; +#ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; +#endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, 1000000) == -1 && errno != EBADF) + result |= 16; + return result; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_dup2_works=yes +else + gl_cv_func_dup2_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 +$as_echo "$gl_cv_func_dup2_works" >&6; } + if test "$gl_cv_func_dup2_works" = no; then + + + + if test $ac_cv_func_dup2 = yes; then + REPLACE_DUP2=1 + fi + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + fi + + + + + + + GNULIB_DUP2=1 + + + + + + + + + + # Persuade glibc <stdlib.h> to declare getloadavg(). diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 1c9c6d1d3e1..e76003eec5a 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,7 @@ +2011-06-26 Glenn Morris <rgm@gnu.org> + + * fortran-xtra.texi (Fortran): F90 mode is also for F2008. + 2011-06-25 Andreas Rottmann <a.rottmann@gmx.at> * misc.texi (emacsclient Options): Mention --frame-parameters. diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi index 8f92df3f3ae..b7a4ef973ea 100644 --- a/doc/emacs/fortran-xtra.texi +++ b/doc/emacs/fortran-xtra.texi @@ -10,12 +10,12 @@ @cindex mode, Fortran @cindex Fortran fixed form and free form -@cindex Fortran 77 and Fortran 90, 95, 2003 +@cindex Fortran 77 and Fortran 90, 95, 2003, 2008 @findex f90-mode @findex fortran-mode Fortran mode is meant for editing ``fixed form'' (and also ``tab format'') source code (normally Fortran 77). For editing more modern -``free form'' source code (Fortran 90, 95, 2003), use F90 mode +``free form'' source code (Fortran 90, 95, 2003, 2008), use F90 mode (@code{f90-mode}). Emacs normally uses Fortran mode for files with extension @samp{.f}, @samp{.F} or @samp{.for}, and F90 mode for the extensions @samp{.f90} and @samp{.f95}. Customize diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index c0bcd307d7a..58f9d530ab5 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,14 @@ +2011-06-28 Deniz Dogan <deniz@dogan.se> + + * rcirc.texi (Configuration): Bug-fix: + `rcirc-default-user-full-name' is now `rcirc-default-full-name'. + Reported by Elias Pipping <pipping@exherbo.org>. + +2011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * gnus.texi (Summary Mail Commands): Document + `gnus-summary-reply-to-list-with-original'. + 2011-06-20 Stefan Monnier <monnier@iro.umontreal.ca> * eshell.texi (Known problems): Fix typo. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 82200780e19..f98d4df2bde 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -5568,6 +5568,13 @@ message (@code{gnus-summary-wide-reply-with-original}). This command uses the process/prefix convention, but only uses the headers from the first article to determine the recipients. +@item S L +@kindex S L (Summary) +@findex gnus-summary-reply-to-list-with-original +When replying to a message from a mailing list, send a reply to that +message to the mailing list, and include the original message +(@code{gnus-summary-reply-to-list-with-original}). + @item S v @kindex S v (Summary) @findex gnus-summary-very-wide-reply diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index c2b6867c419..3e9ee928822 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi @@ -509,8 +509,8 @@ This variable contains the default user name to report to the server. It defaults to the login name returned by @code{user-login-name}, just like @code{rcirc-default-nick}. -@item rcirc-default-user-full-name -@vindex rcirc-default-user-full-name +@item rcirc-default-full-name +@vindex rcirc-default-full-name @cindex full name @cindex real name @cindex surname @@ -519,7 +519,7 @@ to the name returned by @code{user-full-name}. If you want to hide your full name, you might want to set it to some pseudonym. @example -(setq rcirc-default-user-full-name "Curious Minds Want To Know") +(setq rcirc-default-full-name "Curious Minds Want To Know") @end example @item rcirc-authinfo @@ -926,7 +926,7 @@ The real answer, therefore, is a @code{/reconnect} command: (delete-process process) (rcirc-connect server port nick rcirc-default-user-name - rcirc-default-user-full-name + rcirc-default-full-name channels)))) @end smallexample @@ -787,6 +787,9 @@ the user for specifics, e.g. a merge source. **** Currently supported for Bzr, Git, and Mercurial. +*** New option `vc-revert-show-diff' controls whether `vc-revert' +shows a diff while querying the user. It defaults to t. + *** Log entries in some Log View buffers can be toggled to display a longer description by typing RET (log-view-toggle-entry-display). In the Log View buffers made by `C-x v L' (vc-print-root-log), you can @@ -802,6 +805,9 @@ of a file similar to `vc-diff', but using ediff backend. ** Miscellaneous ++++ +*** f90.el has some support for Fortran 2008 syntax. + --- *** `copyright-fix-years' can optionally convert consecutive years to ranges. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c8e3e31241..506cc2812d0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,281 @@ +2011-06-28 Chong Yidong <cyd@stupidchicken.com> + + * mail/emacsbug.el (report-emacs-bug): Handle non-gnu bug + addresses more clearly. Add hyperlinks for bug-gnu-emacs and + debbugs.gnu.org. Mention acknowledgment email. + +2011-06-28 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * mail/smtpmail.el (smtpmail-send-it): Leave off changing the + buffer multibyteness, since it shouldn't matter. + +2011-06-28 Martin Rudalics <rudalics@gmx.at> + + * window.el (display-buffer-in-side-window): Handle dedicated + windows as in display-buffer-reuse-window. + (display-buffer-normalize-alist): Use value of override + specifier. + (display-buffer-normalize-specifiers): Use value of + other-window-means-other-frame specifier. + (display-buffer-alist): Rewrite some texts in widgets. + (display-buffer): Spread arguments when calling function + specified by fun-with-args. + +2011-06-28 Deniz Dogan <deniz@dogan.se> + + * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table): Unnest + `let'. + + * textmodes/css-mode.el (css-font-lock-keywords): Fix grouped + selectors (Bug#5732). + (css-proprietary-nmstart-re): Use `regexp-opt'. + +2011-06-27 Jari Aalto <jari.aalto@cante.net> + + * eshell/em-ls.el: Display `ls -l' dates in ISO format (Bug#8440). + (eshell-ls-date-format): New defcustom. + (eshell-ls-file): Use it. + +2011-06-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * help-fns.el (describe-variable): Fix message for terminal-local vars. + +2011-06-27 Katsumi Yamaoka <yamaoka@jpl.org> + + * net/ange-ftp.el: Allow loading .gz files (Bug#6923). + (ange-ftp-make-tmp-name): New arg. + (ange-ftp-file-local-copy): Use it. + +2011-06-27 Jambunathan K <kjambunathan@gmail.com> + + * tar-mode.el (tar-untar-buffer): Set coding-system-for-write to + no-conversion (Bug#8870). + +2011-06-27 Martin Rudalics <rudalics@gmx.at> + + * window.el (window-right, window-left, window-child) + (window-child-count, window-last-child) + (window-iso-combination-p, walk-window-tree-1) + (window-atom-check-1, window-tree-1, delete-window) + (window-state-get-1, display-buffer-even-window-sizes): Adapt to + new naming conventions - window-vchild, window-hchild, + window-next and window-prev are now called window-top-child, + window-left-child, window-next-sibling and window-prev-sibling + respectively. + (resize-window-reset): Rename to window-resize-reset. + (resize-window-reset-1): Rename to window-resize-reset-1. + (resize-window): Rename to window-resize. + (window-min-height, window-min-width) + (resize-mini-window, resize-this-window, resize-root-window) + (resize-root-window-vertically, adjust-window-trailing-edge) + (enlarge-window, shrink-window, maximize-window) + (minimize-window, delete-window, quit-restore-window) + (split-window, balance-windows, balance-windows-area-adjust) + (balance-windows-area, window-state-put-2) + (display-buffer-even-window-sizes, display-buffer-set-height) + (display-buffer-set-width, set-window-text-height) + (fit-window-to-buffer): Rename all "resize-window" prefixed + calls to use the "window-resize" prefix convention. + (display-buffer-alist): Fix symbol for label specifier. + (display-buffer-reuse-window): Set reuse-dedicated to cdr of + corresponding specifier. + Reported by Juanma Barranquero <lekktu@gmail.com>. + +2011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net> + + * ses.el (ses-destroy-cell-variable-range): Fix heading comment + convention. + (ses-call-printer): Does not pass an empty string to formatter when the + cell is empty to keep from barking printer Calc math-format-value. + +2011-06-27 Richard Stallman <rms@gnu.org> + + * battery.el (battery-mode-line-limit): New variable. + (battery-update): Handle it. + + * mail/rmailmm.el (rmail-mime-process-multipart): + Handle truncated messages. + +2011-06-27 Glenn Morris <rgm@gnu.org> + + * progmodes/flymake.el (flymake-err-line-patterns): + Allow for column numbers in the ant/javac pattern. (Bug#8866) + +2011-06-27 Vincent Belaïche <vincentb1@users.sourceforge.net> + + * ses.el (ses-relocate-range): Keep rest of arguments for ses-range. + (ses--clean-!, ses--clean-_): New functions. + (ses-range): Add configurability of readout order, and conversion + to Calc vector. + + * ses.el (ses-repair-cell-reference-all): New function. + (ses-cell-symbol): Set macro as safe, so that it can be used in + formulas. + + * ses.el: Update cycle detection algorithm. + (ses-localvars): Add ses--Dijkstra-attempt-nb and + ses--Dijkstra-weight-bound, and initial values thereof when applicable. + (ses-set-localvars): New function. + (ses-make-cell): Add property-list as a cell element. + (ses-cell-property-get-fun, ses-cell-property-get) + (ses-cell-property-delq-fun, ses-cell-property-set-fun) + (ses-cell-property-pop-fun, ses-cell-property-get-handle-fun): + New functions. + (ses-cell-property-set, ses-cell-property-pop) + (ses-cell-property-get-handle): New macro. + (ses-cell-property-handle-car, ses-cell-property-handle-setcar): + New aliases, used for code readability. + (ses-calculate-cell, ses-update-cells): Use Dijkstra algorithm for + cycle detection. + (ses-self-reference-early-detection): New defcustom. + (ses-formula-references): Robustify against self-refering cells. + (ses-mode): Use ses-set-localvars. + (ses-command-hook): Add call to ses-initialize-Dijkstra-attempt + before lauching the update processing. + (ses-initialize-Dijkstra-attempt): New function. + (ses-recalculate-cell): Update for cycle detection based on + Dijkstra algorithm. + + * ses.el: Fix commenting and indenting convention. + +2011-06-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * bs.el (bs-cycle-next): Complete last change. + +2011-06-27 Drew Adams <drew.adams@oracle.com> + + * faces.el (list-faces-display): Add help-mode-map to output (bug#8939). + +2011-06-27 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * net/network-stream.el (network-stream-open-starttls): + Don't re-get capabilities unless we've reestablished connection. + (network-stream-open-starttls): Fix stupid typo with gnutls-clii. + + * mail/smtpmail.el (smtpmail-via-smtp): Bind coding-system-for-* + to binary to possibly avoid line encoding issues on Windows (among + other things). + +2011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * net/network-stream.el (open-network-stream): Return an :error + saying what the problem was, if possible. + + * mail/smtpmail.el (smtpmail-via-smtp): Report the error from the + server. + + * net/network-stream.el (network-stream-open-starttls): If we + wanted to use STARTTLS, and the server offered it, but we weren't + able to because we had no STARTTLS support, then close the connection. + (open-network-stream): Return an :error element, if present. + +2011-06-26 Chong Yidong <cyd@stupidchicken.com> + + * hl-line.el (hl-line-sticky-flag): Doc fix. + (global-hl-line-sticky-flag): New option (Bug#8323). + (global-hl-line-highlight): Obey it. + + * vc/vc.el (vc-revert-show-diff): Default to t. + +2011-06-26 Ken Manheimer <ken.manheimer@gmail.com> + + * allout-widgets.el (allout-widgets-post-command-business): + Stop decorating intermediate isearch matches. They're not being + undecorated when an isearch is continued past, and isearch + automatically collapses them. This leads to "widget leaks", where + decorated items accumulate in collapsed areas. Lines with lots of + hidden widgets can slow down cursor travel, substantially. + Too much complicated machinery would be needed to ensure undecoration, + so we're doing without this nicety. + + (allout-widgets-tally-string): Don't try to do a hash-table-count + of allout-widgets-tally when it's nil. This eliminates spurious "Error + during redisplay: (wrong-type-argument hash-table-p nil)" warnings in + *Messages* when allout-widgets-maintain-tally is t. + +2011-06-26 Martin Rudalics <rudalics@gmx.at> + + * window.el (display-buffer-normalize-argument): Rename to + display-buffer-normalize-arguments. Handle special meaning of + LABEL argument. Respect special-display-function when popping up + a new frame. Fix code searching for a window showing the buffer + on another frame. + (display-buffer-normalize-specifiers): + Call display-buffer-normalize-arguments. + (display-buffer-in-window): Don't undedicate the window if its + buffer remains the same. + Reported by Drew Adams <drew.adams@oracle.com>. + (display-buffer-alist): Add choice for same-window macro + specfier. + (display-buffer): Mention special meaning of LABEL argument in + doc-string. Fix quoting. Don't pop up a new frame even as + fallback. + +2011-06-26 Juanma Barranquero <lekktu@gmail.com> + + * bs.el (bs-cycle-next): Pass current buffer to `bury-buffer' to + avoid deleting the current window in some cases (bug#8911). + +2011-06-26 Andreas Schwab <schwab@linux-m68k.org> + + * emacs-lisp/smie.el (smie-bnf->prec2): Fix last change. + (Bug#8934) + +2011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * net/network-stream.el (network-stream-open-starttls): + Use built-in TLS support if `gnutls-available-p' is true. + (network-stream-open-tls): Ditto. + +2011-06-26 Leo Liu <sdl.web@gmail.com> + + * register.el (registerv): New struct. + (registerv-make): New function. + (jump-to-register, describe-register-1, insert-register): + Support the jump-func, print-func and insert-func slot of a registerv + struct. (Bug#8415) + +2011-06-26 Chong Yidong <cyd@stupidchicken.com> + + * vc/vc.el (vc-revert-show-diff): New defcustom. + (vc-diff-internal): New arg specifying diff buffer. + (vc-revert): Obey vc-revert-show-diff. If we show a diff, don't + reuse an existing *vc-diff* buffer (Bug#8927). + + * progmodes/cperl-mode.el (cperl-mode): Derive from prog-mode. + +2011-06-26 Glenn Morris <rgm@gnu.org> + + * progmodes/f90.el (f90-critical-indent): New option. + (f90-font-lock-keywords-2, f90-blocks-re, f90-end-block-re) + (f90-start-block-re, f90-mode-abbrev-table): Add block, critical. + (f90-mode): Doc fix. + (f90-looking-at-critical, f90-looking-at-end-critical): New funcs. + (f90-no-block-limit, f90-calculate-indent, f90-end-of-block) + (f90-beginning-of-block, f90-next-block, f90-indent-region) + (f90-match-end): Handle block, critical. + 2011-06-25 Glenn Morris <rgm@gnu.org> - * progmodes/f90.el (f90-keywords-re, f90-procedures-re) - (f90-constants-re): Add some F2008 stuff. + * calendar/diary-lib.el (diary-included-files): Doc fix. + (diary-include-files): New function, extracted from + diary-include-other-diary-files and diary-mark-included-diary-files. + (diary-include-other-diary-files, diary-mark-included-diary-files): + Just call diary-include-files. + (diary-mark-entries): Reset diary-included-files on first call. + + * calendar/diary-lib.el (diary-mark-entries) + (diary-mark-included-diary-files): + Visit included diary-files in temp buffers. + + * progmodes/f90.el (f90-keywords-re, f90-font-lock-keywords-1) + (f90-blocks-re, f90-program-block-re, f90-end-block-re) + (f90-start-block-re, f90-imenu-generic-expression) + (f90-looking-at-program-block-start, f90-no-block-limit): + Add support for submodules. + + * progmodes/f90.el (f90-keywords-re, f90-keywords-level-3-re) + (f90-procedures-re, f90-constants-re): Add some F2008 stuff. 2011-06-25 Eli Zaretskii <eliz@gnu.org> @@ -136,8 +410,8 @@ 2011-06-21 Lars Magne Ingebrigtsen <larsi@gnus.org> - * mail/smtpmail.el (smtpmail-via-smtp): Set - :use-starttls-if-possible so that we always use STARTTLS if the + * mail/smtpmail.el (smtpmail-via-smtp): + Set :use-starttls-if-possible so that we always use STARTTLS if the server supports it. SMTP servers that support STARTTLS commonly require it. @@ -149,13 +423,13 @@ upgrades with `open-network-stream', and rely solely on auth-source for all credentials. Big changes throughout the file, but in particular: - (smtpmail-auth-credentials): Removed. - (smtpmail-starttls-credentials): Removed. + (smtpmail-auth-credentials): Remove. + (smtpmail-starttls-credentials): Remove. (smtpmail-via-smtp): Check for servers saying they want AUTH after MAIL FROM, too. - * net/network-stream.el (network-stream-open-starttls): Provide - support for client certificates both for external and built-in + * net/network-stream.el (network-stream-open-starttls): + Provide support for client certificates both for external and built-in STARTTLS. (auth-source): Require. (open-network-stream): Document the :client-certificate keyword. @@ -169,8 +443,8 @@ 2011-06-21 Tim Harper <timcharper@gmail.com> - * term/ns-win.el (ns-initialize-window-system): set - application-specific `ApplePressAndHoldEnabled' system + * term/ns-win.el (ns-initialize-window-system): + Set application-specific `ApplePressAndHoldEnabled' system resource to NO as it is not yet supported by the NS port. 2011-06-21 Juanma Barranquero <lekktu@gmail.com> @@ -195,8 +469,8 @@ options more faithfully. (pop-to-buffer): Don't rely on `display-buffer' selecting the window if it is on another frame. - (display-buffer-alist, display-buffer-default-specifiers): Don't - make new frame unsplittable by default. + (display-buffer-alist, display-buffer-default-specifiers): + Don't make new frame unsplittable by default. (display-buffer-normalize-argument): Fix doc-string typo and use 'same-frame-other-window instead of 'other-window when associating with display-buffer-macro-specifiers. @@ -213,7 +487,7 @@ * progmodes/compile.el (compilation-error-regexp-alist-alist): Rename `caml' to `python-tracebacks-and-caml'; allow leading tabs (bug#8585). -2011-06-21 Drew Adams <drew.adams@oracle.com> +2011-06-21 Drew Adams <drew.adams@oracle.com> * menu-bar.el: Use function variable instead of switch-to-buffer. (menu-bar-select-buffer-function): New variable. @@ -739,7 +1013,7 @@ (window-in-direction-2, window-in-direction, get-mru-window): New functions. -2011-06-08 Reuben Thomas <rrt@sc3d.org> +2011-06-08 Reuben Thomas <rrt@sc3d.org> * progmodes/flymake.el (flymake-compilation-prevents-syntax-check): Doc fix (Bug#8713). @@ -1126,7 +1400,6 @@ 2011-05-28 Chong Yidong <cyd@stupidchicken.com> - * emacs-lisp/re-builder.el (re-builder): Improve doc (Bug#8286). 2011-05-28 Dima Kogan <dkogan@cds.caltech.edu> (tiny change) @@ -1257,7 +1530,7 @@ * vc/vc-bzr.el (vc-bzr-sha1-program): Rename from sha1-program. (vc-bzr-sha1): Adapt. - * sha1.el: Remove. Function `sha1' is now builtin. + * sha1.el: Remove. Function `sha1' is now builtin. * bindings.el: Provide sha1 feature. @@ -1345,7 +1618,7 @@ 2011-05-23 Vincent Belaïche <vincentb1@users.sourceforge.net> * play/5x5.el: I/ Add an arithmetic solver to suggest positions to - click on. II/ Make 5x5 multisession. III/ Ensure that random grids + click on. II/ Make 5x5 multisession. III/ Ensure that random grids always have a solution in grid size = 5 cases. (5x5-mode-map): Add keybinding to function `5x5-solve-suggest'. (5x5-solver-output, 5x5-log-buffer): New vars. @@ -2566,7 +2839,7 @@ 2011-04-20 felix <EmacsWiki> (tiny change) - * whitespace.el (global-whitespace-mode): keep highlight when + * whitespace.el (global-whitespace-mode): Keep highlight when switching between major modes on a file. 2011-04-19 Stefan Monnier <monnier@iro.umontreal.ca> diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 647b609288d..0f1fe850123 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -258,7 +258,9 @@ widgets are locally inhibited. The number varies according to the evanescence of objects on a hash table with weak keys, so tracking of widget erasures is often delayed." - (when (and allout-widgets-maintain-tally (not allout-widgets-mode-inhibit)) + (when (and allout-widgets-maintain-tally + (not allout-widgets-mode-inhibit) + allout-widgets-tally) (format ":%s" (hash-table-count allout-widgets-tally)))) ;;;_ = allout-widgets-track-decoration nil (defcustom allout-widgets-track-decoration nil @@ -748,20 +750,23 @@ Optional RECURSING is for internal use, to limit recursion." (message replaced-message) (message ""))))) - ;; Detect undecorated items, eg during isearch into previously - ;; unexposed topics, and decorate "economically". Some - ;; undecorated stuff is often exposed, to reduce lag, but the - ;; item containing the cursor is decorated. We constrain - ;; recursion to avoid being trapped by unexpectedly undecoratable - ;; items. - (when (and (not recursing) - (not (allout-current-decorated-p)) - (or (not (equal (allout-depth) 0)) - (not allout-container-item-widget))) - (let ((buffer-undo-list t)) - (allout-widgets-exposure-change-recorder - allout-recent-prefix-beginning allout-recent-prefix-end nil) - (allout-widgets-post-command-business 'recursing))) + ;; alas, decorated intermediate matches are not easily undecorated + ;; when they're automatically rehidden by isearch, so we're + ;; dropping this nicety. + ;; ;; Detect undecorated items, eg during isearch into previously + ;; ;; unexposed topics, and decorate "economically". Some + ;; ;; undecorated stuff is often exposed, to reduce lag, but the + ;; ;; item containing the cursor is decorated. We constrain + ;; ;; recursion to avoid being trapped by unexpectedly undecoratable + ;; ;; items. + ;; (when (and (not recursing) + ;; (not (allout-current-decorated-p)) + ;; (or (not (equal (allout-depth) 0)) + ;; (not allout-container-item-widget))) + ;; (let ((buffer-undo-list t)) + ;; (allout-widgets-exposure-change-recorder + ;; allout-recent-prefix-beginning allout-recent-prefix-end nil) + ;; (allout-widgets-post-command-business 'recursing))) ;; Detect and rectify fouled outline structure - decorated item ;; not at beginning of line. diff --git a/lisp/battery.el b/lisp/battery.el index 9afe9de7b98..d7d3045fa58 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -102,6 +102,11 @@ string are substituted as defined by the current value of the variable "String to display in the mode line.") ;;;###autoload (put 'battery-mode-line-string 'risky-local-variable t) +(defcustom battery-mode-line-limit 100 + "Percentage of full battery load below which display battery status" + :type 'integer + :group 'battery) + (defcustom battery-mode-line-format (cond ((eq battery-status-function 'battery-linux-proc-acpi) "[%b%p%%,%d°C]") @@ -182,16 +187,21 @@ seconds." (defun battery-update () "Update battery status information in the mode line." - (setq battery-mode-line-string - (propertize (if (and battery-mode-line-format - battery-status-function) - (battery-format - battery-mode-line-format - (funcall battery-status-function)) - "") - 'help-echo "Battery status information")) + (let ((data (and battery-status-function (funcall battery-status-function)))) + (setq battery-mode-line-string + (propertize (if (and battery-mode-line-format + (<= (car (read-from-string (cdr (assq ?p data)))) + battery-mode-line-limit)) + (battery-format + battery-mode-line-format + data) + "") + 'face + (and (<= (car (read-from-string (cdr (assq ?p data)))) + battery-load-critical) + 'font-lock-warning-face) + 'help-echo "Battery status information"))) (force-mode-line-update)) - ;;; `/proc/apm' interface for Linux. diff --git a/lisp/bs.el b/lisp/bs.el index 95dc371e57b..94fbd0e04f9 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1212,10 +1212,9 @@ by buffer configuration `bs-cycle-configuration-name'." bs--cycle-list))) (next (car tupel)) (cycle-list (cdr tupel))) - (unless (window-dedicated-p (selected-window)) - ;; We don't want the frame iconified if the only window in the frame - ;; happens to be dedicated; let's get the error from switch-to-buffer - (bury-buffer)) + ;; We don't want the frame iconified if the only window in the frame + ;; happens to be dedicated. + (bury-buffer (current-buffer)) (switch-to-buffer next) (setq bs--cycle-list (append (cdr cycle-list) (list (car cycle-list)))) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index f21247e9c93..1b980b3b1fa 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -776,7 +776,8 @@ of the appropriate type." (goto-char (point-min))) (defvar diary-included-files nil - "List of any diary files included in the last call to `diary-list-entries'.") + "List of any diary files included in the last call to `diary-list-entries'. +Or to `diary-mark-entries'.") (defun diary-list-entries (date number &optional list-only) "Create and display a buffer containing the relevant lines in `diary-file'. @@ -832,7 +833,7 @@ LIST-ONLY is non-nil, in which case it just returns the list." (let* ((original-date date) ; save for possible use in the hooks (date-string (calendar-date-string date)) (diary-buffer (find-buffer-visiting diary-file)) - ;; Dynamically bound in diary-include-other-diary-files. + ;; Dynamically bound in diary-include-files. (d-incp (and (boundp 'diary-including) diary-including)) diary-entries-list file-glob-attrs temp-buff) (unless d-incp @@ -921,19 +922,20 @@ LIST-ONLY is non-nil, in which case it just returns the list." (defvar original-date) ; bound in diary-list-entries ;(defvar number) ; already declared above -(defun diary-include-other-diary-files () - "Add diary entries from included diary files to `diary-entries-list'. +(defun diary-include-files (&optional mark) + "Process diary entries from included diary files. +By default, lists included entries, but if optional argument MARK is non-nil +marks entries instead. For example, this enables you to share common diary files. -To use, add this function to `diary-list-entries-hook'. Specify include files using lines matching `diary-include-string', e.g. #include \"filename\" -This is recursive; that is, included files may include other files. -See also `diary-mark-included-diary-files'." +This is recursive; that is, included files may include other files." (goto-char (point-min)) (while (re-search-forward (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string)) nil t) (let ((diary-file (match-string-no-properties 1)) + (diary-mark-entries-hook 'diary-mark-included-diary-files) (diary-list-entries-hook 'diary-include-other-diary-files) (diary-including t) diary-hook diary-list-include-blanks efile) @@ -943,10 +945,12 @@ See also `diary-mark-included-diary-files'." diary-included-files) (error "Recursive diary include for %s" diary-file) (setq diary-included-files - (append diary-included-files (list efile)) - diary-entries-list - (append diary-entries-list - (diary-list-entries original-date number t)))) + (append diary-included-files (list efile))) + (if mark + (diary-mark-entries) + (setq diary-entries-list + (append diary-entries-list + (diary-list-entries original-date number t))))) (beep) (message "Can't read included diary file %s" diary-file) (sleep-for 2)) @@ -955,6 +959,13 @@ See also `diary-mark-included-diary-files'." (sleep-for 2)))) (goto-char (point-min))) +(defun diary-include-other-diary-files () + "Add diary entries from included diary files to `diary-entries-list'. +To use, add this function to `diary-list-entries-hook'. +For details, see `diary-include-files'. +See also `diary-mark-included-diary-files'." + (diary-include-files)) + (define-obsolete-function-alias 'include-other-diary-files 'diary-include-other-diary-files "23.1") @@ -1405,22 +1416,37 @@ marks. This is intended to deal with deleted diary entries." (setq calendar-mark-diary-entries-flag nil) (calendar-redraw)) (let ((diary-marking-entries-flag t) - file-glob-attrs) - (with-current-buffer (find-file-noselect (diary-check-diary-file) t) - (save-excursion - (when (eq major-mode (default-value 'major-mode)) (diary-mode)) - (setq calendar-mark-diary-entries-flag t) - (message "Marking diary entries...") - (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) - (with-syntax-table diary-syntax-table - (diary-mark-entries-1 'calendar-mark-date-pattern) - (diary-mark-sexp-entries) - ;; Although it looks like mark-entries-hook runs every time, - ;; diary-mark-included-diary-files binds it to nil - ;; (essentially) when it runs in included files. - (run-hooks 'diary-nongregorian-marking-hook - 'diary-mark-entries-hook)) - (message "Marking diary entries...done"))))) + (diary-buffer (find-buffer-visiting diary-file)) + ;; Dynamically bound in diary-include-files. + (d-incp (and (boundp 'diary-including) diary-including)) + file-glob-attrs temp-buff) + (unless d-incp + (setq diary-included-files nil) + (message "Marking diary entries...")) + (unwind-protect + (with-current-buffer (or diary-buffer + (if d-incp + (setq temp-buff (generate-new-buffer + " *diary-temp*")) + (find-file-noselect + (diary-check-diary-file) t))) + (if temp-buff + ;; If including, caller has already verified it is readable. + (insert-file-contents diary-file) + (if (eq major-mode (default-value 'major-mode)) (diary-mode))) + (setq calendar-mark-diary-entries-flag t) + (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) + (with-syntax-table diary-syntax-table + (save-excursion + (diary-mark-entries-1 'calendar-mark-date-pattern) + (diary-mark-sexp-entries) + ;; Although it looks like mark-entries-hook runs every time, + ;; diary-mark-included-diary-files binds it to nil + ;; (essentially) when it runs in included files. + (run-hooks 'diary-nongregorian-marking-hook + 'diary-mark-entries-hook)))) + (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff))) + (or d-incp (message "Marking diary entries...done")))) ;;;###cal-autoload (define-obsolete-function-alias 'mark-diary-entries 'diary-mark-entries "23.1") @@ -1504,32 +1530,10 @@ is marked. See the documentation for the function `diary-list-sexp-entries'." (defun diary-mark-included-diary-files () "Mark diary entries from included diary files. -For example, this enables you to share common diary files. To use, add this function to `diary-mark-entries-hook'. -Specify include files using lines matching `diary-include-string', e.g. - #include \"filename\" -This is recursive; that is, included files may include other files. +For details, see `diary-include-files'. See also `diary-include-other-diary-files'." - (goto-char (point-min)) - (while (re-search-forward - (format "^%s \"\\([^\"]*\\)\"" (regexp-quote diary-include-string)) - nil t) - (let* ((diary-file (match-string-no-properties 1)) - (diary-mark-entries-hook 'diary-mark-included-diary-files) - (dbuff (find-buffer-visiting diary-file))) - (if (file-exists-p diary-file) - (if (file-readable-p diary-file) - (progn - (diary-mark-entries) - (unless dbuff - (kill-buffer (find-buffer-visiting diary-file)))) - (beep) - (message "Can't read included diary file %s" diary-file) - (sleep-for 2)) - (beep) - (message "Can't find included diary file %s" diary-file) - (sleep-for 2)))) - (goto-char (point-min))) + (diary-include-files t)) (define-obsolete-function-alias 'mark-included-diary-files 'diary-mark-included-diary-files "23.1") diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 04299aec099..114e9755039 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -38,46 +38,46 @@ (define-abbrev-table 'lisp-mode-abbrev-table ()) (defvar emacs-lisp-mode-syntax-table - (let ((table (make-syntax-table))) - (let ((i 0)) - (while (< i ?0) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (setq i (1+ ?9)) - (while (< i ?A) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (setq i (1+ ?Z)) - (while (< i ?a) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (setq i (1+ ?z)) - (while (< i 128) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - (modify-syntax-entry ?\s " " table) - ;; Non-break space acts as whitespace. - (modify-syntax-entry ?\x8a0 " " table) - (modify-syntax-entry ?\t " " table) - (modify-syntax-entry ?\f " " table) - (modify-syntax-entry ?\n "> " table) - ;; This is probably obsolete since nowadays such features use overlays. - ;; ;; Give CR the same syntax as newline, for selective-display. - ;; (modify-syntax-entry ?\^m "> " table) - (modify-syntax-entry ?\; "< " table) - (modify-syntax-entry ?` "' " table) - (modify-syntax-entry ?' "' " table) - (modify-syntax-entry ?, "' " table) - (modify-syntax-entry ?@ "' " table) - ;; Used to be singlequote; changed for flonums. - (modify-syntax-entry ?. "_ " table) - (modify-syntax-entry ?# "' " table) - (modify-syntax-entry ?\" "\" " table) - (modify-syntax-entry ?\\ "\\ " table) - (modify-syntax-entry ?\( "() " table) - (modify-syntax-entry ?\) ")( " table) - (modify-syntax-entry ?\[ "(] " table) - (modify-syntax-entry ?\] ")[ " table)) + (let ((table (make-syntax-table)) + (i 0)) + (while (< i ?0) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (setq i (1+ ?9)) + (while (< i ?A) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (setq i (1+ ?Z)) + (while (< i ?a) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (setq i (1+ ?z)) + (while (< i 128) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + (modify-syntax-entry ?\s " " table) + ;; Non-break space acts as whitespace. + (modify-syntax-entry ?\x8a0 " " table) + (modify-syntax-entry ?\t " " table) + (modify-syntax-entry ?\f " " table) + (modify-syntax-entry ?\n "> " table) + ;; This is probably obsolete since nowadays such features use overlays. + ;; ;; Give CR the same syntax as newline, for selective-display. + ;; (modify-syntax-entry ?\^m "> " table) + (modify-syntax-entry ?\; "< " table) + (modify-syntax-entry ?` "' " table) + (modify-syntax-entry ?' "' " table) + (modify-syntax-entry ?, "' " table) + (modify-syntax-entry ?@ "' " table) + ;; Used to be singlequote; changed for flonums. + (modify-syntax-entry ?. "_ " table) + (modify-syntax-entry ?# "' " table) + (modify-syntax-entry ?\" "\" " table) + (modify-syntax-entry ?\\ "\\ " table) + (modify-syntax-entry ?\( "() " table) + (modify-syntax-entry ?\) ")( " table) + (modify-syntax-entry ?\[ "(] " table) + (modify-syntax-entry ?\] ")[ " table) table) "Syntax table used in `emacs-lisp-mode'.") diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 0206abb9f53..cad7c8419b2 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -238,9 +238,9 @@ one of those elements share the same precedence level and associativity." (pushnew (car shr) last-ops) (pushnew (car shr) last-nts) (when (consp (cdr shr)) - (when (member (cadr rhs) nts) + (when (member (cadr shr) nts) (error "Adjacent non-terminals: %s %s" - (cadr rhs) (car rhs))) + (cadr shr) (car shr))) (pushnew (cadr shr) last-ops))))) (push (cons nt first-ops) first-ops-table) (push (cons nt last-ops) last-ops-table) diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 4ef259dee4b..17dbe3fbaf2 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -57,6 +57,13 @@ properties to colorize its output based on the setting of :type 'hook :group 'eshell-ls) +(defcustom eshell-ls-date-format "%Y-%m-%d" + "How to display time information in `eshell-ls-file'. +This is passed to `format-time-string' as a format string. +To display the date using the current locale, use \"%b \%e\"." + :type 'string + :group 'eshell-ls) + (defcustom eshell-ls-initial-args nil "If non-nil, this list of args is included before any call to `ls'. This is useful for enabling human-readable format (-h), for example." @@ -508,7 +515,7 @@ whose cdr is the list of file attributes." str)) " " (format-time-string (concat - "%b %e " + eshell-ls-date-format " " (if (= (nth 5 (decode-time (current-time))) (nth 5 (decode-time (nth (cond diff --git a/lisp/faces.el b/lisp/faces.el index 3fb8bc80931..c29d8c9bfd8 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1255,7 +1255,7 @@ arg, prompt for a regular expression." (insert (substitute-command-keys (concat - "Use " + "\\<help-mode-map>>Use " (if (display-mouse-p) "\\[help-follow-mouse] or ") "\\[help-follow] on a face name to customize it\n" "or on its sample text for a description of the face.\n\n"))) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 8d0b073e478..74af6df6350 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,31 @@ +2011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org> + + * gnus-art.el (gnus-article-stop-animations): New function to stop any + animations going on at article exit time. + + * gnus-registry.el (gnus-registry-user-format-function-M): Reinstate, + since removing it breaks people upgrading. + + * shr.el (shr-put-image): Use the new interface for animating images. + (shr-put-image): Animate for 60 seconds. + + * auth-source.el (with-auth-source-epa-overrides): Fix compilation + error with `find-file-hooks' on Emacs 22. + (with-auth-source-epa-overrides): Ugly hack to Wrap the + `find-file-hook' things in `symbol-value' to avoid compilation warnings + on all architectures. + + * spam.el (spam-stat): Require in a normal fashion without binding + `spam-stat-install-hooks' to avoid compilation warnings. + + * spam-stat.el (spam-stat-install-hooks): Removed. + (spam-stat-install-hooks): Don't run automatically. + +2011-06-26 Timo Juhani Lindfors <timo.lindfors@iki.fi> (tiny change) + + * gnus-msg.el (gnus-summary-reply-to-list-with-original): New command + and keystroke. + 2011-06-23 Katsumi Yamaoka <yamaoka@jpl.org> * auth-source.el (auth-source-netrc-cache): Move forward. @@ -532,12 +560,6 @@ * Makefile.in (fail-on-warning): New rule to compile with warnings as errors. - * dgnushack.el (dgnushack-compile-error-on-warn): New function to call - dgnushack-compile with error-on-warn enabled, and to signal an error if - clean compilation failed. - (dgnushack-compile): New argument 'error-on-warn'. If non-nil, compile - with `byte-compile-error-on-warn'. Return nil if errors occured. - 2011-04-06 Teodor Zlatanov <tzz@lifelogs.com> * gnus-registry.el: Don't use ERT if it's not available. Load it diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 66497cd9a0c..c9cfc14fc55 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -971,7 +971,9 @@ Note that the MAX parameter is used so we can exit the parse early." (,(if (boundp 'find-file-hook) 'find-file-hook 'find-file-hooks) ',(remove 'epa-file-find-file-hook - (if (boundp 'find-file-hook) 'find-file-hook 'find-file-hooks))) + (if (boundp 'find-file-hook) + (symbol-value 'find-file-hook) + (symbol-value 'find-file-hooks)))) (auto-mode-alist ',(if (boundp 'epa-file-auto-mode-alist-entry) (remove (symbol-value 'epa-file-auto-mode-alist-entry) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 3ebb5cc719b..6c3ad01eabf 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4509,6 +4509,7 @@ commands: t))) (with-current-buffer name (set (make-local-variable 'gnus-article-edit-mode) nil) + (gnus-article-stop-animations) (when gnus-article-mime-handles (mm-destroy-parts gnus-article-mime-handles) (setq gnus-article-mime-handles nil)) @@ -4533,6 +4534,12 @@ commands: (gnus-start-date-timer gnus-article-update-date-headers)) (current-buffer))))) +(defun gnus-article-stop-animations () + (dolist (timer (and (boundp 'timer-list) + timer-list)) + (when (eq (aref timer 5) 'image-animate-timeout) + (cancel-timer timer)))) + ;; Set article window start at LINE, where LINE is the number of lines ;; from the head of the article. (defun gnus-article-set-window-start (&optional line) diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 093eec33fcd..e256446c016 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -351,6 +351,7 @@ Thank you for your help in stamping out bugs. "r" gnus-summary-reply "y" gnus-summary-yank-message "R" gnus-summary-reply-with-original + "L" gnus-summary-reply-to-list-with-original "w" gnus-summary-wide-reply "W" gnus-summary-wide-reply-with-original "v" gnus-summary-very-wide-reply @@ -1154,6 +1155,16 @@ The original article will be yanked." (interactive "P") (gnus-summary-reply (gnus-summary-work-articles n) wide)) +(defun gnus-summary-reply-to-list-with-original (n &optional wide) + "Start composing a reply mail to the current message. +The reply goes only to the mailing list. +The original article will be yanked." + (interactive "P") + (let ((message-reply-to-function + (lambda nil + `((To . ,(gnus-mailing-list-followup-to)))))) + (gnus-summary-reply (gnus-summary-work-articles n) wide))) + (defun gnus-summary-reply-broken-reply-to (&optional yank wide very-wide) "Like `gnus-summary-reply' except removing reply-to field. If prefix argument YANK is non-nil, the original article is yanked diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index a44986e2499..f8ff52f128f 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -914,6 +914,9 @@ Uses `gnus-registry-marks' to find what shortcuts to install." (make-obsolete 'gnus-registry-user-format-function-M 'gnus-registry-article-marks-to-chars "24.1") ? +(defalias 'gnus-registry-user-format-function-M + 'gnus-registry-article-marks-to-chars) + ;; use like this: ;; (defalias 'gnus-user-format-function-M 'gnus-registry-article-marks-to-chars) (defun gnus-registry-article-marks-to-chars (headers) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index f974d386acb..4c059e9332a 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -7298,6 +7298,7 @@ If FORCE (the prefix), also save the .newsrc file(s)." (run-hooks 'gnus-summary-prepare-exit-hook) (when (gnus-buffer-live-p gnus-article-buffer) (with-current-buffer gnus-article-buffer + (gnus-article-stop-animations) (mm-destroy-parts gnus-article-mime-handles) ;; Set it to nil for safety reason. (setq gnus-article-mime-handle-alist nil) @@ -9579,6 +9580,7 @@ C-u g', show the raw article." ;; Destroy any MIME parts. (when (gnus-buffer-live-p gnus-article-buffer) (with-current-buffer gnus-article-buffer + (gnus-article-stop-animations) (mm-destroy-parts gnus-article-mime-handles) ;; Set it to nil for safety reason. (setq gnus-article-mime-handle-alist nil) diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index 67effc07ee2..f8a85579b4f 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -526,7 +526,9 @@ the URL of the image to the kill buffer instead." (when (and (> (current-column) 0) (> (car (image-size image t)) 400)) (insert "\n")) - (insert-image image (or alt "*"))) + (insert-image image (or alt "*")) + (when (image-animated-p image) + (image-animate image nil 60))) image) (insert alt))) @@ -557,10 +559,6 @@ the URL of the image to the kill buffer instead." :width window-width :ascent 100) image))) - (when (and (fboundp 'create-animated-image) - (eq (image-type data nil t) 'gif)) - (setq image (create-animated-image data 'gif t - :ascent 100))) image))) ;; url-cache-extract autoloads url-cache. diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index b56d0c416ef..8b56c7bd537 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el @@ -138,12 +138,6 @@ See `spam-stat-to-hash-table' for the format of the file." :type 'file :group 'spam-stat) -(defcustom spam-stat-install-hooks t - "Whether spam-stat should install its hooks in Gnus. -This is set to nil if you use spam-stat through spam.el." - :type 'boolean - :group 'spam-stat) - (defcustom spam-stat-unknown-word-score 0.2 "The score to use for unknown words. Also used for words that don't appear often enough." @@ -658,9 +652,6 @@ COUNT defaults to 5" (add-hook 'gnus-select-article-hook 'spam-stat-store-gnus-article-buffer)) -(when spam-stat-install-hooks - (spam-stat-install-hooks-function)) - (defun spam-stat-unload-hook () "Uninstall the spam-stat function hooks." (interactive) diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index cbffeeab69e..33dbaaa1f0c 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -2260,51 +2260,44 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)." (autoload 'spam-stat-save "spam-stat") (autoload 'spam-stat-split-fancy "spam-stat")) -(eval-and-compile - (when (condition-case nil - (let ((spam-stat-install-hooks nil)) - (require 'spam-stat)) - (file-error - (defalias 'spam-stat-register-ham-routine 'ignore) - (defalias 'spam-stat-register-spam-routine 'ignore) - nil)) +(require 'spam-stat) - (defun spam-check-stat () - "Check the spam-stat backend for the classification of this message" - (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override - (spam-stat-buffer (buffer-name)) ; stat the current buffer - category return) - (spam-stat-split-fancy))) +(defun spam-check-stat () + "Check the spam-stat backend for the classification of this message" + (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override + (spam-stat-buffer (buffer-name)) ; stat the current buffer + category return) + (spam-stat-split-fancy))) - (defun spam-stat-register-spam-routine (articles &optional unregister) - (dolist (article articles) - (let ((article-string (spam-get-article-as-string article))) - (with-temp-buffer - (insert article-string) - (if unregister - (spam-stat-buffer-change-to-non-spam) - (spam-stat-buffer-is-spam)))))) +(defun spam-stat-register-spam-routine (articles &optional unregister) + (dolist (article articles) + (let ((article-string (spam-get-article-as-string article))) + (with-temp-buffer + (insert article-string) + (if unregister + (spam-stat-buffer-change-to-non-spam) + (spam-stat-buffer-is-spam)))))) - (defun spam-stat-unregister-spam-routine (articles) - (spam-stat-register-spam-routine articles t)) +(defun spam-stat-unregister-spam-routine (articles) + (spam-stat-register-spam-routine articles t)) - (defun spam-stat-register-ham-routine (articles &optional unregister) - (dolist (article articles) - (let ((article-string (spam-get-article-as-string article))) - (with-temp-buffer - (insert article-string) - (if unregister - (spam-stat-buffer-change-to-spam) - (spam-stat-buffer-is-non-spam)))))) +(defun spam-stat-register-ham-routine (articles &optional unregister) + (dolist (article articles) + (let ((article-string (spam-get-article-as-string article))) + (with-temp-buffer + (insert article-string) + (if unregister + (spam-stat-buffer-change-to-spam) + (spam-stat-buffer-is-non-spam)))))) - (defun spam-stat-unregister-ham-routine (articles) - (spam-stat-register-ham-routine articles t)) +(defun spam-stat-unregister-ham-routine (articles) + (spam-stat-register-ham-routine articles t)) - (defun spam-maybe-spam-stat-load () - (when spam-use-stat (spam-stat-load))) +(defun spam-maybe-spam-stat-load () + (when spam-use-stat (spam-stat-load))) - (defun spam-maybe-spam-stat-save () - (when spam-use-stat (spam-stat-save))))) +(defun spam-maybe-spam-stat-save () + (when spam-use-stat (spam-stat-save))) ;;}}} diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1cd62c1dfa4..b13e6a77d5d 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -731,12 +731,18 @@ it is displayed along with the global value." (delete-region (1- from) from))))))) (terpri) (when locus - (if (bufferp locus) - (princ (format "%socal in buffer %s; " - (if (get variable 'permanent-local) - "Permanently l" "L") - (buffer-name))) - (princ (format "It is a frame-local variable; "))) + (cond + ((bufferp locus) + (princ (format "%socal in buffer %s; " + (if (get variable 'permanent-local) + "Permanently l" "L") + (buffer-name)))) + ((framep locus) + (princ (format "It is a frame-local variable; "))) + ((terminal-live-p locus) + (princ (format "It is a terminal-local variable; "))) + (t + (princ (format "It is local to %S" locus)))) (if (not (default-boundp variable)) (princ "globally void") (let ((val (default-value variable))) diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 55704dccb33..846f5f95187 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -93,14 +93,26 @@ (overlay-put global-hl-line-overlay 'face hl-line-face)))) (defcustom hl-line-sticky-flag t - "Non-nil means highlight the current line in all windows. + "Non-nil means the HL-Line mode highlight appears in all windows. Otherwise Hl-Line mode will highlight only in the selected window. Setting this variable takes effect the next time you use -the command `hl-line-mode' to turn Hl-Line mode on." +the command `hl-line-mode' to turn Hl-Line mode on. + +This variable has no effect in Global Highlight Line mode. +For that, use `global-hl-line-sticky-flag'." :type 'boolean :version "22.1" :group 'hl-line) +(defcustom global-hl-line-sticky-flag nil + "Non-nil means the Global HL-Line mode highlight appears in all windows. +Otherwise Global Hl-Line mode will highlight only in the selected +window. Setting this variable takes effect the next time you use +the command `global-hl-line-mode' to turn Global Hl-Line mode on." + :type 'boolean + :version "24.1" + :group 'hl-line) + (defvar hl-line-range-function nil "If non-nil, function to call to return highlight range. The function of no args should return a cons cell; its car value @@ -162,6 +174,10 @@ addition to `hl-line-highlight' on `post-command-hook'." "Global minor mode to highlight the line about point in the current window. With ARG, turn Global-Hl-Line mode on if ARG is positive, off otherwise. +If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode +highlights the line about the current buffer's point in all +windows. + Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and `global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'." :global t @@ -181,7 +197,9 @@ Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and (unless global-hl-line-overlay (setq global-hl-line-overlay (make-overlay 1 1)) ; to be moved (overlay-put global-hl-line-overlay 'face hl-line-face)) - (overlay-put global-hl-line-overlay 'window (selected-window)) + (overlay-put global-hl-line-overlay 'window + (unless global-hl-line-sticky-flag + (selected-window))) (hl-line-move global-hl-line-overlay)))) (defun global-hl-line-unhighlight () diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 6b062f2298f..0722227d3d2 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -150,8 +150,8 @@ Prompts for bug subject. Leaves you in a mail buffer." ;; Put these properties on semantically-void text. ;; report-emacs-bug-hook deletes these regions before sending. (prompt-properties '(field emacsbug-prompt - intangible but-helpful - rear-nonsticky t)) + intangible but-helpful + rear-nonsticky t)) (can-insert-mail (or (report-emacs-bug-can-use-xdg-email) (report-emacs-bug-can-use-osx-open))) user-point message-end-point) @@ -175,25 +175,36 @@ Prompts for bug subject. Leaves you in a mail buffer." (backward-char (length signature))) (unless report-emacs-bug-no-explanations ;; Insert warnings for novice users. - (when (string-match "@gnu\\.org$" report-emacs-bug-address) - (insert "This bug report will be sent to the Free Software Foundation,\n") - (let ((pos (point))) - (insert "not to your local site managers!") - (overlay-put (make-overlay pos (point)) 'face 'highlight))) - (insert "\nPlease write in ") - (let ((pos (point))) - (insert "English") - (overlay-put (make-overlay pos (point)) 'face 'highlight)) - (insert " if possible, because the Emacs maintainers -usually do not have translators to read other languages for them.\n\n") - (insert "Please check that the From: line gives an address where you can be reached.\n") - (insert (format "Your report will be posted to the %s mailing list" - report-emacs-bug-address)) - (insert "\nand the gnu.emacs.bug news group, and at http://debbugs.gnu.org.\n\n")) - - (insert "Please describe exactly what actions triggered the bug\n" - "and the precise symptoms of the bug. If you can, give\n" - "a recipe starting from `emacs -Q':\n\n") + (if (not (equal "bug-gnu-emacs@gnu.org" report-emacs-bug-address)) + (insert (format "The report will be sent to %s.\n\n" + report-emacs-bug-address)) + (insert "This bug report will be sent to the ") + (insert-button + "Bug-GNU-Emacs" + 'face 'link + 'help-echo (concat "mouse-2, RET: Follow this link") + 'action (lambda (button) + (browse-url "http://lists.gnu.org/archive/html/bug-gnu-emacs/")) + 'follow-link t) + (insert " mailing list\nand the GNU bug tracker at ") + (insert-button + "debbugs.gnu.org" + 'face 'link + 'help-echo (concat "mouse-2, RET: Follow this link") + 'action (lambda (button) + (browse-url "http://debbugs.gnu.org/")) + 'follow-link t) + + (insert ". Please check that +the From: line contains a valid email address. After a delay of up +to one day, you should receive an acknowledgement at that address. + +Please write in English if possible, as the Emacs maintainers +usually do not have translators for other languages.\n\n"))) + + (insert "Please describe exactly what actions triggered the bug, and\n" + "the precise symptoms of the bug. If you can, give a recipe\n" + "starting from `emacs -Q':\n\n") (add-text-properties (save-excursion (rfc822-goto-eoh) (line-beginning-position 2)) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 640f1dfff29..02f78635e26 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4379,7 +4379,7 @@ With prefix argument N moves forward N messages with these labels. ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "5e3ff91cc650ca2c5c147dcf3397dfcf") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "30ab95e291380f184dff5fa6cde75520") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index a02d388a6f7..651defeaf46 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -843,8 +843,18 @@ The other arguments are the same as `rmail-mime-multipart-handler'." ;; the beginning of the next part. The current point is just ;; after the boundary tag. (setq beg (point-min)) - (while (search-forward boundary nil t) - (setq end (match-beginning 0)) + + (while (or (and (search-forward boundary nil t) + (setq end (match-beginning 0))) + ;; If the boundary does not appear at all, + ;; the message was truncated. + ;; Handle the rest of the truncated message + ;; (if it isn't empty) by pretending that the boundary + ;; appears at the end of the message. + (and (save-excursion + (skip-chars-forward "\n") + (> (point-max) (point))) + (setq end (point-max)))) ;; If this is the last boundary according to RFC 2046, hide the ;; epilogue, else hide the boundary only. Use a marker for ;; `next' because `rmail-mime-show' may change the buffer. @@ -852,6 +862,9 @@ The other arguments are the same as `rmail-mime-multipart-handler'." (setq next (point-max-marker))) ((looking-at "[ \t]*\n") (setq next (copy-marker (match-end 0) t))) + ((= end (point-max)) + ;; We're handling what's left of a truncated message. + (setq next (point-max-marker))) (t ;; The original code signalled an error as below, but ;; this line may be a boundary of nested multipart. So, diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 3c9ea9de573..3fd2d9ddf21 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -488,9 +488,9 @@ The list is in preference order.") (secret . "SMTP password for %u@%h: "))) (auth-info (car (auth-source-search - :max 1 :host host :port port + :max 1 :require (and ask-for-password '(:user :secret)) :create ask-for-password))) @@ -615,6 +615,8 @@ The list is in preference order.") (and mail-specify-envelope-from (mail-envelope-from)) user-mail-address)) + (coding-system-for-read 'binary) + (coding-system-for-write 'binary) response-code process-buffer result @@ -651,7 +653,9 @@ The list is in preference order.") ;; If we couldn't access the server at all, we give up. (unless (setq process (car result)) - (throw 'done "Unable to contact server")) + (throw 'done (if (plist-get (cdr result) :error) + (plist-get (cdr result) :error) + "Unable to contact server"))) ;; set the send-filter (set-process-filter process 'smtpmail-process-filter) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1282f86d503..41716dbdacd 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1723,11 +1723,12 @@ good, skip, fatal, or unknown." ;;; Temporary file location and deletion... ;;; ------------------------------------------------------------ -(defun ange-ftp-make-tmp-name (host) +(defun ange-ftp-make-tmp-name (host &optional suffix) "This routine will return the name of a new file." (make-temp-file (if (ange-ftp-use-gateway-p host) ange-ftp-gateway-tmp-name-template - ange-ftp-tmp-name-template))) + ange-ftp-tmp-name-template) + nil suffix)) (defun ange-ftp-del-tmp-name (filename) "Force to delete temporary file." @@ -4139,7 +4140,8 @@ directory, so that Emacs will know its current contents." (let* ((fn1 (expand-file-name file)) (pa1 (ange-ftp-ftp-name fn1))) (if pa1 - (let ((tmp1 (ange-ftp-make-tmp-name (car pa1)))) + (let ((tmp1 (ange-ftp-make-tmp-name (car pa1) + (file-name-extension file t)))) (ange-ftp-copy-file-internal fn1 tmp1 t nil (format "Getting %s" fn1)) tmp1)))) diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 161d7252d6e..a8989398e15 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -46,7 +46,8 @@ (require 'starttls) (require 'auth-source) -(declare-function gnutls-negotiate "gnutls" t t) ; defun* +(autoload 'gnutls-negotiate "gnutls") +(autoload 'open-gnutls-stream "gnutls") ;;;###autoload (defun open-network-stream (name buffer host service &rest parameters) @@ -161,7 +162,8 @@ functionality. (list (car result) :greeting (nth 1 result) :capabilities (nth 2 result) - :type (nth 3 result)) + :type (nth 3 result) + :error (nth 4 result)) (car result)))))) (defun network-stream-certificate (host service parameters) @@ -207,21 +209,25 @@ functionality. (greeting (network-stream-get-response stream start eoc)) (capabilities (network-stream-command stream capability-command eoc)) (resulting-type 'plain) - starttls-command) - + (builtin-starttls (and (fboundp 'gnutls-available-p) + (gnutls-available-p))) + starttls-command error) + + ;; First check whether the server supports STARTTLS at all. + (when (and capabilities success-string starttls-function) + (setq starttls-command + (funcall starttls-function capabilities))) ;; If we have built-in STARTTLS support, try to upgrade the ;; connection. - (when (and (or (fboundp 'open-gnutls-stream) + (when (and starttls-command + (or builtin-starttls (and (or require-tls (plist-get parameters :use-starttls-if-possible)) (executable-find "gnutls-cli"))) - capabilities success-string starttls-function - (setq starttls-command - (funcall starttls-function capabilities)) (not (eq (plist-get parameters :type) 'plain))) ;; If using external STARTTLS, drop this connection and start ;; anew with `starttls-open-stream'. - (unless (fboundp 'open-gnutls-stream) + (unless builtin-starttls (delete-process stream) (setq start (with-current-buffer buffer (point-max))) (let* ((starttls-use-gnutls t) @@ -240,15 +246,15 @@ functionality. "--x509certfile" (expand-file-name (nth 1 cert))) starttls-extra-arguments))) (setq stream (starttls-open-stream name buffer host service))) - (network-stream-get-response stream start eoc)) - ;; Requery capabilities for protocols that require it; i.e., - ;; EHLO for SMTP. - (when (plist-get parameters :always-query-capabilities) - (network-stream-command stream capability-command eoc)) + (network-stream-get-response stream start eoc) + ;; Requery capabilities for protocols that require it; i.e., + ;; EHLO for SMTP. + (when (plist-get parameters :always-query-capabilities) + (network-stream-command stream capability-command eoc))) (when (string-match success-string (network-stream-command stream starttls-command eoc)) ;; The server said it was OK to begin STARTTLS negotiations. - (if (fboundp 'open-gnutls-stream) + (if builtin-starttls (let ((cert (network-stream-certificate host service parameters))) (gnutls-negotiate :process stream :hostname host :keylist (and cert (list cert)))) @@ -268,11 +274,22 @@ functionality. (network-stream-command stream capability-command eoc)))) ;; If TLS is mandatory, close the connection if it's unencrypted. - (and require-tls - (eq resulting-type 'plain) - (delete-process stream)) + (when (and (or require-tls + ;; The server said it was possible to do STARTTLS, + ;; and we wanted to use it... + (and starttls-command + (plist-get parameters :use-starttls-if-possible))) + ;; ... but Emacs wasn't able to -- either no built-in + ;; support, or no gnutls-cli installed. + (eq resulting-type 'plain)) + (setq error + (if require-tls + "Server does not support TLS" + "Server supports STARTTLS, but Emacs does not have support for it")) + (delete-process stream) + (setq stream nil)) ;; Return value: - (list stream greeting capabilities resulting-type))) + (list stream greeting capabilities resulting-type error))) (defun network-stream-command (stream command eoc) (when command @@ -296,7 +313,8 @@ functionality. (defun network-stream-open-tls (name buffer host service parameters) (with-current-buffer buffer (let* ((start (point-max)) - (use-builtin-gnutls (fboundp 'open-gnutls-stream)) + (use-builtin-gnutls (and (fboundp 'gnutls-available-p) + (gnutls-available-p))) (stream (funcall (if use-builtin-gnutls 'open-gnutls-stream @@ -307,7 +325,8 @@ functionality. (list nil nil nil 'plain) ;; If we're using tls.el, we have to delete the output from ;; openssl/gnutls-cli. - (when (and (null use-builtin-gnutls) eoc) + (when (and (null use-builtin-gnutls) + eoc) (network-stream-get-response stream start eoc) (goto-char (point-min)) (when (re-search-forward eoc nil t) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 8eb2d01c097..48df73a678f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1522,7 +1522,7 @@ the last)." (defvar compilation-error-regexp-alist) ;;;###autoload -(defun cperl-mode () +(define-derived-mode cperl-mode prog-mode "CPerl" "Major mode for editing Perl code. Expression and list commands understand all C brackets. Tab indents for Perl code. @@ -1695,9 +1695,6 @@ with no args. DO NOT FORGET to read micro-docs (available from `Perl' menu) or as help on variables `cperl-tips', `cperl-problems', `cperl-praise', `cperl-speed'." - (interactive) - (kill-all-local-variables) - (use-local-map cperl-mode-map) (if (cperl-val 'cperl-electric-linefeed) (progn (local-set-key "\C-J" 'cperl-linefeed) @@ -1710,8 +1707,6 @@ or as help on variables `cperl-tips', `cperl-problems', (cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f]) (cperl-define-key "\C-c\C-hf" 'cperl-info-on-command [(control c) (control h) f]))) - (setq major-mode cperl-use-major-mode) - (setq mode-name "CPerl") (let ((prev-a-c abbrevs-changed)) (define-abbrev-table 'cperl-mode-abbrev-table '( ("if" "if" cperl-electric-keyword 0) diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index e5a62780ad6..cdb5f2a715d 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -26,6 +26,7 @@ ;; Major mode for editing F90 programs in FREE FORMAT. ;; The minor language revision F95 is also supported (with font-locking). ;; Some/many (?) aspects of F2003 are supported. +;; Some aspects of F2008 are supported. ;; Knows about continuation lines, named structured statements, and other ;; features in F90 including HPF (High Performance Fortran) structures. @@ -207,6 +208,13 @@ :group 'f90-indent :version "23.1") +(defcustom f90-critical-indent 2 + "Extra indentation applied to BLOCK, CRITICAL blocks." + :type 'integer + :safe 'integerp + :group 'f90-indent + :version "24.1") + (defcustom f90-continuation-indent 5 "Extra indentation applied to continuation lines." :type 'integer @@ -310,8 +318,9 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." "deferred" "enum" "enumerator" "extends" "extends_type_of" "final" "generic" "import" "non_intrinsic" "non_overridable" "nopass" "pass" "protected" "same_type_as" "value" "volatile" - ;; F2008 - "contiguous" + ;; F2008. + "contiguous" "submodule" "concurrent" "codimension" + "sync all" "sync memory" "critical" "image_index" ) 'words) "Regexp used by the function `f90-change-keywords'.") @@ -329,6 +338,10 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." ;; F2003. asynchronous separate. "abstract" "deferred" "import" "final" "non_intrinsic" "non_overridable" "nopass" "pass" "protected" "value" "volatile" + ;; F2008. + ;; "concurrent" is only in the sense of "do [,] concurrent", but given + ;; the [,] it's simpler to just do every instance (cf "do while"). + "contiguous" "concurrent" "codimension" "sync all" "sync memory" ) 'words) "Keyword-regexp for font-lock level >= 3.") @@ -374,7 +387,9 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." "bessel_j0" "bessel_j1" "bessel_jn" "bessel_y0" "bessel_y1" "bessel_yn" "erf" "erfc" "erfc_scaled" "gamma" "hypot" "log_gamma" - "norm2" "parity" "findloc" + "norm2" "parity" "findloc" "is_contiguous" + "sync images" "lock" "unlock" "image_index" + "lcobound" "ucobound" "num_images" "this_image" ;; F2008 iso_fortran_env module. "compiler_options" "compiler_version" ;; F2008 iso_c_binding module. @@ -445,6 +460,7 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." "character_kinds" "int8" "int16" "int32" "int64" "integer_kinds" "iostat_inquire_internal_unit" "logical_kinds" "real_kinds" "real32" "real64" "real128" + "lock_type" "atomic_int_kind" "atomic_logical_kind" ) 'words) "Regexp for Fortran intrinsic constants.") @@ -482,13 +498,18 @@ type-name parts, respectively." ;;; (1 font-lock-keyword-face) (3 font-lock-function-name-face)) '(f90-typedef-matcher (1 font-lock-keyword-face) (2 font-lock-function-name-face)) - ;; F2003. Prevent operators being highlighted as functions. - '("\\<\\(\\(?:end[ \t]*\\)?interface[ \t]*\\(?:assignment\\|operator\\|\ + ;; F2003. Prevent operators being highlighted as functions. + '("\\<\\(\\(?:end[ \t]*\\)?interface[ \t]*\\(?:assignment\\|operator\\|\ read\\|write\\)\\)[ \t]*(" (1 font-lock-keyword-face t)) ;; Other functions and declarations. Named interfaces = F2003. - '("\\<\\(\\(?:end[ \t]*\\)?\\(program\\|module\\|function\\|associate\\|\ -subroutine\\|interface\\)\\|use\\|call\\)\\>[ \t]*\\(\\sw+\\)?" + ;; F2008: end submodule submodule_name. + '("\\<\\(\\(?:end[ \t]*\\)?\\(program\\|\\(?:sub\\)?module\\|\ +function\\|associate\\|subroutine\\|interface\\)\\|use\\|call\\)\ +\\>[ \t]*\\(\\sw+\\)?" (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t)) + ;; F2008: submodule (parent_name) submodule_name. + '("\\<\\(submodule\\)\\>[ \t]*([^)\n]+)[ \t]*\\(\\sw+\\)?" + (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t)) ;; F2003. '("\\<\\(use\\)[ \t]*,[ \t]*\\(\\(?:non_\\)?intrinsic\\)[ \t]*::[ \t]*\ \\(\\sw+\\)" @@ -575,12 +596,16 @@ logical\\|double[ \t]*precision\\|\ ;; enum (F2003; must be followed by ", bind(C)"). '("\\<\\(enum\\)[ \t]*," (1 font-lock-keyword-face)) ;; end do, enum (F2003), if, select, where, and forall constructs. - '("\\<\\(end[ \t]*\\(do\\|if\\|enum\\|select\\|forall\\|where\\)\\)\\>\ + ;; block, critical (F2008). + ;; Note that "block data" may get somewhat mixed up with F2008 blocks, + ;; but since the former is obsolete I'm not going to worry about it. + '("\\<\\(end[ \t]*\\(do\\|if\\|enum\\|select\\|forall\\|where\\|\ +block\\|critical\\)\\)\\>\ \\([ \t]+\\(\\sw+\\)\\)?" (1 font-lock-keyword-face) (3 font-lock-constant-face nil t)) '("^[ \t0-9]*\\(\\(\\sw+\\)[ \t]*:[ \t]*\\)?\\(\\(if\\|\ do\\([ \t]*while\\)?\\|select[ \t]*\\(?:case\\|type\\)\\|where\\|\ -forall\\)\\)\\>" +forall\\|block\\|critical\\)\\)\\>" (2 font-lock-constant-face nil t) (3 font-lock-keyword-face)) ;; Implicit declaration. '("\\<\\(implicit\\)[ \t]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\ @@ -794,12 +819,14 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") (regexp-opt '("do" "if" "interface" "function" "module" "program" "select" "subroutine" "type" "where" "forall" ;; F2003. - "enum" "associate")) + "enum" "associate" + ;; F2008. + "submodule" "block" "critical")) "\\)\\>") "Regexp potentially indicating a \"block\" of F90 code.") (defconst f90-program-block-re - (regexp-opt '("program" "module" "subroutine" "function") 'paren) + (regexp-opt '("program" "module" "subroutine" "function" "submodule") 'paren) "Regexp used to locate the start/end of a \"subprogram\".") ;; "class is" is F2003. @@ -857,7 +884,8 @@ allowed. This minor issue currently only affects \"(/\" and \"/)\".") (concat "^[ \t0-9]*\\<end[ \t]*" (regexp-opt '("do" "if" "forall" "function" "interface" "module" "program" "select" "subroutine" - "type" "where" "enum" "associate") t) + "type" "where" "enum" "associate" "submodule" + "block" "critical") t) "\\>") "Regexp matching the end of an F90 \"block\", from the line start. Used in the F90 entry in `hs-special-modes-alist'.") @@ -883,10 +911,10 @@ Used in the F90 entry in `hs-special-modes-alist'.") "[^i(!\n\"\& \t]\\|" ; not-i( "i[^s!\n\"\& \t]\\|" ; i not-s "is\\sw\\)\\|" - ;; "abstract interface" is F2003. - "program\\|\\(?:abstract[ \t]*\\)?interface\\|module\\|" + ;; "abstract interface" is F2003; "submodule" is F2008. + "program\\|\\(?:abstract[ \t]*\\)?interface\\|\\(?:sub\\)?module\\|" ;; "enum", but not "enumerator". - "function\\|subroutine\\|enum[^e]\\|associate" + "function\\|subroutine\\|enum[^e]\\|associate\\|block\\|critical" "\\)" "[ \t]*") "Regexp matching the start of an F90 \"block\", from the line start. @@ -924,6 +952,8 @@ Set subexpression 1 in the match-data to the name of the type." ) (list '(nil "^[ \t0-9]*program[ \t]+\\(\\sw+\\)" 1) + '("Submodules" "^[ \t0-9]*submodule[ \t]*([^)\n]+)[ \t]*\ +\\(\\sw+\\)[ \t]*\\(!\\|$\\)" 1) '("Modules" "^[ \t0-9]*module[ \t]+\\(\\sw+\\)[ \t]*\\(!\\|$\\)" 1) (list "Types" 'f90-imenu-type-matcher 1) ;; Does not handle: "type[, stuff] :: foo". @@ -971,11 +1001,13 @@ Set subexpression 1 in the match-data to the name of the type." ("`asy" . "asynchronous" ) ("`ba" . "backspace" ) ("`bd" . "block data" ) + ("`bl" . "block" ) ("`c" . "character" ) ("`cl" . "close" ) ("`cm" . "common" ) ("`cx" . "complex" ) ("`cn" . "contains" ) + ("`cr" . "critical" ) ("`cy" . "cycle" ) ("`de" . "deallocate" ) ("`df" . "define" ) @@ -1055,6 +1087,10 @@ Variables controlling indentation style and extra features: `f90-program-indent' Extra indentation within program/module/subroutine/function blocks (default 2). +`f90-associate-indent' + Extra indentation within associate blocks (default 2). +`f90-critical-indent' + Extra indentation within critical/block blocks (default 2). `f90-continuation-indent' Extra indentation applied to continuation lines (default 5). `f90-comment-region' @@ -1225,6 +1261,25 @@ NAME is nil if the statement has no label." (if (looking-at "\\<\\(associate\\)[ \t]*(") (list (match-string 1)))) +(defsubst f90-looking-at-critical () + "Return (KIND NAME) if a critical or block block starts after point." + (if (looking-at "\\(\\(\\sw+\\)[ \t]*:\\)?[ \t]*\\(critical\\|block\\)\\>") + (let ((struct (match-string 3)) + (label (match-string 2))) + (if (or (not (string-equal "block" struct)) + (save-excursion + (skip-chars-forward " \t") + (not (looking-at "data\\>")))) + (list struct label))))) + +(defsubst f90-looking-at-end-critical () + "Return non-nil if a critical or block block ends after point." + (if (looking-at "end[ \t]*\\(critical\\|block\\)\\>") + (or (not (string-equal "block" (match-string 1))) + (save-excursion + (skip-chars-forward " \t") + (not (looking-at "data\\>")))))) + (defsubst f90-looking-at-where-or-forall () "Return (KIND NAME) if a where or forall block starts after point. NAME is nil if the statement has no label." @@ -1275,6 +1330,8 @@ write\\)[ \t]*([^)\n]*)") ((and (not (looking-at "module[ \t]*procedure\\>")) (looking-at "\\(module\\)[ \t]+\\(\\sw+\\)\\>")) (list (match-string 1) (match-string 2))) + ((looking-at "\\(submodule\\)[ \t]*([^)\n]+)[ \t]*\\(\\sw+\\)\\>") + (list (match-string 1) (match-string 2))) ((and (not (looking-at "end[ \t]*\\(function\\|subroutine\\)")) (looking-at "[^!'\"\&\n]*\\(function\\|subroutine\\)[ \t]+\ \\(\\sw+\\)")) @@ -1349,8 +1406,9 @@ if all else fails." (save-excursion (not (or (looking-at "end") (looking-at "\\(do\\|if\\|else\\(if\\|where\\)?\ -\\|select[ \t]*\\(case\\|type\\)\\|case\\|where\\|forall\\)\\>") - (looking-at "\\(program\\|module\\|\ +\\|select[ \t]*\\(case\\|type\\)\\|case\\|where\\|forall\\|\ +block\\|critical\\)\\>") + (looking-at "\\(program\\|\\(?:sub\\)?module\\|\ \\(?:abstract[ \t]*\\)?interface\\|block[ \t]*data\\)\\>") (looking-at "\\(contains\\|\\sw+[ \t]*:\\)") (looking-at f90-type-def-re) @@ -1393,6 +1451,8 @@ Does not check type and subprogram indentation." (f90-looking-at-where-or-forall) (f90-looking-at-select-case)) (setq icol (+ icol f90-if-indent))) + ;; FIXME this makes no sense, because this section/function is + ;; only for if/do/select/where/forall ? ((f90-looking-at-associate) (setq icol (+ icol f90-associate-indent)))) (end-of-line)) @@ -1406,12 +1466,16 @@ Does not check type and subprogram indentation." (f90-looking-at-where-or-forall) (f90-looking-at-select-case)) (setq icol (+ icol f90-if-indent))) + ;; FIXME this makes no sense, because this section/function is + ;; only for if/do/select/where/forall ? ((f90-looking-at-associate) (setq icol (+ icol f90-associate-indent))) ((looking-at f90-end-if-re) (setq icol (- icol f90-if-indent))) ((looking-at f90-end-associate-re) (setq icol (- icol f90-associate-indent))) + ((f90-looking-at-end-critical) + (setq icol (- icol f90-critical-indent))) ((looking-at "end[ \t]*do\\>") (setq icol (- icol f90-do-indent)))) (end-of-line)) @@ -1459,6 +1523,8 @@ Does not check type and subprogram indentation." (setq icol (+ icol f90-type-indent))) ((f90-looking-at-associate) (setq icol (+ icol f90-associate-indent))) + ((f90-looking-at-critical) + (setq icol (+ icol f90-critical-indent))) ((or (f90-looking-at-program-block-start) (looking-at "contains[ \t]*\\($\\|!\\)")) (setq icol (+ icol f90-program-indent))))) @@ -1478,6 +1544,8 @@ Does not check type and subprogram indentation." (setq icol (- icol f90-type-indent))) ((looking-at f90-end-associate-re) (setq icol (- icol f90-associate-indent))) + ((f90-looking-at-end-critical) + (setq icol (- icol f90-critical-indent))) ((or (looking-at "contains[ \t]*\\(!\\|$\\)") (f90-looking-at-program-block-end)) (setq icol (- icol f90-program-indent)))))))))) @@ -1584,6 +1652,7 @@ Interactively, pushes mark before moving point." (f90-looking-at-select-case) (f90-looking-at-type-like) (f90-looking-at-associate) + (f90-looking-at-critical) (f90-looking-at-program-block-start) (f90-looking-at-if-then) (f90-looking-at-where-or-forall))) @@ -1645,6 +1714,7 @@ Interactively, pushes mark before moving point." (f90-looking-at-select-case) (f90-looking-at-type-like) (f90-looking-at-associate) + (f90-looking-at-critical) (f90-looking-at-program-block-start) (f90-looking-at-if-then) (f90-looking-at-where-or-forall))) @@ -1686,6 +1756,7 @@ A block is a subroutine, if-endif, etc." (f90-looking-at-select-case) (f90-looking-at-type-like) (f90-looking-at-associate) + (f90-looking-at-critical) (f90-looking-at-program-block-start) (f90-looking-at-if-then) (f90-looking-at-where-or-forall)) @@ -1822,6 +1893,8 @@ If run in the middle of a line, the line is not broken." f90-type-indent) ((setq struct (f90-looking-at-associate)) f90-associate-indent) + ((setq struct (f90-looking-at-critical)) + f90-critical-indent) ((or (setq struct (f90-looking-at-program-block-start)) (looking-at "contains[ \t]*\\($\\|!\\)")) f90-program-indent))) @@ -1857,6 +1930,8 @@ If run in the middle of a line, the line is not broken." f90-type-indent) ((setq struct (f90-looking-at-associate)) f90-associate-indent) + ((setq struct (f90-looking-at-critical)) + f90-critical-indent) ((setq struct (f90-looking-at-program-block-start)) f90-program-indent))) (setq ind-curr ind-lev) @@ -1875,6 +1950,7 @@ If run in the middle of a line, the line is not broken." ((looking-at f90-end-type-re) f90-type-indent) ((looking-at f90-end-associate-re) f90-associate-indent) + ((f90-looking-at-end-critical) f90-critical-indent) ((f90-looking-at-program-block-end) f90-program-indent))) (if ind-b (setq ind-lev (- ind-lev ind-b))) @@ -2080,6 +2156,7 @@ Leave point at the end of line." (f90-looking-at-select-case) (f90-looking-at-type-like) (f90-looking-at-associate) + (f90-looking-at-critical) (f90-looking-at-program-block-start) ;; Interpret a single END without a block ;; start to be the END of a program block diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index c01086c970e..8f617b44dae 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -924,8 +924,8 @@ Convert it to flymake internal format." ;; PHP ("\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)" 2 3 nil 1) ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) - ;; ant/javac - (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" + ;; ant/javac. Note this also matches gcc warnings! + (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\\(?:\:[0-9]+\\)?\:[ \t\n]*\\(.+\\)" 2 4 nil 5)) ;; compilation-error-regexp-alist) (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) diff --git a/lisp/register.el b/lisp/register.el index af1a421a0a2..82a0cf33c3e 100644 --- a/lisp/register.el +++ b/lisp/register.el @@ -28,6 +28,8 @@ ;; pieces of buffer state to named variables. The entry points are ;; documented in the Emacs user's manual. +(eval-when-compile (require 'cl)) + (declare-function semantic-insert-foreign-tag "semantic/tag" (foreign-tag)) (declare-function semantic-tag-buffer "semantic/tag" (tag)) (declare-function semantic-tag-start "semantic/tag" (tag)) @@ -50,9 +52,36 @@ ;;; Code: +(defstruct + (registerv (:constructor nil) + (:constructor registerv--make (&optional data print-func + jump-func insert-func)) + (:copier nil) + (:type vector) + :named) + (data nil :read-only t) + (print-func nil :read-only t) + (jump-func nil :read-only t) + (insert-func nil :read-only t)) + +(defun* registerv-make (data &key print-func jump-func insert-func) + "Create a register value object. + +DATA can be any value. +PRINT-FUNC if provided controls how `list-registers' and +`view-register' print the register. It should be a function +recieving one argument DATA and print text that completes +this sentence: + Register X contains [TEXT PRINTED BY PRINT-FUNC] +JUMP-FUNC if provided, controls how `jump-to-register' jumps to the register. +INSERT-FUNC if provided, controls how `insert-register' insert the register. +They both receive DATA as argument." + (registerv--make data print-func jump-func insert-func)) + (defvar register-alist nil "Alist of elements (NAME . CONTENTS), one for each Emacs register. -NAME is a character (a number). CONTENTS is a string, number, marker or list. +NAME is a character (a number). CONTENTS is a string, number, marker, list +or a struct returned by `registerv-make'. A list of strings represents a rectangle. A list of the form (file . FILE-NAME) represents the file named FILE-NAME. A list of the form (file-query FILE-NAME POSITION) represents @@ -120,6 +149,11 @@ delete any existing frames that the frame configuration doesn't mention. (interactive "cJump to register: \nP") (let ((val (get-register register))) (cond + ((registerv-p val) + (assert (registerv-jump-func val) nil + "Don't know how to jump to register %s" + (single-key-description register)) + (funcall (registerv-jump-func val) (registerv-data val))) ((and (consp val) (frame-configuration-p (car val))) (set-frame-configuration (car val) (not delete)) (goto-char (cadr val))) @@ -209,6 +243,11 @@ The Lisp value REGISTER is a character." (princ " contains ") (let ((val (get-register register))) (cond + ((registerv-p val) + (if (registerv-print-func val) + (funcall (registerv-print-func val) (registerv-data val)) + (princ "[UNPRINTABLE CONTENTS]."))) + ((numberp val) (princ val)) @@ -285,8 +324,11 @@ Interactively, second arg is non-nil if prefix arg is supplied." (push-mark) (let ((val (get-register register))) (cond - ((consp val) - (insert-rectangle val)) + ((registerv-p val) + (assert (registerv-insert-func val) nil + "Don't know how to insert register %s" + (single-key-description register)) + (funcall (registerv-insert-func val) (registerv-data val))) ((stringp val) (insert-for-yank val)) ((numberp val) diff --git a/lisp/ses.el b/lisp/ses.el index b52d3e23c73..8b06f058fcd 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2002-2011 Free Software Foundation, Inc. ;; Author: Jonathan Yavner <jyavner@member.fsf.org> -;; Maintainer: Jonathan Yavner <jyavner@member.fsf.org> -;; Keywords: spreadsheet +;; Maintainer: Vincent Belaïche <vincentb1@users.sourceforge.net> +;; Keywords: spreadsheet Dijkstra ;; This file is part of GNU Emacs. @@ -25,6 +25,7 @@ ;;; To-do list: +;; * split (catch 'cycle ...) call back into one or more functions ;; * Use $ or … for truncated fields ;; * Add command to make a range of columns be temporarily invisible. ;; * Allow paste of one cell to a range of cells -- copy formula to each. @@ -36,6 +37,21 @@ ;; * Left-margin column for row number. ;; * Move a row by dragging its number in the left-margin. +;;; Cycle detection + +;; Cycles used to be detected by stationarity of ses--deferred-recalc. This was +;; working fine in most cases, however failed in some cases of several path +;; racing together. +;; +;; The current algorithm is based on Dijksta algorithm. The ``cycle length'' is +;; stored in some cell property. In order not to reset in all cells such +;; property at each update, the cycle length is stored in this property along +;; with some update attempt id that is incremented at each update. The current +;; update id is ses--Dijkstra-attempt-nb. In case there is a cycle the cycle +;; length diverge to infinite so it will exceed ses--Dijkstra-weight-bound at +;; some point of time that allows detection. Otherwise it converges to the +;; longest path length in the update tree. + ;;; Code: @@ -154,7 +170,7 @@ Each function is called with ARG=1." (defalias 'ses-mode-print-map (let ((keys '([backtab] backward-char [tab] ses-forward-or-insert - "\C-i" ses-forward-or-insert ;Needed for ses-coverage.el? + "\C-i" ses-forward-or-insert ; Needed for ses-coverage.el? "\M-o" ses-insert-column "\C-o" ses-insert-row "\C-m" ses-edit-cell @@ -225,10 +241,10 @@ Each function is called with ARG=1." "Initial contents for the file-trailer area at the bottom of the file.") (defconst ses-initial-file-contents - (concat " \n" ;One blank cell in print area + (concat " \n" ; One blank cell in print area. ses-print-data-boundary - "(ses-cell A1 nil nil nil nil)\n" ;One blank cell in data area - "\n" ;End-of-row terminator for the one row in data area + "(ses-cell A1 nil nil nil nil)\n" ; One blank cell in data area. + "\n" ; End-of-row terminator for the one row in data area. "(ses-column-widths [7])\n" "(ses-column-printers [nil])\n" "(ses-default-printer \"%.7g\")\n" @@ -255,23 +271,31 @@ default printer and then modify its output.") (eval-and-compile (defconst ses-localvars - '(ses--blank-line ses--cells ses--col-printers ses--col-widths ses--curcell - ses--curcell-overlay ses--default-printer ses--deferred-narrow - ses--deferred-recalc ses--deferred-write ses--file-format - ses--header-hscroll ses--header-row ses--header-string ses--linewidth - ses--numcols ses--numrows ses--symbolic-formulas ses--data-marker - ses--params-marker - ;;Global variables that we override + '(ses--blank-line ses--cells ses--col-printers + ses--col-widths (ses--curcell . nil) ses--curcell-overlay + ses--default-printer + ses--deferred-narrow (ses--deferred-recalc + . nil) (ses--deferred-write . nil) ses--file-format + (ses--header-hscroll . -1) ; Flag for "initial recalc needed" + ses--header-row ses--header-string ses--linewidth + ses--numcols ses--numrows ses--symbolic-formulas + ses--data-marker ses--params-marker (ses--Dijkstra-attempt-nb + . 0) ses--Dijkstra-weight-bound + ;; Global variables that we override mode-line-process next-line-add-newlines transient-mark-mode) "Buffer-local variables used by SES.")) -;;When compiling, create all the buffer locals and give them values -(eval-when-compile +(defun ses-set-localvars () + "Set buffer-local and initialize some SES variables." (dolist (x ses-localvars) - (make-local-variable x) - (set x nil))) + (cond + ((symbolp x) + (set (make-local-variable x) nil)) + ((consp x) + (set (make-local-variable (car x)) (cdr x))) + (error "Unexpected elements `%S' in list `ses-localvars'")))) -;;;This variable is documented as being permitted in file-locals: +;;; This variable is documented as being permitted in file-locals: (put 'ses--symbolic-formulas 'safe-local-variable 'consp) (defconst ses-paramlines-plist @@ -317,12 +341,14 @@ when to emit a progress message.") ;; We might want to use defstruct here, but cells are explicitly used as ;; arrays in ses-set-cell, so we'd need to fix this first. --Stef -(defsubst ses-make-cell (&optional symbol formula printer references) - (vector symbol formula printer references)) +(defsubst ses-make-cell (&optional symbol formula printer references + property-list) + (vector symbol formula printer references property-list)) (defmacro ses-cell-symbol (row &optional col) "From a CELL or a pair (ROW,COL), get the symbol that names the local-variable holding its value. (0,0) => A1." `(aref ,(if col `(ses-get-cell ,row ,col) row) 0)) +(put 'ses-cell-symbol 'safe-function t) (defmacro ses-cell-formula (row &optional col) "From a CELL or a pair (ROW,COL), get the function that computes its value." @@ -337,6 +363,116 @@ when to emit a progress message.") functions refer to its value." `(aref ,(if col `(ses-get-cell ,row ,col) row) 3)) +(defun ses-cell-property-get-fun (property-name cell) + ;; To speed up property fetching, each time a property is found it is placed + ;; in the first position. This way, after the first get, the full property + ;; list needs to be scanned only when the property does not exist for that + ;; cell. + (let* ((plist (aref cell 4)) + (ret (plist-member plist property-name))) + (if ret + ;; Property was found. + (let ((val (cadr ret))) + (if (eq ret plist) + ;; Property found is already in the first position, so just return + ;; its value. + val + ;; Property is not in the first position, the following will move it + ;; there before returning its value. + (let ((next (cddr ret))) + (if next + (progn + (setcdr ret (cdr next)) + (setcar ret (car next))) + (setcdr (last plist 1) nil))) + (aset cell 4 + `(,property-name ,val ,@plist)) + val))))) + +(defmacro ses-cell-property-get (property-name row &optional col) + "Get property named PROPERTY-NAME From a CELL or a pair (ROW,COL). + +When COL is omitted, CELL=ROW is a cell object. When COL is +present ROW and COL are the integer coordinates of the cell of +interest." + (declare (debug t)) + `(ses-cell-property-get-fun + ,property-name + ,(if col `(ses-get-cell ,row ,col) row))) + +(defun ses-cell-property-delq-fun (property-name cell) + (let ((ret (plist-get (aref cell 4) property-name))) + (if ret + (setcdr ret (cddr ret))))) + +(defun ses-cell-property-set-fun (property-name property-val cell) + (let* ((plist (aref cell 4)) + (ret (plist-member plist property-name))) + (if ret + (setcar (cdr ret) property-val) + (aset cell 4 `(,property-name ,property-val ,@plist))))) + +(defmacro ses-cell-property-set (property-name property-value row &optional col) + "From a CELL or a pair (ROW,COL), set the property value of +the corresponding cell with name PROPERTY-NAME to PROPERTY-VALUE." + (if property-value + `(ses-cell-property-set-fun ,property-name ,property-value + ,(if col `(ses-get-cell ,row ,col) row)) + `(ses-cell-property-delq-fun ,property-name + ,(if col `(ses-get-cell ,row ,col) row)))) + +(defun ses-cell-property-pop-fun (property-name cell) + (let* ((plist (aref cell 4)) + (ret (plist-member plist property-name))) + (if ret + (prog1 (cadr ret) + (let ((next (cddr ret))) + (if next + (progn + (setcdr ret (cdr next)) + (setcar ret (car next))) + (if (eq plist ret) + (aset cell 4 nil) + (setcdr (last plist 2) nil)))))))) + + +(defmacro ses-cell-property-pop (property-name row &optional col) + "From a CELL or a pair (ROW,COL), get and remove the property value of +the corresponding cell with name PROPERTY-NAME." + `(ses-cell-property-pop-fun ,property-name + ,(if col `(ses-get-cell ,row ,col) row))) + +(defun ses-cell-property-get-handle-fun (property-name cell) + (let* ((plist (aref cell 4)) + (ret (plist-member plist property-name))) + (if ret + (if (eq ret plist) + (cdr ret) + (let ((val (cadr ret)) + (next (cddr ret))) + (if next + (progn + (setcdr ret (cdr next)) + (setcar ret (car next))) + (setcdr (last plist 2) nil)) + (setq ret (cons val plist)) + (aset cell 4 (cons property-name ret)) + ret)) + (setq ret (cons nil plist)) + (aset cell 4 (cons property-name ret)) + ret))) + +(defmacro ses-cell-property-get-handle (property-name row &optional col) + "From a CELL or a pair (ROW,COL), get a cons cell whose car is +the property value of the corresponding cell property with name +PROPERTY-NAME." + `(ses-cell-property-get-handle-fun ,property-name + ,(if col `(ses-get-cell ,row ,col) row))) + + +(defalias 'ses-cell-property-handle-car 'car) +(defalias 'ses-cell-property-handle-setcar 'setcar) + (defmacro ses-cell-value (row &optional col) "From a CELL or a pair (ROW,COL), get the current value for that cell." `(symbol-value (ses-cell-symbol ,row ,col))) @@ -514,7 +650,7 @@ for this spreadsheet." 0-25 become A-Z; 26-701 become AA-ZZ, and so on." (let ((units (char-to-string (+ ?A (% col 26))))) (if (< col 26) - units + units (concat (ses-column-letter (1- (/ col 26))) units)))) (defun ses-create-cell-symbol (row col) @@ -534,9 +670,9 @@ for this spreadsheet." (put sym 'ses-cell (cons xrow xcol)) (make-local-variable sym))))) -;;We do not delete the ses-cell properties for the cell-variables, in case a -;;formula that refers to this cell is in the kill-ring and is later pasted -;;back in. +;; We do not delete the ses-cell properties for the cell-variables, in +;; case a formula that refers to this cell is in the kill-ring and is +;; later pasted back in. (defun ses-destroy-cell-variable-range (minrow maxrow mincol maxcol) "Destroy buffer-local variables for cells. This is undoable." (let (sym) @@ -584,7 +720,7 @@ cell (ROW,COL). This is undoable. The cell's data will be updated through (ses-aset-with-undo cell elt val))) (if change (add-to-list 'ses--deferred-write (cons row col)))) - nil) ;Make coverage-tester happy + nil) ; Make coverage-tester happy. (defun ses-cell-set-formula (row col formula) "Store a new formula for (ROW . COL) and enqueues the cell for @@ -620,6 +756,75 @@ means Emacs will crash if FORMULA contains a circular list." (ses-formula-record formula) (ses-set-cell row col 'formula formula)))) + +(defun ses-repair-cell-reference-all () + "Repair cell reference and warn if there was some reference corruption." + (interactive "*") + (let (errors) + ;; Step 1, reset :ses-repair-reference cell property in the whole sheet. + (dotimes (row ses--numrows) + (dotimes (col ses--numcols) + (let ((references (ses-cell-property-pop :ses-repair-reference + row col))) + (when references + (push (list + (ses-cell-symbol row col) + :corrupt-property + references) errors))))) + + ;; Step 2, build new. + (dotimes (row ses--numrows) + (dotimes (col ses--numcols) + (let* ((cell (ses-get-cell row col)) + (sym (ses-cell-symbol cell)) + (formula (ses-cell-formula cell)) + (new-ref (ses-formula-references formula))) + (dolist (ref new-ref) + (let* ((rowcol (ses-sym-rowcol ref)) + (h (ses-cell-property-get-handle :ses-repair-reference + (car rowcol) (cdr rowcol)))) + (unless (memq ref (ses-cell-property-handle-car h)) + (ses-cell-property-handle-setcar + h + (cons sym + (ses-cell-property-handle-car h))))))))) + + ;; Step 3, overwrite with check. + (dotimes (row ses--numrows) + (dotimes (col ses--numcols) + (let* ((cell (ses-get-cell row col)) + (irrelevant (ses-cell-references cell)) + (new-ref (ses-cell-property-pop :ses-repair-reference cell)) + missing) + (dolist (ref new-ref) + (if (memq ref irrelevant) + (setq irrelevant (delq ref irrelevant)) + (push ref missing))) + (ses-set-cell row col 'references new-ref) + (when (or missing irrelevant) + (push `( ,(ses-cell-symbol cell) + ,@(and missing (list :missing missing)) + ,@(and irrelevant (list :irrelevant irrelevant))) + errors))))) + (if errors + (warn "---------------------------------------------------------------- +Some reference where corrupted. + +The following is a list of where each element ELT is such +that (car ELT) is the reference of cell CELL with corruption, +and (cdr ELT) is a property list where + +* property `:corrupt-property' means that + property `:ses-repair-reference' of cell CELL was initially non + nil, + +* property `:missing' is a list of missing references + +* property `:irrelevant' is a list of non needed references + +%S" errors) + (message "No reference corruption found")))) + (defun ses-calculate-cell (row col force) "Calculate and print the value for cell (ROW,COL) using the cell's formula function and print functions, if any. Result is nil for normal operation, or @@ -629,34 +834,95 @@ left unchanged if it was *skip* and the new value is nil. processing for the current keystroke, unless the new value is the same as the old and FORCE is nil." (let ((cell (ses-get-cell row col)) - formula-error printer-error) + cycle-error formula-error printer-error) (let ((oldval (ses-cell-value cell)) (formula (ses-cell-formula cell)) - newval) + newval + this-cell-Dijkstra-attempt-h + this-cell-Dijkstra-attempt + this-cell-Dijkstra-attempt+1 + ref-cell-Dijkstra-attempt-h + ref-cell-Dijkstra-attempt + ref-rowcol) (when (eq (car-safe formula) 'ses-safe-formula) (setq formula (ses-safe-formula (cadr formula))) (ses-set-cell row col 'formula formula)) (condition-case sig (setq newval (eval formula)) (error + ;; Variable `sig' can't be nil. + (nconc sig (list (ses-cell-symbol cell))) (setq formula-error sig newval '*error*))) (if (and (not newval) (eq oldval '*skip*)) - ;;Don't lose the *skip* - previous field spans this one + ;; Don't lose the *skip* --- previous field spans this one. (setq newval '*skip*)) - (when (or force (not (eq newval oldval))) - (add-to-list 'ses--deferred-write (cons row col)) ;In case force=t - (ses-set-cell row col 'value newval) - (dolist (ref (ses-cell-references cell)) - (add-to-list 'ses--deferred-recalc ref)))) + (catch 'cycle + (when (or force (not (eq newval oldval))) + (add-to-list 'ses--deferred-write (cons row col)) ; In case force=t. + (setq this-cell-Dijkstra-attempt-h + (ses-cell-property-get-handle :ses-Dijkstra-attempt cell); + this-cell-Dijkstra-attempt + (ses-cell-property-handle-car this-cell-Dijkstra-attempt-h)) + (if (null this-cell-Dijkstra-attempt) + (ses-cell-property-handle-setcar + this-cell-Dijkstra-attempt-h + (setq this-cell-Dijkstra-attempt + (cons ses--Dijkstra-attempt-nb 0))) + (unless (= ses--Dijkstra-attempt-nb + (car this-cell-Dijkstra-attempt)) + (setcar this-cell-Dijkstra-attempt ses--Dijkstra-attempt-nb) + (setcdr this-cell-Dijkstra-attempt 0))) + (setq this-cell-Dijkstra-attempt+1 + (1+ (cdr this-cell-Dijkstra-attempt))) + (ses-set-cell row col 'value newval) + (dolist (ref (ses-cell-references cell)) + (add-to-list 'ses--deferred-recalc ref) + (setq ref-rowcol (ses-sym-rowcol ref) + ref-cell-Dijkstra-attempt-h + (ses-cell-property-get-handle + :ses-Dijkstra-attempt + (car ref-rowcol) (cdr ref-rowcol)) + ref-cell-Dijkstra-attempt + (ses-cell-property-handle-car ref-cell-Dijkstra-attempt-h)) + + (if (null ref-cell-Dijkstra-attempt) + (ses-cell-property-handle-setcar + ref-cell-Dijkstra-attempt-h + (setq ref-cell-Dijkstra-attempt + (cons ses--Dijkstra-attempt-nb + this-cell-Dijkstra-attempt+1))) + (if (= (car ref-cell-Dijkstra-attempt) ses--Dijkstra-attempt-nb) + (setcdr ref-cell-Dijkstra-attempt + (max (cdr ref-cell-Dijkstra-attempt) + this-cell-Dijkstra-attempt+1)) + (setcar ref-cell-Dijkstra-attempt ses--Dijkstra-attempt-nb) + (setcdr ref-cell-Dijkstra-attempt + this-cell-Dijkstra-attempt+1))) + + (when (> this-cell-Dijkstra-attempt+1 ses--Dijkstra-weight-bound) + ;; Update print of this cell. + (throw 'cycle (setq formula-error + `(error ,(format "Found cycle on cells %S" + (ses-cell-symbol cell))) + cycle-error formula-error))))))) (setq printer-error (ses-print-cell row col)) - (or formula-error printer-error))) + (or + (and cycle-error + (error (error-message-string cycle-error))) + formula-error printer-error))) (defun ses-clear-cell (row col) "Delete formula and printer for cell (ROW,COL)." (ses-set-cell row col 'printer nil) (ses-cell-set-formula row col nil)) +(defcustom ses-self-reference-early-detection nil + "True if cycle detection is early for cells that refer to +themselves." + :type 'boolean + :group 'ses) + (defun ses-update-cells (list &optional force) "Recalculate cells in LIST, checking for dependency loops. Prints progress messages every second. Dependent cells are not recalculated @@ -664,13 +930,13 @@ if the cell's value is unchanged and FORCE is nil." (let ((ses--deferred-recalc list) (nextlist list) (pos (point)) - curlist prevlist rowcol formula) + curlist prevlist this-sym this-rowcol formula) (with-temp-message " " - (while (and ses--deferred-recalc (not (equal nextlist prevlist))) - ;;In each loop, recalculate cells that refer only to other cells that - ;;have already been recalculated or aren't in the recalculation - ;;region. Repeat until all cells have been processed or until the - ;;set of cells being worked on stops changing. + (while ses--deferred-recalc + ;; In each loop, recalculate cells that refer only to other cells that + ;; have already been recalculated or aren't in the recalculation region. + ;; Repeat until all cells have been processed or until the set of cells + ;; being worked on stops changing. (if prevlist (message "Recalculating... (%d cells left)" (length ses--deferred-recalc))) @@ -678,38 +944,39 @@ if the cell's value is unchanged and FORCE is nil." ses--deferred-recalc nil prevlist nextlist) (while curlist - (setq rowcol (ses-sym-rowcol (car curlist)) - formula (ses-cell-formula (car rowcol) (cdr rowcol))) + ;; this-sym has to be popped from curlist *BEFORE* the check, and not + ;; after because of the case of cells referring to themselves. + (setq this-sym (pop curlist) + this-rowcol (ses-sym-rowcol this-sym) + formula (ses-cell-formula (car this-rowcol) + (cdr this-rowcol))) (or (catch 'ref (dolist (ref (ses-formula-references formula)) - (when (or (memq ref curlist) - (memq ref ses--deferred-recalc)) - ;;This cell refers to another that isn't done yet - (add-to-list 'ses--deferred-recalc (car curlist)) - (throw 'ref t)))) - ;;ses-update-cells is called from post-command-hook, so - ;;inhibit-quit is implicitly bound to t. + (if (and ses-self-reference-early-detection (eq ref this-sym)) + (error "Cycle found: cell %S is self-referring" this-sym) + (when (or (memq ref curlist) + (memq ref ses--deferred-recalc)) + ;; This cell refers to another that isn't done yet + (add-to-list 'ses--deferred-recalc this-sym) + (throw 'ref t))))) + ;; ses-update-cells is called from post-command-hook, so + ;; inhibit-quit is implicitly bound to t. (when quit-flag - ;;Abort the recalculation. User will probably undo now. + ;; Abort the recalculation. User will probably undo now. (error "Quit")) - (ses-calculate-cell (car rowcol) (cdr rowcol) force)) - (setq curlist (cdr curlist))) + (ses-calculate-cell (car this-rowcol) (cdr this-rowcol) force))) (dolist (ref ses--deferred-recalc) - (add-to-list 'nextlist ref)) - (setq nextlist (sort (copy-sequence nextlist) 'string<)) - (if (equal nextlist prevlist) - ;;We'll go around the loop one more time. - (add-to-list 'nextlist t))) + (add-to-list 'nextlist ref))) (when ses--deferred-recalc - ;;Just couldn't finish these + ;; Just couldn't finish these. (dolist (x ses--deferred-recalc) - (let ((rowcol (ses-sym-rowcol x))) - (ses-set-cell (car rowcol) (cdr rowcol) 'value '*error*) - (1value (ses-print-cell (car rowcol) (cdr rowcol))))) + (let ((this-rowcol (ses-sym-rowcol x))) + (ses-set-cell (car this-rowcol) (cdr this-rowcol) 'value '*error*) + (1value (ses-print-cell (car this-rowcol) (cdr this-rowcol))))) (error "Circular references: %s" ses--deferred-recalc)) (message " ")) - ;;Can't use save-excursion here: if the cell under point is - ;;updated, save-excusion's marker will move past the cell. + ;; Can't use save-excursion here: if the cell under point is updated, + ;; save-excusion's marker will move past the cell. (goto-char pos))) @@ -721,22 +988,22 @@ if the cell's value is unchanged and FORCE is nil." "Returns t if point is in print area of spreadsheet." (<= (point) ses--data-marker)) -;;We turn off point-motion-hooks and explicitly position the cursor, in case -;;the intangible properties have gotten screwed up (e.g., when -;;ses-goto-print is called during a recursive ses-print-cell). +;; We turn off point-motion-hooks and explicitly position the cursor, in case +;; the intangible properties have gotten screwed up (e.g., when ses-goto-print +;; is called during a recursive ses-print-cell). (defun ses-goto-print (row col) "Move point to print area for cell (ROW,COL)." (let ((inhibit-point-motion-hooks t) (n 0)) (goto-char (point-min)) (forward-line row) - ;; calculate column position + ;; Calculate column position. (dotimes (c col) (setq n (+ n (ses-col-width c) 1))) - ;; move to the position + ;; Move to the position. (and (> n (move-to-column n)) (eolp) - ;; move point to the bol of next line (for TAB at the last cell) + ;; Move point to the bol of next line (for TAB at the last cell). (forward-char)))) (defun ses-set-curcell () @@ -745,13 +1012,13 @@ region, or nil if cursor is not at a cell." (if (or (not mark-active) deactivate-mark (= (region-beginning) (region-end))) - ;;Single cell + ;; Single cell. (setq ses--curcell (get-text-property (point) 'intangible)) - ;;Range + ;; Range. (let ((bcell (get-text-property (region-beginning) 'intangible)) (ecell (get-text-property (1- (region-end)) 'intangible))) (when (= (region-end) ses--data-marker) - ;;Correct for overflow + ;; Correct for overflow. (setq ecell (get-text-property (- (region-end) 2) 'intangible))) (setq ses--curcell (if (and bcell ecell) (cons bcell ecell) @@ -764,7 +1031,7 @@ appropriate if some argument is 'end. A range is appropriate if some argument is 'range. A single cell is appropriate unless some argument is 'needrange." (if (eq ses--curcell t) - ;;curcell recalculation was postponed, but user typed ahead + ;; curcell recalculation was postponed, but user typed ahead. (ses-set-curcell)) (cond ((not ses--curcell) @@ -791,53 +1058,53 @@ preceding cell has spilled over." (printer (ses-cell-printer cell)) (maxcol (1+ col)) text sig startpos x) - ;;Create the string to print + ;; Create the string to print. (cond ((eq value '*skip*) - ;;Don't print anything + ;; Don't print anything. (throw 'ses-print-cell nil)) ((eq value '*error*) (setq text (make-string (ses-col-width col) ?#))) (t - ;;Deferred safety-check on printer + ;; Deferred safety-check on printer. (if (eq (car-safe printer) 'ses-safe-printer) (ses-set-cell row col 'printer (setq printer (ses-safe-printer (cadr printer))))) - ;;Print the value + ;; Print the value. (setq text (ses-call-printer (or printer (ses-col-printer col) ses--default-printer) value)) (if (consp ses-call-printer-return) - ;;Printer returned an error + ;; Printer returned an error. (setq sig ses-call-printer-return)))) - ;;Adjust print width to match column width + ;; Adjust print width to match column width. (let ((width (ses-col-width col)) (len (string-width text))) (cond ((< len width) - ;;Fill field to length with spaces + ;; Fill field to length with spaces. (setq len (make-string (- width len) ?\s) text (if (eq ses-call-printer-return t) (concat text len) (concat len text)))) ((> len width) - ;;Spill over into following cells, if possible + ;; Spill over into following cells, if possible. (let ((maxwidth width)) (while (and (> len maxwidth) (< maxcol ses--numcols) (or (not (setq x (ses-cell-value row maxcol))) (eq x '*skip*))) (unless x - ;;Set this cell to '*skip* so it won't overwrite our spillover + ;; Set this cell to '*skip* so it won't overwrite our spillover. (ses-set-cell row maxcol 'value '*skip*)) (setq maxwidth (+ maxwidth (ses-col-width maxcol) 1) maxcol (1+ maxcol))) (if (<= len maxwidth) - ;;Fill to complete width of all the fields spanned + ;; Fill to complete width of all the fields spanned. (setq text (concat text (make-string (- maxwidth len) ?\s))) - ;;Not enough room to end of line or next non-nil field. Truncate - ;;if string or decimal; otherwise fill with error indicator + ;; Not enough room to end of line or next non-nil field. Truncate + ;; if string or decimal; otherwise fill with error indicator. (setq sig `(error "Too wide" ,text)) (cond ((stringp value) @@ -854,12 +1121,12 @@ preceding cell has spilled over." (substring text (match-end 0))))) (t (setq text (make-string maxwidth ?#))))))))) - ;;Substitute question marks for tabs and newlines. Newlines are - ;;used as row-separators; tabs could confuse the reimport logic. + ;; Substitute question marks for tabs and newlines. Newlines are used as + ;; row-separators; tabs could confuse the reimport logic. (setq text (replace-regexp-in-string "[\t\n]" "?" text)) (ses-goto-print row col) (setq startpos (point)) - ;;Install the printed result. This is not interruptible. + ;; Install the printed result. This is not interruptible. (let ((inhibit-read-only t) (inhibit-quit t)) (let ((inhibit-point-motion-hooks t)) @@ -867,32 +1134,32 @@ preceding cell has spilled over." (move-to-column (+ (current-column) (string-width text))) (1+ (point))))) - ;;We use concat instead of inserting separate strings in order to - ;;reduce the number of cells in the undo list. + ;; We use concat instead of inserting separate strings in order to + ;; reduce the number of cells in the undo list. (setq x (concat text (if (< maxcol ses--numcols) " " "\n"))) - ;;We use set-text-properties to prevent a wacky print function - ;;from inserting rogue properties, and to ensure that the keymap - ;;property is inherited (is it a bug that only unpropertied strings - ;;actually inherit from surrounding text?) + ;; We use set-text-properties to prevent a wacky print function from + ;; inserting rogue properties, and to ensure that the keymap property is + ;; inherited (is it a bug that only unpropertied strings actually + ;; inherit from surrounding text?) (set-text-properties 0 (length x) nil x) (insert-and-inherit x) (put-text-property startpos (point) 'intangible (ses-cell-symbol cell)) (when (and (zerop row) (zerop col)) - ;;Reconstruct special beginning-of-buffer attributes + ;; Reconstruct special beginning-of-buffer attributes. (put-text-property (point-min) (point) 'keymap 'ses-mode-print-map) (put-text-property (point-min) (point) 'read-only 'ses) (put-text-property (point-min) (1+ (point-min)) 'front-sticky t))) (if (= row (1- ses--header-row)) - ;;This line is part of the header - force recalc + ;; This line is part of the header --- force recalc. (ses-reset-header-string)) - ;;If this cell (or a preceding one on the line) previously spilled over - ;;and has gotten shorter, redraw following cells on line recursively. + ;; If this cell (or a preceding one on the line) previously spilled over + ;; and has gotten shorter, redraw following cells on line recursively. (when (and (< maxcol ses--numcols) (eq (ses-cell-value row maxcol) '*skip*)) (ses-set-cell row maxcol 'value nil) (ses-print-cell row maxcol)) - ;;Return to start of cell + ;; Return to start of cell. (goto-char startpos) sig))) @@ -903,17 +1170,19 @@ The variable `ses-call-printer-return' is set to t if the printer used parenthesis to request left-justification, or the error-signal if the printer signaled one (and \"%s\" is used as the default printer), else nil." (setq ses-call-printer-return nil) - (unless value - (setq value "")) (condition-case signal (cond ((stringp printer) - (format printer value)) + (if value + (format printer value) + "")) ((stringp (car-safe printer)) (setq ses-call-printer-return t) - (format (car printer) value)) + (if value + (format (car printer) value) + "")) (t - (setq value (funcall printer value)) + (setq value (funcall printer (or value ""))) (if (stringp value) value (or (stringp (car-safe value)) @@ -932,13 +1201,13 @@ inhibit-quit to t." (blank (if (> change 0) (make-string change ?\s))) (at-end (= col ses--numcols))) (ses-set-with-undo 'ses--linewidth (+ ses--linewidth change)) - ;;ses-set-with-undo always returns t for strings. + ;; ses-set-with-undo always returns t for strings. (1value (ses-set-with-undo 'ses--blank-line (concat (make-string ses--linewidth ?\s) "\n"))) (dotimes (row ses--numrows) (ses-goto-print row col) (when at-end - ;;Insert new columns before newline + ;; Insert new columns before newline. (let ((inhibit-point-motion-hooks t)) (backward-char 1))) (if blank @@ -976,13 +1245,13 @@ number, COL is the column number for a data cell -- otherwise DEF is one of the symbols ses--col-widths, ses--col-printers, ses--default-printer, ses--numrows, or ses--numcols." (ses-widen) - (let ((inhibit-point-motion-hooks t)) ;In case intangible attrs are wrong + (let ((inhibit-point-motion-hooks t)) ; In case intangible attrs are wrong. (if col - ;;It's a cell + ;; It's a cell. (progn (goto-char ses--data-marker) (forward-line (+ 1 (* def (1+ ses--numcols)) col))) - ;;Convert def-symbol to offset + ;; Convert def-symbol to offset. (setq def (plist-get ses-paramlines-plist def)) (or def (signal 'args-out-of-range nil)) (goto-char ses--params-marker) @@ -993,8 +1262,8 @@ ses--default-printer, ses--numrows, or ses--numcols." See `ses-goto-data' for meaning of DEF. Newlines in the data are escaped. If ELEM is specified, it is the array subscript within DEF to be set to VALUE." (save-excursion - ;;We call ses-goto-data early, using the old values of numrows and - ;;numcols in case one of them is being changed. + ;; We call ses-goto-data early, using the old values of numrows and numcols + ;; in case one of them is being changed. (ses-goto-data def) (let ((inhibit-read-only t) (fmt (plist-get '(ses--col-widths "(ses-column-widths %S)" @@ -1012,7 +1281,7 @@ If ELEM is specified, it is the array subscript within DEF to be set to VALUE." (aset (symbol-value def) elem value)) (setq oldval (symbol-value def)) (set def value)) - ;;Special undo since it's outside the narrowed buffer + ;; Special undo since it's outside the narrowed buffer. (let (buffer-undo-list) (delete-region (point) (line-end-position)) (insert (format fmt (symbol-value def)))) @@ -1042,7 +1311,7 @@ Newlines in the data are escaped." (setq formula (cadr formula))) (if (eq (car-safe printer) 'ses-safe-printer) (setq printer (cadr printer))) - ;;This is noticably faster than (format "%S %S %S %S %S") + ;; This is noticably faster than (format "%S %S %S %S %S") (setq text (concat "(ses-cell " (symbol-name sym) " " @@ -1072,29 +1341,30 @@ Newlines in the data are escaped." (defun ses-formula-references (formula &optional result-so-far) "Produce a list of symbols for cells that this formula's value -refers to. For recursive calls, RESULT-SO-FAR is the list being constructed, -or t to get a wrong-type-argument error when the first reference is found." - (if (atom formula) - (if (ses-sym-rowcol formula) - ;;Entire formula is one symbol - (add-to-list 'result-so-far formula) - ) ;;Ignore other atoms - (dolist (cur formula) - (cond - ((ses-sym-rowcol cur) - ;;Save this reference - (add-to-list 'result-so-far cur)) - ((eq (car-safe cur) 'ses-range) - ;;All symbols in range are referenced - (dolist (x (cdr (macroexpand cur))) - (add-to-list 'result-so-far x))) - ((and (consp cur) (not (eq (car cur) 'quote))) - ;;Recursive call for subformulas - (setq result-so-far (ses-formula-references cur result-so-far))) - (t - ;;Ignore other stuff - )))) - result-so-far) +refers to. For recursive calls, RESULT-SO-FAR is the list being +constructed, or t to get a wrong-type-argument error when the +first reference is found." + (if (ses-sym-rowcol formula) + ;;Entire formula is one symbol + (add-to-list 'result-so-far formula) + (if (consp formula) + (cond + ((eq (car formula) 'ses-range) + (dolist (cur + (cdr (funcall 'macroexpand + (list 'ses-range (nth 1 formula) + (nth 2 formula))))) + (add-to-list 'result-so-far cur))) + ((null (eq (car formula) 'quote)) + ;;Recursive call for subformulas + (dolist (cur formula) + (setq result-so-far (ses-formula-references cur result-so-far)))) + (t + ;;Ignore other stuff + )) + ;; other type of atom are ignored + )) + result-so-far) (defsubst ses-relocate-symbol (sym rowcol startrow startcol rowincr colincr) "Relocate one symbol SYM, whichs corresponds to ROWCOL (a cons of ROW and @@ -1129,7 +1399,7 @@ Sets `ses-relocate-return' to 'delete if cell-references were removed." (if (setq rowcol (ses-sym-rowcol formula)) (ses-relocate-symbol formula rowcol startrow startcol rowincr colincr) - formula) ;Pass through as-is + formula) ; Pass through as-is. (dolist (cur formula) (setq rowcol (ses-sym-rowcol cur)) (cond @@ -1138,9 +1408,9 @@ Sets `ses-relocate-return' to 'delete if cell-references were removed." startrow startcol rowincr colincr)) (if cur (push cur result) - ;;Reference to a deleted cell. Set a flag in ses-relocate-return. - ;;don't change the flag if it's already 'range, since range - ;;implies 'delete. + ;; Reference to a deleted cell. Set a flag in ses-relocate-return. + ;; don't change the flag if it's already 'range, since range implies + ;; 'delete. (unless ses-relocate-return (setq ses-relocate-return 'delete)))) ((eq (car-safe cur) 'ses-range) @@ -1148,10 +1418,10 @@ Sets `ses-relocate-return' to 'delete if cell-references were removed." (if cur (push cur result))) ((or (atom cur) (eq (car cur) 'quote)) - ;;Constants pass through unchanged + ;; Constants pass through unchanged. (push cur result)) (t - ;;Recursively copy and alter subformulas + ;; Recursively copy and alter subformulas. (push (ses-relocate-formula cur startrow startcol rowincr colincr) result)))) @@ -1177,47 +1447,47 @@ if the range was altered." field) (cond ((and (not min) (not max)) - (setq range nil)) ;;The entire range is deleted + (setq range nil)) ; The entire range is deleted. ((zerop colincr) - ;;Inserting or deleting rows + ;; Inserting or deleting rows. (setq field 'car) (if (not min) - ;;Chopped off beginning of range + ;; Chopped off beginning of range. (setq min (ses-create-cell-symbol startrow (cdr minrowcol)) ses-relocate-return 'range)) (if (not max) (if (> rowincr 0) - ;;Trying to insert a nonexistent row + ;; Trying to insert a nonexistent row. (setq max (ses-create-cell-symbol (1- ses--numrows) (cdr minrowcol))) - ;;End of range is being deleted + ;; End of range is being deleted. (setq max (ses-create-cell-symbol (1- startrow) (cdr minrowcol)) ses-relocate-return 'range)) (and (> rowincr 0) (= (car maxrowcol) (1- startrow)) (= (cdr minrowcol) (cdr maxrowcol)) - ;;Insert after ending row of vertical range - include it + ;; Insert after ending row of vertical range --- include it. (setq max (ses-create-cell-symbol (+ startrow rowincr -1) (cdr maxrowcol)))))) (t - ;;Inserting or deleting columns + ;; Inserting or deleting columns. (setq field 'cdr) (if (not min) - ;;Chopped off beginning of range + ;; Chopped off beginning of range. (setq min (ses-create-cell-symbol (car minrowcol) startcol) ses-relocate-return 'range)) (if (not max) (if (> colincr 0) - ;;Trying to insert a nonexistent column + ;; Trying to insert a nonexistent column. (setq max (ses-create-cell-symbol (car maxrowcol) (1- ses--numcols))) - ;;End of range is being deleted + ;; End of range is being deleted. (setq max (ses-create-cell-symbol (car maxrowcol) (1- startcol)) ses-relocate-return 'range)) (and (> colincr 0) (= (cdr maxrowcol) (1- startcol)) (= (car minrowcol) (car maxrowcol)) - ;;Insert after ending column of horizontal range - include it + ;; Insert after ending column of horizontal range --- include it. (setq max (ses-create-cell-symbol (car maxrowcol) (+ startcol colincr -1))))))) (when range @@ -1225,9 +1495,9 @@ if the range was altered." (funcall field minrowcol)) (- (funcall field (ses-sym-rowcol max)) (funcall field (ses-sym-rowcol min)))) - ;;This range has changed size + ;; This range has changed size. (setq ses-relocate-return 'range)) - (list 'ses-range min max)))) + `(ses-range ,min ,max ,@(cdddr range))))) (defun ses-relocate-all (minrow mincol rowincr colincr) "Alter all cell values, symbols, formulas, and reference-lists to relocate @@ -1236,7 +1506,7 @@ to each symbol." (let (reform) (let (mycell newval) (dotimes-with-progress-reporter - (row ses--numrows) "Relocating formulas..." + (row ses--numrows) "Relocating formulas..." (dotimes (col ses--numcols) (setq ses-relocate-return nil mycell (ses-get-cell row col) @@ -1244,13 +1514,13 @@ to each symbol." minrow mincol rowincr colincr)) (ses-set-cell row col 'formula newval) (if (eq ses-relocate-return 'range) - ;;This cell contains a (ses-range X Y) where a cell has been - ;;inserted or deleted in the middle of the range. + ;; This cell contains a (ses-range X Y) where a cell has been + ;; inserted or deleted in the middle of the range. (push (cons row col) reform)) (if ses-relocate-return - ;;This cell referred to a cell that's been deleted or is no - ;;longer part of the range. We can't fix that now because - ;;reference lists cells have been partially updated. + ;; This cell referred to a cell that's been deleted or is no + ;; longer part of the range. We can't fix that now because + ;; reference lists cells have been partially updated. (add-to-list 'ses--deferred-recalc (ses-create-cell-symbol row col))) (setq newval (ses-relocate-formula (ses-cell-references mycell) @@ -1259,13 +1529,13 @@ to each symbol." (and (>= row minrow) (>= col mincol) (ses-set-cell row col 'symbol (ses-create-cell-symbol row col)))))) - ;;Relocate the cell values + ;; Relocate the cell values. (let (oldval myrow mycol xrow xcol) (cond ((and (<= rowincr 0) (<= colincr 0)) - ;;Deletion of rows and/or columns + ;; Deletion of rows and/or columns. (dotimes-with-progress-reporter - (row (- ses--numrows minrow)) "Relocating variables..." + (row (- ses--numrows minrow)) "Relocating variables..." (setq myrow (+ row minrow)) (dotimes (col (- ses--numcols mincol)) (setq mycol (+ col mincol) @@ -1273,11 +1543,11 @@ to each symbol." xcol (- mycol colincr)) (if (and (< xrow ses--numrows) (< xcol ses--numcols)) (setq oldval (ses-cell-value xrow xcol)) - ;;Cell is off the end of the array + ;; Cell is off the end of the array. (setq oldval (symbol-value (ses-create-cell-symbol xrow xcol)))) (ses-set-cell myrow mycol 'value oldval)))) ((and (wholenump rowincr) (wholenump colincr)) - ;;Insertion of rows and/or columns. Run the loop backwards. + ;; Insertion of rows and/or columns. Run the loop backwards. (let ((disty (1- ses--numrows)) (distx (1- ses--numcols)) myrow mycol) @@ -1289,16 +1559,16 @@ to each symbol." xrow (- myrow rowincr) xcol (- mycol colincr)) (if (or (< xrow minrow) (< xcol mincol)) - ;;Newly-inserted value + ;; Newly-inserted value. (setq oldval nil) - ;;Transfer old value + ;; Transfer old value. (setq oldval (ses-cell-value xrow xcol))) (ses-set-cell myrow mycol 'value oldval))) - t)) ;Make testcover happy by returning non-nil here + t)) ; Make testcover happy by returning non-nil here. (t (error "ROWINCR and COLINCR must have the same sign")))) - ;;Reconstruct reference lists for cells that contain ses-ranges that - ;;have changed size. + ;; Reconstruct reference lists for cells that contain ses-ranges that have + ;; changed size. (when reform (message "Fixing ses-ranges...") (let (row col) @@ -1324,9 +1594,9 @@ to each symbol." (defun ses-set-with-undo (sym newval) "Like set, but undoable. Result is t if value has changed." - ;;We try to avoid adding redundant entries to the undo list, but this is - ;;unavoidable for strings because equal ignores text properties and there's - ;;no easy way to get the whole property list to see if it's different! + ;; We try to avoid adding redundant entries to the undo list, but this is + ;; unavoidable for strings because equal ignores text properties and there's + ;; no easy way to get the whole property list to see if it's different! (unless (and (boundp sym) (equal (symbol-value sym) newval) (not (stringp newval))) @@ -1339,14 +1609,15 @@ to each symbol." (defun ses-unset-with-undo (sym) "Set SYM to be unbound. This is undoable." - (when (1value (boundp sym)) ;;Always bound, except after a programming error + (when (1value (boundp sym)) ; Always bound, except after a programming error. (push `(apply ses-set-with-undo ,sym ,(symbol-value sym)) buffer-undo-list) (makunbound sym))) (defun ses-aset-with-undo (array idx newval) "Like aset, but undoable. Result is t if element has changed" (unless (equal (aref array idx) newval) - (push `(apply ses-aset-with-undo ,array ,idx ,(aref array idx)) buffer-undo-list) + (push `(apply ses-aset-with-undo ,array ,idx + ,(aref array idx)) buffer-undo-list) (aset array idx newval) t)) @@ -1359,7 +1630,7 @@ to each symbol." "Parse the current buffer and sets up buffer-local variables. Does not execute cell formulas or print functions." (widen) - ;;Read our global parameters, which should be a 3-element list + ;; Read our global parameters, which should be a 3-element list. (goto-char (point-max)) (search-backward ";; Local Variables:\n" nil t) (backward-list 1) @@ -1376,7 +1647,7 @@ execute cell formulas or print functions." ses--numrows (cadr params) ses--numcols (nth 2 params)) (when (= ses--file-format 1) - (let (buffer-undo-list) ;This is not undoable + (let (buffer-undo-list) ; This is not undoable. (ses-goto-data 'ses--header-row) (insert "(ses-header-row 0)\n") (ses-set-parameter 'ses--file-format 2) @@ -1384,11 +1655,11 @@ execute cell formulas or print functions." (or (= ses--file-format 2) (error "This file needs a newer version of the SES library code")) (ses-create-cell-variable-range 0 (1- ses--numrows) 0 (1- ses--numcols)) - ;;Initialize cell array + ;; Initialize cell array. (setq ses--cells (make-vector ses--numrows nil)) (dotimes (row ses--numrows) (aset ses--cells row (make-vector ses--numcols nil)))) - ;;Skip over print area, which we assume is correct + ;; Skip over print area, which we assume is correct. (goto-char (point-min)) (forward-line ses--numrows) (or (looking-at ses-print-data-boundary) @@ -1396,10 +1667,10 @@ execute cell formulas or print functions." (forward-char 1) (setq ses--data-marker (point-marker)) (forward-char (1- (length ses-print-data-boundary))) - ;;Initialize printer and symbol lists + ;; Initialize printer and symbol lists. (mapc 'ses-printer-record ses-standard-printer-functions) (setq ses--symbolic-formulas nil) - ;;Load cell definitions + ;; Load cell definitions. (dotimes (row ses--numrows) (dotimes (col ses--numcols) (let* ((x (read (current-buffer))) @@ -1412,7 +1683,7 @@ execute cell formulas or print functions." (eval x))) (or (looking-at "\n\n") (error "Missing blank line between rows"))) - ;;Load global parameters + ;; Load global parameters. (let ((widths (read (current-buffer))) (n1 (char-after (point))) (printers (read (current-buffer))) @@ -1434,12 +1705,12 @@ execute cell formulas or print functions." (1value (eval def-printer)) (1value (eval printers)) (1value (eval head-row))) - ;;Should be back at global-params + ;; Should be back at global-params. (forward-char 1) (or (looking-at (replace-regexp-in-string "1" "[0-9]+" ses-initial-global-parameters)) (error "Problem with column-defs or global-params")) - ;;Check for overall newline count in definitions area + ;; Check for overall newline count in definitions area. (forward-line 3) (let ((start (point))) (ses-goto-data 'ses--numrows) @@ -1457,23 +1728,23 @@ Narrows the buffer to show only the print area. Gives it `read-only' and (inhibit-point-motion-hooks t) (was-modified (buffer-modified-p)) pos sym) - (ses-goto-data 0 0) ;;Include marker between print-area and data-area - (set-text-properties (point) (point-max) nil) ;Delete garbage props + (ses-goto-data 0 0) ; Include marker between print-area and data-area. + (set-text-properties (point) (point-max) nil) ; Delete garbage props. (mapc 'delete-overlay (overlays-in (point-min) (point-max))) - ;;The print area is read-only (except for our special commands) and uses a - ;;special keymap. + ;; The print area is read-only (except for our special commands) and uses a + ;; special keymap. (put-text-property (point-min) (1- (point)) 'read-only 'ses) (put-text-property (point-min) (1- (point)) 'keymap 'ses-mode-print-map) - ;;For the beginning of the buffer, we want the read-only and keymap - ;;attributes to be inherited from the first character + ;; For the beginning of the buffer, we want the read-only and keymap + ;; attributes to be inherited from the first character. (put-text-property (point-min) (1+ (point-min)) 'front-sticky t) - ;;Create intangible properties, which also indicate which cell the text - ;;came from. + ;; Create intangible properties, which also indicate which cell the text + ;; came from. (dotimes-with-progress-reporter (row ses--numrows) "Finding cells..." (dotimes (col ses--numcols) (setq pos end sym (ses-cell-symbol row col)) - ;;Include skipped cells following this one + ;; Include skipped cells following this one. (while (and (< col (1- ses--numcols)) (eq (ses-cell-value row (1+ col)) '*skip*)) (setq end (+ end (ses-col-width col) 1) @@ -1487,13 +1758,13 @@ Narrows the buffer to show only the print area. Gives it `read-only' and (forward-char) (point)))) (put-text-property pos end 'intangible sym))) - ;;Adding these properties did not actually alter the text + ;; Adding these properties did not actually alter the text. (unless was-modified (restore-buffer-modified-p nil) (buffer-disable-undo) (buffer-enable-undo))) - ;;Create the underlining overlay. It's impossible for (point) to be 2, - ;;because column A must be at least 1 column wide. + ;; Create the underlining overlay. It's impossible for (point) to be 2, + ;; because column A must be at least 1 column wide. (setq ses--curcell-overlay (make-overlay (1+ (point-min)) (1+ (point-min)))) (overlay-put ses--curcell-overlay 'face 'underline)) @@ -1502,15 +1773,15 @@ Narrows the buffer to show only the print area. Gives it `read-only' and Delete overlays, remove special text properties." (widen) (let ((inhibit-read-only t) - ;; When reverting, hide the buffer name, otherwise Emacs will ask - ;; the user "the file is modified, do you really want to make - ;; modifications to this buffer", where the "modifications" refer to - ;; the irrelevant set-text-properties below. - (buffer-file-name nil) + ;; When reverting, hide the buffer name, otherwise Emacs will ask the + ;; user "the file is modified, do you really want to make modifications + ;; to this buffer", where the "modifications" refer to the irrelevant + ;; set-text-properties below. + (buffer-file-name nil) (was-modified (buffer-modified-p))) - ;;Delete read-only, keymap, and intangible properties + ;; Delete read-only, keymap, and intangible properties. (set-text-properties (point-min) (point-max) nil) - ;;Delete overlay + ;; Delete overlay. (mapc 'delete-overlay (overlays-in (point-min) (point-max))) (unless was-modified (restore-buffer-modified-p nil)))) @@ -1530,30 +1801,26 @@ These are active only in the minibuffer, when entering or editing a formula: (unless (and (boundp 'ses--deferred-narrow) (eq ses--deferred-narrow 'ses-mode)) (kill-all-local-variables) - (mapc 'make-local-variable ses-localvars) + (ses-set-localvars) (setq major-mode 'ses-mode mode-name "SES" next-line-add-newlines nil truncate-lines t - ;;SES deliberately puts lots of trailing whitespace in its buffer + ;; SES deliberately puts lots of trailing whitespace in its buffer. show-trailing-whitespace nil - ;;Cell ranges do not work reasonably without this + ;; Cell ranges do not work reasonably without this. transient-mark-mode t - ;;not to use tab characters for safe - ;;(tabs may do bad for column calculation) + ;; Not to use tab characters for safe (tabs may do bad for column + ;; calculation). indent-tabs-mode nil) (1value (add-hook 'change-major-mode-hook 'ses-cleanup nil t)) (1value (add-hook 'before-revert-hook 'ses-cleanup nil t)) - (setq ses--curcell nil - ses--deferred-recalc nil - ses--deferred-write nil - ses--header-hscroll -1 ;Flag for "initial recalc needed" - header-line-format '(:eval (progn + (setq header-line-format '(:eval (progn (when (/= (window-hscroll) ses--header-hscroll) - ;;Reset ses--header-hscroll first, to - ;;avoid recursion problems when - ;;debugging ses-create-header-string + ;; Reset ses--header-hscroll first, + ;; to avoid recursion problems when + ;; debugging ses-create-header-string (setq ses--header-hscroll (window-hscroll)) (ses-create-header-string)) @@ -1562,12 +1829,13 @@ These are active only in the minibuffer, when entering or editing a formula: (was-modified (buffer-modified-p))) (save-excursion (if was-empty - ;;Initialize buffer to contain one cell, for now + ;; Initialize buffer to contain one cell, for now. (insert ses-initial-file-contents)) (ses-load) (ses-setup)) (when was-empty - (unless (equal ses-initial-default-printer (1value ses--default-printer)) + (unless (equal ses-initial-default-printer + (1value ses--default-printer)) (1value (ses-read-default-printer ses-initial-default-printer))) (unless (= ses-initial-column-width (1value (ses-col-width 0))) (1value (ses-set-column-width 0 ses-initial-column-width))) @@ -1582,12 +1850,12 @@ These are active only in the minibuffer, when entering or editing a formula: (buffer-enable-undo) (goto-char (point-min)))) (use-local-map ses-mode-map) - ;;Set the deferred narrowing flag (we can't narrow until after - ;;after-find-file completes). If .ses is on the auto-load alist and the - ;;file has "mode: ses", our ses-mode function will be called twice! Use - ;;a special flag to detect this (will be reset by ses-command-hook). - ;;For find-alternate-file, post-command-hook doesn't get run for some - ;;reason, so use an idle timer to make sure. + ;; Set the deferred narrowing flag (we can't narrow until after + ;; after-find-file completes). If .ses is on the auto-load alist and the + ;; file has "mode: ses", our ses-mode function will be called twice! Use a + ;; special flag to detect this (will be reset by ses-command-hook). For + ;; find-alternate-file, post-command-hook doesn't get run for some reason, + ;; so use an idle timer to make sure. (setq ses--deferred-narrow 'ses-mode) (1value (add-hook 'post-command-hook 'ses-command-hook nil t)) (run-with-idle-timer 0.01 nil 'ses-command-hook) @@ -1601,26 +1869,28 @@ moves the underlining overlay. Performs any recalculations or cell-data writes that have been deferred. If buffer-narrowing has been deferred, narrows the buffer now." (condition-case err - (when (eq major-mode 'ses-mode) ;Otherwise, not our buffer anymore + (when (eq major-mode 'ses-mode) ; Otherwise, not our buffer anymore. (when ses--deferred-recalc - ;;We reset the deferred list before starting on the recalc -- in case - ;;of error, we don't want to retry the recalc after every keystroke! + ;; We reset the deferred list before starting on the recalc --- in + ;; case of error, we don't want to retry the recalc after every + ;; keystroke! + (ses-initialize-Dijkstra-attempt) (let ((old ses--deferred-recalc)) (setq ses--deferred-recalc nil) (ses-update-cells old))) (when ses--deferred-write - ;;We don't reset the deferred list before starting -- the most - ;;likely error is keyboard-quit, and we do want to keep trying - ;;these writes after a quit. + ;; We don't reset the deferred list before starting --- the most + ;; likely error is keyboard-quit, and we do want to keep trying these + ;; writes after a quit. (ses-write-cells) (push '(apply ses-widen) buffer-undo-list)) (when ses--deferred-narrow - ;;We're not allowed to narrow the buffer until after-find-file has - ;;read the local variables at the end of the file. Now it's safe to - ;;do the narrowing. + ;; We're not allowed to narrow the buffer until after-find-file has + ;; read the local variables at the end of the file. Now it's safe to + ;; do the narrowing. (narrow-to-region (point-min) ses--data-marker) (setq ses--deferred-narrow nil)) - ;;Update the modeline + ;; Update the modeline. (let ((oldcell ses--curcell)) (ses-set-curcell) (unless (eq ses--curcell oldcell) @@ -1636,34 +1906,34 @@ narrows the buffer now." "-" (symbol-name (cdr ses--curcell)))))) (force-mode-line-update))) - ;;Use underline overlay for single-cells only, turn off otherwise + ;; Use underline overlay for single-cells only, turn off otherwise. (if (listp ses--curcell) (move-overlay ses--curcell-overlay 2 2) (let ((next (next-single-property-change (point) 'intangible))) (move-overlay ses--curcell-overlay (point) (1- next)))) (when (not (pos-visible-in-window-p)) - ;;Scrolling will happen later + ;; Scrolling will happen later. (run-with-idle-timer 0.01 nil 'ses-command-hook) (setq ses--curcell t))) - ;;Prevent errors in this post-command-hook from silently erasing the hook! + ;; Prevent errors in this post-command-hook from silently erasing the hook! (error (unless executing-kbd-macro (ding)) (message "%s" (error-message-string err)))) - nil) ;Make coverage-tester happy + nil) ; Make coverage-tester happy. (defun ses-create-header-string () "Set up `ses--header-string' as the buffer's header line. Based on the current set of columns and `window-hscroll' position." (let ((totwidth (- (window-hscroll))) result width x) - ;;Leave room for the left-side fringe and scrollbar + ;; Leave room for the left-side fringe and scrollbar. (push (propertize " " 'display '((space :align-to 0))) result) (dotimes (col ses--numcols) (setq width (ses-col-width col) totwidth (+ totwidth width 1)) (if (= totwidth 1) - ;;Scrolled so intercolumn space is leftmost + ;; Scrolled so intercolumn space is leftmost. (push " " result)) (when (> totwidth 1) (if (> ses--header-row 0) @@ -1683,8 +1953,8 @@ Based on the current set of columns and `window-hscroll' position." 'display `((space :align-to ,(1- totwidth))) 'face ses-box-prop) result) - ;;Allow the following space to be squished to make room for the 3-D box - ;;Coverage test ignores properties, thinks this is always a space! + ;; Allow the following space to be squished to make room for the 3-D box + ;; Coverage test ignores properties, thinks this is always a space! (push (1value (propertize " " 'display `((space :align-to ,totwidth)))) result))) (if (> ses--header-row 0) @@ -1727,19 +1997,23 @@ print area if NONARROW is nil." (search-forward ses-print-data-boundary) (backward-char (length ses-print-data-boundary)) (delete-region (point-min) (point)) - ;;Insert all blank lines before printing anything, so ses-print-cell can - ;;find the data area when inserting or deleting *skip* values for cells + ;; Insert all blank lines before printing anything, so ses-print-cell can + ;; find the data area when inserting or deleting *skip* values for cells. (dotimes (row ses--numrows) (insert-and-inherit ses--blank-line)) (dotimes-with-progress-reporter (row ses--numrows) "Reprinting..." (if (eq (ses-cell-value row 0) '*skip*) - ;;Column deletion left a dangling skip + ;; Column deletion left a dangling skip. (ses-set-cell row 0 'value nil)) (dotimes (col ses--numcols) (ses-print-cell row col)) (beginning-of-line 2)) (ses-jump-safe startcell))) +(defun ses-initialize-Dijkstra-attempt () + (setq ses--Dijkstra-attempt-nb (1+ ses--Dijkstra-attempt-nb) + ses--Dijkstra-weight-bound (* ses--numrows ses--numcols))) + (defun ses-recalculate-cell () "Recalculate and reprint the current cell or range. @@ -1750,25 +2024,37 @@ to are recalculated first." (interactive "*") (ses-check-curcell 'range) (ses-begin-change) - (let (sig) + (ses-initialize-Dijkstra-attempt) + (let (sig cur-rowcol) (setq ses-start-time (float-time)) (if (atom ses--curcell) - (setq sig (ses-sym-rowcol ses--curcell) - sig (ses-calculate-cell (car sig) (cdr sig) t)) - ;;First, recalculate all cells that don't refer to other cells and - ;;produce a list of cells with references. + (when + (setq cur-rowcol (ses-sym-rowcol ses--curcell) + sig (progn + (ses-cell-property-set :ses-Dijkstra-attempt + (cons ses--Dijkstra-attempt-nb 0) + (car cur-rowcol) (cdr cur-rowcol) ) + (ses-calculate-cell (car cur-rowcol) (cdr cur-rowcol) t))) + (nconc sig (list (ses-cell-symbol (car cur-rowcol) + (cdr cur-rowcol))))) + ;; First, recalculate all cells that don't refer to other cells and + ;; produce a list of cells with references. (ses-dorange ses--curcell (ses-time-check "Recalculating... %s" '(ses-cell-symbol row col)) (condition-case nil (progn - ;;The t causes an error if the cell has references. - ;;If no references, the t will be the result value. + ;; The t causes an error if the cell has references. If no + ;; references, the t will be the result value. (1value (ses-formula-references (ses-cell-formula row col) t)) - (setq sig (ses-calculate-cell row col t))) + (ses-cell-property-set :ses-Dijkstra-attempt + (cons ses--Dijkstra-attempt-nb 0) + row col) + (when (setq sig (ses-calculate-cell row col t)) + (nconc sig (list (ses-cell-symbol row col))))) (wrong-type-argument - ;;The formula contains a reference + ;; The formula contains a reference. (add-to-list 'ses--deferred-recalc (ses-cell-symbol row col)))))) - ;;Do the update now, so we can force recalculation + ;; Do the update now, so we can force recalculation. (let ((x ses--deferred-recalc)) (setq ses--deferred-recalc nil) (condition-case hold @@ -1801,11 +2087,11 @@ cells." (col (cdr rowcol))) (when (and (< col (1- ses--numcols)) ;;Last column can't spill over, anyway (eq (ses-cell-value row (1+ col)) '*skip*)) - ;;This cell has spill-over. We'll momentarily pretend the following - ;;cell has a `t' in it. + ;; This cell has spill-over. We'll momentarily pretend the following cell + ;; has a `t' in it. (eval `(let ((,(ses-cell-symbol row (1+ col)) t)) (ses-print-cell row col))) - ;;Now remove the *skip*. ses-print-cell is always nil here + ;; Now remove the *skip*. ses-print-cell is always nil here. (ses-set-cell row (1+ col) 'value nil) (1value (ses-print-cell row (1+ col)))))) @@ -1817,12 +2103,12 @@ cells." (let (x yrow ycol) ;;Delete old reference lists (dotimes-with-progress-reporter - (row ses--numrows) "Deleting references..." + (row ses--numrows) "Deleting references..." (dotimes (col ses--numcols) (ses-set-cell row col 'references nil))) ;;Create new reference lists (dotimes-with-progress-reporter - (row ses--numrows) "Computing references..." + (row ses--numrows) "Computing references..." (dotimes (col ses--numcols) (dolist (ref (ses-formula-references (ses-cell-formula row col))) (setq x (ses-sym-rowcol ref) @@ -1831,26 +2117,27 @@ cells." (ses-set-cell yrow ycol 'references (cons (ses-cell-symbol row col) (ses-cell-references yrow ycol))))))) - ;;Delete everything and reconstruct basic data area + ;; Delete everything and reconstruct basic data area. (ses-widen) (let ((inhibit-read-only t)) (goto-char (point-max)) (if (search-backward ";; Local Variables:\n" nil t) (delete-region (point-min) (point)) - ;;Buffer is quite screwed up - can't even save the user-specified locals + ;; Buffer is quite screwed up --- can't even save the user-specified + ;; locals. (delete-region (point-min) (point-max)) (insert ses-initial-file-trailer) (goto-char (point-min))) - ;;Create a blank display area + ;; Create a blank display area. (dotimes (row ses--numrows) (insert ses--blank-line)) (insert ses-print-data-boundary) (backward-char (1- (length ses-print-data-boundary))) (setq ses--data-marker (point-marker)) (forward-char (1- (length ses-print-data-boundary))) - ;;Placeholders for cell data + ;; Placeholders for cell data. (insert (make-string (* ses--numrows (1+ ses--numcols)) ?\n)) - ;;Placeholders for col-widths, col-printers, default-printer, header-row + ;; Placeholders for col-widths, col-printers, default-printer, header-row. (insert "\n\n\n\n") (insert ses-initial-global-parameters) (backward-char (1- (length ses-initial-global-parameters))) @@ -1890,13 +2177,13 @@ cell formula was unsafe and user declined confirmation." (setq initial (format "'%S" (cadr formula))) (setq initial (prin1-to-string formula))) (if (stringp formula) - ;;Position cursor inside close-quote + ;; Position cursor inside close-quote. (setq initial (cons initial (length initial)))) (list row col (read-from-minibuffer (format "Cell %s: " ses--curcell) initial ses-mode-edit-map - t ;Convert to Lisp object + t ; Convert to Lisp object. 'ses-read-cell-history))))) (when (ses-warn-unsafe newval 'unsafep) (ses-begin-change) @@ -1917,13 +2204,13 @@ cell formula was unsafe and user declined confirmation." (cons (if (equal initial "\"") "\"\"" (if (equal initial "(") "()" initial)) 2) ses-mode-edit-map - t ;Convert to Lisp object + t ; Convert to Lisp object. 'ses-read-cell-history (prin1-to-string (if (eq (car-safe curval) 'ses-safe-formula) (cadr curval) curval)))))) (when (ses-edit-cell row col newval) - (ses-command-hook) ;Update cell widths before movement + (ses-command-hook) ; Update cell widths before movement. (dolist (x ses-after-entry-functions) (funcall x 1)))) @@ -1939,10 +2226,10 @@ have been used as formulas in this spreadsheet is available for completions." (list (car rowcol) (cdr rowcol) (if (string= newval "") - nil ;Don't create zero-length symbols! + nil ; Don't create zero-length symbols! (list 'quote (intern newval)))))) (when (ses-edit-cell row col symb) - (ses-command-hook) ;Update cell widths before movement + (ses-command-hook) ; Update cell widths before movement. (dolist (x ses-after-entry-functions) (funcall x 1)))) @@ -1970,7 +2257,7 @@ cells." (ses-check-curcell 'end) (ses-begin-change) (dotimes (x count) - (backward-char 1) ;Will signal 'beginning-of-buffer if appropriate + (backward-char 1) ; Will signal 'beginning-of-buffer if appropriate. (ses-set-curcell) (let ((rowcol (ses-sym-rowcol ses--curcell))) (ses-clear-cell (car rowcol) (cdr rowcol)))))) @@ -1990,13 +2277,13 @@ PROMPT should end with \": \". Result is t if operation was cancelled." (substring prompt 0 -2) default))) (let ((new (read-from-minibuffer prompt - nil ;Initial contents + nil ; Initial contents. ses-mode-edit-map - t ;Evaluate the result + t ; Evaluate the result. 'ses-read-printer-history (prin1-to-string default)))) (if (equal new default) - ;;User changed mind, decided not to change printer + ;; User changed mind, decided not to change printer. (setq new t) (ses-printer-validate new) (or (not new) @@ -2197,7 +2484,7 @@ If COL is specified, the new column(s) get the specified WIDTH and PRINTER ;;ses-relocate-all) (ses-goto-data row col) (insert ?\n)) - ;;Insert column width and printer + ;; Insert column width and printer. (setq widths (ses-vector-insert widths col width) printers (ses-vector-insert printers col printer))) (ses-set-parameter 'ses--col-widths widths) @@ -2208,11 +2495,11 @@ If COL is specified, the new column(s) get the specified WIDTH and PRINTER (ses-reprint-all t) (when (or (> (length (ses-call-printer printer)) 0) (> (length (ses-call-printer ses--default-printer)) 0)) - ;;Either column printer or global printer inserts some constant text - ;;Reprint the new columns to insert that text. + ;; Either column printer or global printer inserts some constant text. + ;; Reprint the new columns to insert that text. (dotimes (x ses--numrows) (dotimes (y count) - ;Always nil here - this is a blank column + ;; Always nil here --- this is a blank column. (1value (ses-print-cell-new-width x (+ y col)))))) (ses-setup))) (ses-jump-safe ses--curcell)) @@ -2272,19 +2559,19 @@ from the current one." inserts a new row if at bottom of print area. Repeat COUNT times." (interactive "p") (ses-check-curcell 'end) - (setq deactivate-mark t) ;Doesn't combine well with ranges + (setq deactivate-mark t) ; Doesn't combine well with ranges. (dotimes (x count) (ses-set-curcell) (if (not ses--curcell) - (progn ;At bottom of print area + (progn ; At bottom of print area. (barf-if-buffer-read-only) (ses-insert-row 1)) (let ((col (cdr (ses-sym-rowcol ses--curcell)))) (when (/= 32 (char-before (next-single-property-change (point) 'intangible))) - ;;We're already in last nonskipped cell on line. Need to create a - ;;new column. + ;; We're already in last nonskipped cell on line. Need to create a + ;; new column. (barf-if-buffer-read-only) (ses-insert-column (- count x) ses--numcols @@ -2312,12 +2599,12 @@ inserts a new row if at bottom of print area. Repeat COUNT times." (read-from-minibuffer (format "Column %s width [currently %d]: " (ses-column-letter col) (ses-col-width col)) - nil ;No initial contents - nil ;No override keymap - t ;Convert to Lisp object - nil ;No history + nil ; No initial contents. + nil ; No override keymap. + t ; Convert to Lisp object. + nil ; No history. (number-to-string - (ses-col-width col))))))) ;Default value + (ses-col-width col))))))) ; Default value. (if (< newwidth 1) (error "Invalid column width")) (ses-begin-change) @@ -2349,7 +2636,7 @@ hard to override how mouse-1 works." (if (not (and (eq major-mode 'ses-mode) (eq (get-text-property beg 'read-only) 'ses) (eq (get-text-property (1- end) 'read-only) 'ses))) - ad-do-it ;Normal copy-region-as-kill + ad-do-it ; Normal copy-region-as-kill. (kill-new (ses-copy-region beg end)) (if transient-mark-mode (setq deactivate-mark t)) @@ -2400,17 +2687,17 @@ the corresponding data cell." cells instead of deleting them." (interactive "r") (ses-check-curcell 'needrange) - ;;For some reason, the text-read-only error is not caught by - ;;`delete-region', so we have to use subterfuge. + ;; For some reason, the text-read-only error is not caught by `delete-region', + ;; so we have to use subterfuge. (let ((buffer-read-only t)) (1value (condition-case x (noreturn (funcall (lookup-key (current-global-map) (this-command-keys)) beg end)) - (buffer-read-only nil)))) ;The expected error - ;;Because the buffer was marked read-only, the kill command turned itself - ;;into a copy. Now we clear the cells or signal the error. First we - ;;check whether the buffer really is read-only. + (buffer-read-only nil)))) ; The expected error. + ;; Because the buffer was marked read-only, the kill command turned itself + ;; into a copy. Now we clear the cells or signal the error. First we check + ;; whether the buffer really is read-only. (barf-if-buffer-read-only) (ses-begin-change) (ses-dorange ses--curcell @@ -2437,7 +2724,7 @@ explicitly insert a symbol, or use the C-u prefix to treat all unmarked words as symbols." (if (not (and (eq major-mode 'ses-mode) (eq (get-text-property (point) 'keymap) 'ses-mode-print-map))) - ad-do-it ;Normal non-SES yank + ad-do-it ; Normal non-SES yank. (ses-check-curcell 'end) (push-mark (point)) (let ((text (current-kill (cond @@ -2450,7 +2737,7 @@ as symbols." text 0 (if (memq (aref text (1- (length text))) '(?\t ?\n)) - ;;Just one cell - delete final tab or newline + ;; Just one cell --- delete final tab or newline. (1- (length text))) arg))) (if (consp arg) @@ -2499,21 +2786,21 @@ formulas are to be inserted without relocation." pos (next-single-property-change pos 'ses text) x (ses-sym-rowcol (car last))) (if (not last) - ;;Newline - all remaining cells on row are skipped + ;; Newline --- all remaining cells on row are skipped. (setq x (cons (- myrow rowincr) (+ needcols colincr -1)) last (list nil nil nil) pos (1- pos))) (if (/= (car x) (- myrow rowincr)) (error "Cell row error")) (if (< (- mycol colincr) (cdr x)) - ;;Some columns were skipped + ;; Some columns were skipped. (let ((oldcol mycol)) (while (< (- mycol colincr) (cdr x)) (ses-clear-cell myrow mycol) (setq col (1+ col) mycol (1+ mycol))) - (ses-print-cell myrow (1- oldcol)))) ;;This inserts *skip* - (when (car last) ;Skip this for *skip* cells + (ses-print-cell myrow (1- oldcol)))) ;; This inserts *skip*. + (when (car last) ; Skip this for *skip* cells. (setq x (nth 2 last)) (unless (equal x (ses-cell-printer myrow mycol)) (or (not x) @@ -2542,12 +2829,12 @@ cons of ROW and COL). Treat plain symbols as strings unless ARG is a list." (error (cons nil from))))) (cond ((< (cdr val) (or to (length text))) - ;;Invalid sexp - leave it as a string + ;; Invalid sexp --- leave it as a string. (setq val (substring text from to))) ((and (car val) (symbolp (car val))) (if (consp arg) - (setq val (list 'quote (car val))) ;Keep symbol - (setq val (substring text from to)))) ;Treat symbol as text + (setq val (list 'quote (car val))) ; Keep symbol. + (setq val (substring text from to)))) ; Treat symbol as text. (t (setq val (car val)))) (let ((row (car rowcol)) @@ -2729,27 +3016,28 @@ The top row is row 1. Selecting row 0 displays the default header row." "Move point to last cell on line." (interactive) (ses-check-curcell 'end 'range) - (when ses--curcell ;Otherwise we're at the bottom row, which is empty anyway + (when ses--curcell ; Otherwise we're at the bottom row, which is empty + ; anyway. (let ((col (1- ses--numcols)) row rowcol) (if (symbolp ses--curcell) - ;;Single cell + ;; Single cell. (setq row (car (ses-sym-rowcol ses--curcell))) - ;;Range - use whichever end of the range the point is at + ;; Range --- use whichever end of the range the point is at. (setq rowcol (ses-sym-rowcol (if (< (point) (mark)) (car ses--curcell) (cdr ses--curcell)))) - ;;If range already includes the last cell in a row, point is actually - ;;in the following row + ;; If range already includes the last cell in a row, point is actually + ;; in the following row. (if (<= (cdr rowcol) (1- col)) (setq row (car rowcol)) (setq row (1+ (car rowcol))) (if (= row ses--numrows) ;;Already at end - can't go anywhere (setq col 0)))) - (when (< row ses--numrows) ;Otherwise it's a range that includes last cell + (when (< row ses--numrows) ; Otherwise it's a range that includes last cell. (while (eq (ses-cell-value row col) '*skip*) - ;;Back to beginning of multi-column cell + ;; Back to beginning of multi-column cell. (setq col (1- col))) (ses-goto-print row col))))) @@ -2801,7 +3089,7 @@ REVERSE order." (interactive "*e\nP") (setq event (event-end event)) (select-window (posn-window event)) - (setq event (car (posn-col-row event))) ;Click column + (setq event (car (posn-col-row event))) ; Click column. (let ((col 0)) (while (and (< col ses--numcols) (> event (ses-col-width col))) (setq event (- event (ses-col-width col) 1) @@ -2816,7 +3104,7 @@ spreadsheet." (interactive "*") (let (x) (with-current-buffer (window-buffer minibuffer-scroll-window) - (ses-command-hook) ;For ses-coverage + (ses-command-hook) ; For ses-coverage. (ses-check-curcell 'needrange) (setq x (cdr (macroexpand `(ses-range ,(car ses--curcell) ,(cdr ses--curcell)))))) @@ -2828,7 +3116,7 @@ highlighted range in the spreadsheet." (interactive "*") (let (x) (with-current-buffer (window-buffer minibuffer-scroll-window) - (ses-command-hook) ;For ses-coverage + (ses-command-hook) ; For ses-coverage. (ses-check-curcell 'needrange) (setq x (format "(ses-range %S %S)" (car ses--curcell) @@ -2885,15 +3173,128 @@ is safe or user allows execution anyway. Always returns t if ;; Standard formulas ;;---------------------------------------------------------------------------- -(defmacro ses-range (from to) - "Expands to a list of cell-symbols for the range. The range automatically -expands to include any new row or column inserted into its middle. The SES -library code specifically looks for the symbol `ses-range', so don't create an -alias for this macro!" - (let (result) +(defun ses--clean-! (&rest x) + "Clean by delq list X from any occurrence of `nil' or `*skip*'." + (delq nil (delq '*skip* x))) + +(defun ses--clean-_ (x y) + "Clean list X by replacing by Y any occurrence of `nil' or `*skip*'. + +This will change X by making setcar on its cons cells." + (let ((ret x) ret-elt) + (while ret + (setq ret-elt (car ret)) + (when (memq ret-elt '(nil *skip*)) + (setcar ret y)) + (setq ret (cdr ret)))) + x) + +(defmacro ses-range (from to &rest rest) + "Expands to a list of cell-symbols for the range going from +FROM up to TO. The range automatically expands to include any +new row or column inserted into its middle. The SES library code +specifically looks for the symbol `ses-range', so don't create an +alias for this macro! + +By passing in REST some flags one can configure the way the range +is read and how it is formatted. + +In the sequel we assume that cells A1, B1, A2 B2 have respective values +1 2 3 and 4 for examplication. + +Readout direction is specified by a `>v', '`>^', `<v', `<^', +`v>', `v<', `^>', `^<' flag. For historical reasons, in absence +of such a flag, a default direction of `^<' is assumed. This +way `(ses-range A1 B2 ^>)' will evaluate to `(1 3 2 4)', +while `(ses-range A1 B2 >^)' will evaluate to (3 4 1 2). + +If the range is one row, then `>' can be used as a shorthand to +`>v' or `>^', and `<' to `<v' or `<^'. + +If the range is one column, then `v' can be used as a shorthand to +`v>' or `v<', and `^' to `^>' or `v<'. + +A `!' flag will remove all cells whose value is nil or `*skip*'. + +A `_' flag will replace nil or `*skip*' by the value following +the `_' flag. If the `_' flag is the last argument, then they are +replaced by integer 0. + +A `*', `*1' or `*2' flag will vectorize the range in the sense of +Calc. See info node `(Calc) Top'. Flag `*' will output either a +vector or a matrix depending on the number of rows, `*1' will +flatten the result to a one row vector, and `*2' will make a +matrix whatever the number of rows. + +Warning: interaction with Calc is expermimental and may produce +confusing results if you are not aware of Calc data format. Use +`math-format-value' as a printer for Calc objects." + (let (result-row + result + (prev-row -1) + (reorient-x nil) + (reorient-y nil) + transpose vectorize + (clean 'list)) (ses-dorange (cons from to) - (push (ses-cell-symbol row col) result)) - (cons 'list result))) + (when (/= prev-row row) + (push result-row result) + (setq result-row nil)) + (push (ses-cell-symbol row col) result-row) + (setq prev-row row)) + (push result-row result) + (while rest + (let ((x (pop rest))) + (case x + ((>v) (setq transpose nil reorient-x nil reorient-y nil)) + ((>^)(setq transpose nil reorient-x nil reorient-y t)) + ((<^)(setq transpose nil reorient-x t reorient-y t)) + ((<v)(setq transpose nil reorient-x t reorient-y nil)) + ((v>)(setq transpose t reorient-x nil reorient-y t)) + ((^>)(setq transpose t reorient-x nil reorient-y nil)) + ((^<)(setq transpose t reorient-x t reorient-y nil)) + ((v<)(setq transpose t reorient-x t reorient-y t)) + ((* *2 *1) (setq vectorize x)) + ((!) (setq clean 'ses--clean-!)) + ((_) (setq clean `(lambda (&rest x) (ses--clean-_ x ,(if rest (pop rest) 0))))) + (t + (cond + ; shorthands one row + ((and (null (cddr result)) (memq x '(> <))) + (push (intern (concat (symbol-name x) "v")) rest)) + ; shorthands one col + ((and (null (cdar result)) (memq x '(v ^))) + (push (intern (concat (symbol-name x) ">")) rest)) + (t (error "Unexpected flag `%S' in ses-range" x))))))) + (if reorient-y + (setcdr (last result 2) nil) + (setq result (cdr (nreverse result)))) + (unless reorient-x + (setq result (mapcar 'nreverse result))) + (when transpose + (let ((ret (mapcar (lambda (x) (list x)) (pop result))) iter) + (while result + (setq iter ret) + (dolist (elt (pop result)) + (setcar iter (cons elt (car iter))) + (setq iter (cdr iter)))) + (setq result ret))) + + (flet ((vectorize-*1 + (clean result) + (cons clean (cons (quote 'vec) (apply 'append result)))) + (vectorize-*2 + (clean result) + (cons clean (cons (quote 'vec) (mapcar (lambda (x) + (cons clean (cons (quote 'vec) x))) + result))))) + (case vectorize + ((nil) (cons clean (apply 'append result))) + ((*1) (vectorize-*1 clean result)) + ((*2) (vectorize-*2 clean result)) + ((*) (if (cdr result) + (vectorize-*2 clean result) + (vectorize-*1 clean result))))))) (defun ses-delete-blanks (&rest args) "Return ARGS reversed, with the blank elements (nil and *skip*) removed." @@ -2940,9 +3341,9 @@ TEST is evaluated." ;; Standard print functions ;;---------------------------------------------------------------------------- -;;These functions use the variables 'row' and 'col' that are -;;dynamically bound by ses-print-cell. We define these variables at -;;compile-time to make the compiler happy. +;; These functions use the variables 'row' and 'col' that are dynamically bound +;; by ses-print-cell. We define these variables at compile-time to make the +;; compiler happy. (eval-when-compile (dolist (x '(row col)) (make-local-variable x) @@ -2960,10 +3361,10 @@ columns to include in width (default = 0)." (setq value (ses-call-printer printer value)) (dotimes (x span) (setq width (+ width 1 (ses-col-width (+ col span (- x)))))) - ;; set column width + ;; Set column width. (setq width (- width (string-width value))) (if (<= width 0) - value ;Too large for field, anyway + value ; Too large for field, anyway. (setq half (make-string (/ width 2) fill)) (concat half value half (if (> (% width 2) 0) (char-to-string fill)))))) diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 39855a1c8cc..62171328979 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -474,7 +474,8 @@ MODE should be an integer which is a file mode value." (if (and dir (not (file-exists-p dir))) (make-directory dir t)) (unless (file-directory-p name) - (write-region start end name)) + (let ((coding-system-for-write 'no-conversion)) + (write-region start end name))) (set-file-modes name (tar-header-mode descriptor)))))))) (defun tar-summarize-buffer () diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index ef51fb25035..d98aa183f21 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -213,7 +213,7 @@ (defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)")) (defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*")) (defconst css-proprietary-nmstart-re ;; Vendor-specific properties. - "[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-") + (concat "[-_]" (regexp-opt '("ms" "moz" "o" "khtml" "webkit")) "-")) (defconst css-name-re (concat css-nmchar-re "+")) (defface css-selector '((t :inherit font-lock-function-name-face)) @@ -240,7 +240,7 @@ ;; thus prevent this highlighting from being applied (actually now that ;; I use `append' this should work better). But really the part of hte ;; selector between [...] should simply not be highlighted. - (,(concat "^\\([ \t]*[^@:{\n][^:{\n]+\\(?::" (regexp-opt css-pseudo-ids t) + (,(concat "^\\([ \t]*[^@:{}\n][^:{}]+\\(?::" (regexp-opt css-pseudo-ids t) "\\(?:([^)]+)\\)?[^:{\n]*\\)*\\)\\(?:\n[ \t]*\\)*{") (1 'css-selector append)) ;; In the above rule, we allow the open-brace to be on some subsequent diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 3809b5b4293..5ec4c3998d8 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -775,6 +775,12 @@ See `run-hooks'." :type 'hook :group 'vc) +(defcustom vc-revert-show-diff t + "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying." + :type 'boolean + :group 'vc + :version "24.1") + ;; Header-insertion hair (defcustom vc-static-header-alist @@ -1534,10 +1540,13 @@ to override the value of `vc-diff-switches' and `diff-switches'." (defvar vc-diff-added-files nil "If non-nil, diff added files by comparing them to /dev/null.") -(defun vc-diff-internal (async vc-fileset rev1 rev2 &optional verbose) +(defun vc-diff-internal (async vc-fileset rev1 rev2 &optional verbose buffer) "Report diffs between two revisions of a fileset. -Diff output goes to the *vc-diff* buffer. The function -returns t if the buffer had changes, nil otherwise." +Output goes to the buffer BUFFER, which defaults to *vc-diff*. +BUFFER, if non-nil, should be a buffer or a buffer name. +Return t if the buffer had changes, nil otherwise." + (unless buffer + (setq buffer "*vc-diff*")) (let* ((files (cadr vc-fileset)) (messages (cons (format "Finding changes in %s..." (vc-delistify files)) @@ -1549,7 +1558,7 @@ returns t if the buffer had changes, nil otherwise." ;; be to call the back end separately for each file. (coding-system-for-read (if files (vc-coding-system-for-diff (car files)) 'undecided))) - (vc-setup-buffer "*vc-diff*") + (vc-setup-buffer buffer) (message "%s" (car messages)) ;; Many backends don't handle well the case of a file that has been ;; added but not yet committed to the repo (notably CVS and Subversion). @@ -1574,13 +1583,13 @@ returns t if the buffer had changes, nil otherwise." (error "No revisions of %s exist" file) ;; We regard this as "changed". ;; Diff it against /dev/null. - (apply 'vc-do-command "*vc-diff*" + (apply 'vc-do-command buffer 1 "diff" file (append (vc-switches nil 'diff) '("/dev/null")))))) (setq files (nreverse filtered)))) (let ((vc-disable-async-diff (not async))) - (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 "*vc-diff*")) - (set-buffer "*vc-diff*") + (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer)) + (set-buffer buffer) (if (and (zerop (buffer-size)) (not (get-buffer-process (current-buffer)))) ;; Treat this case specially so as not to pop the buffer. @@ -2256,11 +2265,12 @@ This asks for confirmation if the buffer contents are not identical to the working revision (except for keyword expansion)." (interactive) (let* ((vc-fileset (vc-deduce-fileset)) - (files (cadr vc-fileset))) - ;; If any of the files is visited by the current buffer, make - ;; sure buffer is saved. If the user says `no', abort since - ;; we cannot show the changes and ask for confirmation to - ;; discard them. + (files (cadr vc-fileset)) + (queried nil) + diff-buffer) + ;; If any of the files is visited by the current buffer, make sure + ;; buffer is saved. If the user says `no', abort since we cannot + ;; show the changes and ask for confirmation to discard them. (when (or (not files) (memq (buffer-file-name) files)) (vc-buffer-sync nil)) (dolist (file files) @@ -2268,20 +2278,29 @@ to the working revision (except for keyword expansion)." (when (and buf (buffer-modified-p buf)) (error "Please kill or save all modified buffers before reverting"))) (when (vc-up-to-date-p file) - (unless (yes-or-no-p (format "%s seems up-to-date. Revert anyway? " file)) + (if (yes-or-no-p (format "%s seems up-to-date. Revert anyway? " file)) + (setq queried t) (error "Revert canceled")))) - (when (vc-diff-internal vc-allow-async-revert vc-fileset nil nil) - (unless (yes-or-no-p - (format "Discard changes in %s? " - (let ((str (vc-delistify files)) - (nfiles (length files))) - (if (< (length str) 50) - str - (format "%d file%s" nfiles - (if (= nfiles 1) "" "s")))))) - (error "Revert canceled")) - (delete-windows-on "*vc-diff*") - (kill-buffer "*vc-diff*")) + (unwind-protect + (when (if vc-revert-show-diff + (progn + (setq diff-buffer (generate-new-buffer-name "*vc-diff*")) + (vc-diff-internal vc-allow-async-revert vc-fileset + nil nil nil diff-buffer)) + ;; Avoid querying the user again. + (null queried)) + (unless (yes-or-no-p + (format "Discard changes in %s? " + (let ((str (vc-delistify files)) + (nfiles (length files))) + (if (< (length str) 50) + str + (format "%d file%s" nfiles + (if (= nfiles 1) "" "s")))))) + (error "Revert canceled"))) + (when diff-buffer + (delete-windows-on diff-buffer) + (kill-buffer diff-buffer))) (dolist (file files) (message "Reverting %s..." (vc-delistify files)) (vc-revert-file file) diff --git a/lisp/window.el b/lisp/window.el index e8278bb9986..161dbb33646 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -63,25 +63,26 @@ are not altered by this macro (unless they are altered in BODY)." (when (window-live-p save-selected-window-window) (select-window save-selected-window-window 'norecord)))))) -;; The following two functions are like `window-next' and `window-prev' -;; but the WINDOW argument is _not_ optional (so they don't substitute -;; the selected window for nil), and they return nil when WINDOW doesn't -;; have a parent (like a frame's root window or a minibuffer window). +;; The following two functions are like `window-next-sibling' and +;; `window-prev-sibling' but the WINDOW argument is _not_ optional (so +;; they don't substitute the selected window for nil), and they return +;; nil when WINDOW doesn't have a parent (like a frame's root window or +;; a minibuffer window). (defsubst window-right (window) "Return WINDOW's right sibling. Return nil if WINDOW is the root window of its frame. WINDOW can be any window." - (and window (window-parent window) (window-next window))) + (and window (window-parent window) (window-next-sibling window))) (defsubst window-left (window) "Return WINDOW's left sibling. Return nil if WINDOW is the root window of its frame. WINDOW can be any window." - (and window (window-parent window) (window-prev window))) + (and window (window-parent window) (window-prev-sibling window))) (defsubst window-child (window) "Return WINDOW's first child window." - (or (window-vchild window) (window-hchild window))) + (or (window-top-child window) (window-left-child window))) (defun window-child-count (window) "Return number of WINDOW's child windows." @@ -89,14 +90,14 @@ be any window." (when (and (windowp window) (setq window (window-child window))) (while window (setq count (1+ count)) - (setq window (window-next window)))) + (setq window (window-next-sibling window)))) count)) (defun window-last-child (window) "Return last child window of WINDOW." (when (and (windowp window) (setq window (window-child window))) - (while (window-next window) - (setq window (window-next window)))) + (while (window-next-sibling window) + (setq window (window-next-sibling window)))) window) (defsubst window-any-p (object) @@ -169,7 +170,7 @@ of this variable is honored when windows are resized or split. Applications should never rebind this variable. To resize a window to a height less than the one specified here, an -application should instead call `resize-window' with a non-nil +application should instead call `window-resize' with a non-nil IGNORE argument. In order to have `split-window' make a window shorter, explictly specify the SIZE argument of that function." :type 'integer @@ -189,7 +190,7 @@ split. Applications should never rebind this variable. To resize a window to a width less than the one specified here, an -application should instead call `resize-window' with a non-nil +application should instead call `window-resize' with a non-nil IGNORE argument. In order to have `split-window' make a window narrower, explictly specify the SIZE argument of that function." :type 'integer @@ -203,8 +204,8 @@ Optional argument HORIZONTAL non-nil means return WINDOW's first child if WINDOW is a horizontal combination." (setq window (normalize-any-window window)) (if horizontal - (window-hchild window) - (window-vchild window))) + (window-left-child window) + (window-top-child window))) (defsubst window-iso-combined-p (&optional window horizontal) "Return non-nil if and only if WINDOW is vertically combined. @@ -258,9 +259,9 @@ number of horizontally arranged subwindows of WINDOW." (funcall proc walk-window-tree-window)) (unless walk-window-tree-buffer (walk-window-tree-1 - proc (window-hchild walk-window-tree-window) any) + proc (window-left-child walk-window-tree-window) any) (walk-window-tree-1 - proc (window-vchild walk-window-tree-window) any)) + proc (window-top-child walk-window-tree-window) any)) (if sub-only (setq walk-window-tree-window nil) (setq walk-window-tree-window @@ -375,8 +376,8 @@ WINDOW must be an internal window. Return WINDOW." window t))) ;; Check children. (unless (window-buffer window) - (window-atom-check-1 (window-hchild window)) - (window-atom-check-1 (window-vchild window)))) + (window-atom-check-1 (window-left-child window)) + (window-atom-check-1 (window-top-child window)))) ;; Check right sibling (window-atom-check-1 (window-right window)))) @@ -1352,7 +1353,7 @@ meaning of this argument." (length (window-list-1 nil minibuf))) ;;; Resizing windows. -(defun resize-window-reset (&optional frame horizontal) +(defun window-resize-reset (&optional frame horizontal) "Reset resize values for all windows on FRAME. FRAME defaults to the selected frame. @@ -1360,19 +1361,19 @@ This function stores the current value of `window-total-size' applied with argument HORIZONTAL in the new total size of all windows on FRAME. It also resets the new normal size of each of these windows." - (resize-window-reset-1 + (window-resize-reset-1 (frame-root-window (normalize-live-frame frame)) horizontal)) -(defun resize-window-reset-1 (window horizontal) - "Internal function of `resize-window-reset'." +(defun window-resize-reset-1 (window horizontal) + "Internal function of `window-resize-reset'." ;; Register old size in the new total size. (set-window-new-total window (window-total-size window horizontal)) ;; Reset new normal size. (set-window-new-normal window) (when (window-child window) - (resize-window-reset-1 (window-child window) horizontal)) + (window-resize-reset-1 (window-child window) horizontal)) (when (window-right window) - (resize-window-reset-1 (window-right window) horizontal))) + (window-resize-reset-1 (window-right window) horizontal))) ;; The following routine is used to manually resize the minibuffer ;; window and is currently used, for example, by ispell.el. @@ -1395,7 +1396,7 @@ as small) as possible but don't signal an error." (setq delta min-delta))) ;; Resize now. - (resize-window-reset frame) + (window-resize-reset frame) ;; Ideally we should be able to resize just the last subwindow of ;; root here. See the comment in `resize-root-window-vertically' ;; for why we do not do that. @@ -1405,7 +1406,7 @@ as small) as possible but don't signal an error." ;; a minibuffer-only frame. (resize-mini-window-internal window)))) -(defun resize-window (window delta &optional horizontal ignore) +(defun window-resize (window delta &optional horizontal ignore) "Resize WINDOW vertically by DELTA lines. WINDOW can be an arbitrary window and defaults to the selected one. An attempt to resize the root window of a frame will raise @@ -1440,7 +1441,7 @@ instead." ((window-minibuffer-p window) (resize-mini-window window delta)) ((window-resizable-p window delta horizontal ignore) - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) (resize-this-window window delta horizontal ignore t) (if (and (not (window-splits window)) (window-iso-combined-p window horizontal) @@ -1461,7 +1462,7 @@ instead." normal-delta))) ;; Otherwise, resize all other windows in the same combination. (resize-other-windows window delta horizontal ignore)) - (resize-window-apply frame horizontal)) + (window-resize-apply frame horizontal)) (t (error "Cannot resize window %s" window))))) @@ -1725,7 +1726,7 @@ already set by this routine." (while sub (when (or (consp (window-new-normal sub)) (numberp (window-new-normal sub))) - ;; Reset new normal size fields so `resize-window-apply' + ;; Reset new normal size fields so `window-resize-apply' ;; won't use them to apply new sizes. (set-window-new-normal sub)) @@ -1866,7 +1867,7 @@ This function recursively resizes WINDOW's subwindows to fit the new size. Make sure that WINDOW is `window-resizable' before calling this function. Note that this function does not resize siblings of WINDOW or WINDOW's parent window. You have to -eventually call `resize-window-apply' in order to make resizing +eventually call `window-resize-apply' in order to make resizing actually take effect." (when add ;; Add DELTA to the new total size of WINDOW. @@ -1897,7 +1898,7 @@ This function is only called by the frame resizing routines. It resizes windows proportionally and never deletes any windows." (when (and (windowp window) (numberp delta) (window-sizable-p window delta horizontal ignore)) - (resize-window-reset (window-frame window) horizontal) + (window-resize-reset (window-frame window) horizontal) (resize-this-window window delta horizontal ignore t))) (defun resize-root-window-vertically (window delta) @@ -1921,7 +1922,7 @@ any windows." (unless (window-sizable window delta) (setq ignore t)))) - (resize-window-reset (window-frame window)) + (window-resize-reset (window-frame window)) ;; Ideally, we would resize just the last window in a combination ;; but that's not feasible for the following reason: If we grow ;; the minibuffer window and the last window cannot be shrunk any @@ -1999,7 +2000,7 @@ move it as far as possible in the desired direction." (setq delta (min max-delta (- min-delta)))) (unless (zerop delta) ;; Start resizing. - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) ;; Try to enlarge LEFT first. (setq this-delta (window-resizable left delta horizontal)) (unless (zerop this-delta) @@ -2022,7 +2023,7 @@ move it as far as possible in the desired direction." (setq delta (max (- max-delta) min-delta))) (unless (zerop delta) ;; Start resizing. - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) ;; Try to enlarge RIGHT. (setq this-delta (window-resizable right (- delta) horizontal)) (unless (zerop this-delta) @@ -2039,7 +2040,7 @@ move it as far as possible in the desired direction." (+ (window-top-line left) (window-total-size left))))))) (unless (zerop delta) ;; Don't report an error in the standard case. - (unless (resize-window-apply frame horizontal) + (unless (window-resize-apply frame horizontal) ;; But do report an error if applying the changes fails. (error "Failed adjusting window %s" window))))))) @@ -2056,9 +2057,9 @@ Return nil." ((window-size-fixed-p nil horizontal) (error "Selected window has fixed size")) ((window-resizable-p nil delta horizontal) - (resize-window nil delta horizontal)) + (window-resize nil delta horizontal)) (t - (resize-window + (window-resize nil (if (> delta 0) (window-max-delta nil horizontal) (- (window-min-delta nil horizontal))) @@ -2077,9 +2078,9 @@ Return nil." ((window-size-fixed-p nil horizontal) (error "Selected window has fixed size")) ((window-resizable-p nil (- delta) horizontal) - (resize-window nil (- delta) horizontal)) + (window-resize nil (- delta) horizontal)) (t - (resize-window + (window-resize nil (if (> delta 0) (- (window-min-delta nil horizontal)) (window-max-delta nil horizontal)) @@ -2091,8 +2092,8 @@ Make WINDOW as large as possible without deleting any windows. WINDOW can be any window and defaults to the selected window." (interactive) (setq window (normalize-any-window window)) - (resize-window window (window-max-delta window)) - (resize-window window (window-max-delta window t) t)) + (window-resize window (window-max-delta window)) + (window-resize window (window-max-delta window t) t)) (defun minimize-window (&optional window) "Minimize WINDOW. @@ -2100,8 +2101,8 @@ Make WINDOW as small as possible without deleting any windows. WINDOW can be any window and defaults to the selected window." (interactive) (setq window (normalize-any-window window)) - (resize-window window (- (window-min-delta window))) - (resize-window window (- (window-min-delta window t)) t)) + (window-resize window (- (window-min-delta window))) + (window-resize window (- (window-min-delta window t)) t)) (defsubst frame-root-window-p (window) "Return non-nil if WINDOW is the root window of its frame." @@ -2119,15 +2120,15 @@ return value." (setq list (cons (cond - ((window-vchild window) + ((window-top-child window) (cons t (cons (window-edges window) - (window-tree-1 (window-vchild window) t)))) - ((window-hchild window) + (window-tree-1 (window-top-child window) t)))) + ((window-left-child window) (cons nil (cons (window-edges window) - (window-tree-1 (window-hchild window) t)))) + (window-tree-1 (window-left-child window) t)))) (t window)) list)) - (setq window (when next (window-next window)))) + (setq window (when next (window-next-sibling window)))) (nreverse list))) (defun window-tree (&optional frame) @@ -2363,14 +2364,14 @@ non-side window, signal an error." ((not parent) (error "Attempt to delete minibuffer or sole ordinary window"))) - (let* ((horizontal (window-hchild parent)) + (let* ((horizontal (window-left-child parent)) (size (window-total-size window horizontal)) (frame-selected (window-or-subwindow-p (frame-selected-window frame) window)) ;; Emacs 23 preferably gives WINDOW's space to its left ;; sibling. (sibling (or (window-left window) (window-right window)))) - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) (cond ((and (not (window-splits window)) sibling (window-sizable-p sibling size)) @@ -2944,7 +2945,7 @@ buffer list. Interactively, KILL is the prefix argument." (set-window-start window (nth 1 quit-restore)) (set-window-point window (nth 2 quit-restore)) (when (and resize (/= (nth 4 quit-restore) (window-total-size window))) - (resize-window + (window-resize window (- (nth 4 quit-restore) (window-total-size window)))) ;; Reset the quit-restore parameter. (set-window-parameter window 'quit-restore nil) @@ -3140,7 +3141,7 @@ frame. The selected window is not changed by this function." ;; SIZE specification violates minimum size restrictions. (error "Window %s too small for splitting" window))) - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) (setq new-parent ;; Make new-parent non-nil if we need a new parent window; @@ -3395,13 +3396,13 @@ window." (error "Not a window or frame %s" window-or-frame)))) (frame (window-frame window))) ;; Balance vertically. - (resize-window-reset (window-frame window)) + (window-resize-reset (window-frame window)) (balance-windows-1 window) - (resize-window-apply frame) + (window-resize-apply frame) ;; Balance horizontally. - (resize-window-reset (window-frame window) t) + (window-resize-reset (window-frame window) t) (balance-windows-1 window t) - (resize-window-apply frame t))) + (window-resize-apply frame t))) (defun window-fixed-size-p (&optional window direction) "Return t if WINDOW cannot be resized in DIRECTION. @@ -3421,13 +3422,13 @@ Changing this globally has no effect.") (make-variable-buffer-local 'window-area-factor) (defun balance-windows-area-adjust (window delta horizontal) - "Wrapper around `resize-window' with error checking. + "Wrapper around `window-resize' with error checking. Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function." - ;; `resize-window' may fail if delta is too large. + ;; `window-resize' may fail if delta is too large. (while (>= (abs delta) 1) (condition-case nil (progn - (resize-window window delta horizontal) + (window-resize window delta horizontal) (setq delta 0)) (error ;;(message "adjust: %s" (error-message-string err)) @@ -3495,7 +3496,7 @@ specific buffers." ;; become significant. (setq carry (+ carry areadiff)) ;; This used `adjust-window-trailing-edge' before and uses - ;; `resize-window' now. Error wrapping is still needed. + ;; `window-resize' now. Error wrapping is still needed. (balance-windows-area-adjust win diff horiz) ;; (sit-for 0.5) (let ((change (cons win (window-edges win)))) @@ -3524,15 +3525,15 @@ specific buffers." "Helper function for `window-state-get'." (let* ((type (cond - ((window-vchild window) 'vc) - ((window-hchild window) 'hc) + ((window-top-child window) 'vc) + ((window-left-child window) 'hc) (t 'leaf))) (buffer (window-buffer window)) (selected (eq window (selected-window))) (head (window-list-no-nils type - (unless (window-next window) (cons 'last t)) + (unless (window-next-sibling window) (cons 'last t)) (cons 'clone-number (window-clone-number window)) (cons 'total-height (window-total-size window)) (cons 'total-width (window-total-size window t)) @@ -3720,13 +3721,13 @@ value can be also stored on disk and read back in a new session." (window-total-height window))) window-size-fixed) (when (window-resizable-p window delta) - (resize-window window delta))) + (window-resize window delta))) ;; Else check whether the window is not high enough. (let* ((min-size (window-min-size window nil ignore)) (delta (- min-size (window-total-size window)))) (when (and (> delta 0) (window-resizable-p window delta nil ignore)) - (resize-window window delta nil ignore)))) + (window-resize window delta nil ignore)))) ;; Adjust horizontally. (if (memq window-size-fixed '(t width)) ;; A fixed width window, try to restore the original size. @@ -3734,13 +3735,13 @@ value can be also stored on disk and read back in a new session." (window-total-width window))) window-size-fixed) (when (window-resizable-p window delta) - (resize-window window delta))) + (window-resize window delta))) ;; Else check whether the window is not wide enough. (let* ((min-size (window-min-size window t ignore)) (delta (- min-size (window-total-size window t)))) (when (and (> delta 0) (window-resizable-p window delta t ignore)) - (resize-window window delta t ignore)))) + (window-resize window delta t ignore)))) ;; Set dedicated status. (set-window-dedicated-p window (cdr (assq 'dedicated state))) ;; Install positions (maybe we should do this after all windows @@ -4091,7 +4092,7 @@ A list whose car is the symbol `fun-with-args' specifies that the function specified in the second element of the list is responsible for displaying the buffer. `display-buffer' calls this function with the buffer as first argument and the remaining -elements of the list as second argument. +elements of the list as the other arguments. The function should choose or create a window, display the buffer in it, and return the window. It is also responsible for giving @@ -4182,7 +4183,7 @@ using the location specifiers `same-window' or `other-frame'." :tag "Label" :format "%v" :help-echo "A symbol equalling the buffer display label." - (const :format "" symbol) + (const :format "" label) (symbol :format "Label: %v\n" :size 32)))) ;; Display specifiers. @@ -4225,9 +4226,9 @@ using the location specifiers `same-window' or `other-frame'." :help-echo "Window to reuse." :value nil :format "%[Window%] %v" :size 15 - (const :tag "Any" :format "%t" nil) - (const :tag "Selected only" :format "%t" same) - (const :tag "Any but selected" :format "%t" other)) + (const :tag "Any window" :format "%t" nil) + (const :tag "Same window" :format "%t" same) + (const :tag "Other window" :format "%t" other)) ;; The window's buffer. (choice :tag "Buffer" @@ -4239,15 +4240,15 @@ using the location specifiers `same-window' or `other-frame'." (const :tag "Other buffer" :format "%t" other)) ;; The window's frame. (choice - :help-echo "Frame to search for a window to reuse." + :help-echo "Frames to search for a window to reuse." :tag "Frame" :value nil :format " %[Frame%] %v" :size 15 - (const :tag "Selected frame only" :format "%t" nil) + (const :tag "Same frame only" :format "%t" nil) (const :tag "Visible frames" :format "%t" visible) - (const :tag "Visible but unselected" :format "%t" other) - (const :tag "Visible and iconified" :format "%t" 0) - (const :tag "Any frame" :format "%t" t))) + (const :tag "Any other visible frame" :format "%t" other) + (const :tag "Visible and iconified frames" :format "%t" 0) + (const :tag "All frames" :format "%t" t))) ;; Whether window sizes should be evened out. (cons :format "%v\n" @@ -4537,7 +4538,12 @@ using the location specifiers `same-window' or `other-frame'." ;; Macro specifiers. (list - :tag "Same frame only" + :tag "Same window" + :format "%t%v" + :inline t + (const :format "\n" same-window)) + (list + :tag "Same frame" :format "%t%v" :inline t (const :format "\n" same-frame)) @@ -4552,7 +4558,7 @@ using the location specifiers `same-window' or `other-frame'." :inline t (const :format "\n" same-frame-other-window)) (list - :tag "Other frame only" + :tag "Other frame" :format "%t%v" :inline t (const :format "\n" other-frame)) @@ -4590,9 +4596,9 @@ using the location specifiers `same-window' or `other-frame'." (const :format "" other-window-means-other-frame) (choice :help-echo "Whether other window means same or other frame." - :format "%[Same or other frame%] %v\n" :size 15 - (const :tag "Same frame" :format "%t" nil) - (const :tag "Other frame" :format "%t" t))) + :format "%[Other window means other frame%] %v\n" :size 15 + (const :tag "Off" :format "%t" nil) + (const :tag "On" :format "%t" t))) ;; Overriding. (cons :format "%v\n" @@ -4661,8 +4667,8 @@ larger than WINDOW." ;; Don't resize minibuffer windows. (window-minibuffer-p) ;; WINDOW must be adjacent to the selected one. - (not (or (eq window (window-prev)) - (eq window (window-next)))))) + (not (or (eq window (window-prev-sibling)) + (eq window (window-next-sibling)))))) ((and (window-iso-combined-p window) ;; Resize iff the selected window is higher than WINDOW. (> (window-total-height) (window-total-height window))) @@ -4672,7 +4678,7 @@ larger than WINDOW." ;; WINDOW and the selected one. But for a simple two windows ;; configuration the present behavior is good enough so why care? (ignore-errors - (resize-window + (window-resize window (/ (- (window-total-height) (window-total-height window)) 2)))) ((and (window-iso-combined-p window t) @@ -4681,7 +4687,7 @@ larger than WINDOW." ;; Don't throw an error if we can't even window widths, see ;; comment above. (ignore-errors - (resize-window + (window-resize window (/ (- (window-total-width) (window-total-width window)) 2) t))))) @@ -4700,7 +4706,7 @@ documentation of `display-buffer-alist' for a description." (delta (- height (window-total-size window)))) (when (and (window-resizable-p window delta nil 'safe) (window-iso-combined-p window)) - (resize-window window delta nil 'safe)))) + (window-resize window delta nil 'safe)))) ((functionp set-height) (ignore-errors (funcall set-height window)))))) @@ -4719,7 +4725,7 @@ documentation of `display-buffer-alist' for a description." (delta (- width (window-total-size window t)))) (when (and (window-resizable-p window delta t 'safe) (window-iso-combined-p window t)) - (resize-window window delta t 'safe)))) + (window-resize window delta t 'safe)))) ((functionp set-width) (ignore-errors (funcall set-width window)))))) @@ -4737,7 +4743,9 @@ documentation of `display-buffer-alist' for a description." (dedicated (cdr (assq 'dedicated specifiers))) (no-other-window (cdr (assq 'no-other-window specifiers)))) ;; Show BUFFER in WINDOW. - (set-window-dedicated-p window nil) + (unless (eq buffer (window-buffer window)) + ;; If we show another buffer in WINDOW, undedicate it first. + (set-window-dedicated-p window nil)) (set-window-buffer window buffer) (when dedicated (set-window-dedicated-p window dedicated)) @@ -4773,7 +4781,7 @@ none was found." (let* ((method-window (nth 0 method)) (method-buffer (nth 1 method)) (method-frame (nth 2 method)) - (reuse-dedicated (assq 'reuse-window-dedicated specifiers)) + (reuse-dedicated (cdr (assq 'reuse-window-dedicated specifiers))) windows other-frame dedicated time best-window best-time) (when (eq method-frame 'other) ;; `other' is not handled by `window-list-1'. @@ -5164,6 +5172,7 @@ SPECIFIERS must be a list of buffer display specifiers." ;; `major' is the major window on SIDE, `windows' the life ;; windows on SIDE. (windows (when major (windows-with-parameter 'window-side side))) + (reuse-dedicated (cdr (assq 'reuse-window-dedicated specifiers))) (slots (when major (window-child-count major))) (max-slots (nth (cond @@ -5174,7 +5183,7 @@ SPECIFIERS must be a list of buffer display specifiers." window-sides-slots)) (selected-window (selected-window)) window this-window this-slot prev-window next-window - best-window best-slot abs-slot) + best-window best-slot abs-slot dedicated) (unless (numberp slot) (setq slot 0)) @@ -5189,8 +5198,13 @@ SPECIFIERS must be a list of buffer display specifiers." ((not (numberp this-slot))) ((and (= this-slot slot) ;; Dedicatedness check. - (or (not (window-dedicated-p window)) - (assq 'reuse-window-dedicated specifiers))) + (or (not (setq dedicated (window-dedicated-p window))) + ;; If the window is weakly dedicated to its + ;; buffer, reuse-dedicated must be non-nil. + (and (not (eq dedicated t)) reuse-dedicated) + ;; If the window is strongly dedicated to its + ;; buffer, reuse-dedicated must be t. + (eq reuse-dedicated t))) ;; Window with matching SLOT, use it. (setq this-window window) (throw 'found t)) @@ -5305,48 +5319,73 @@ user preferences expressed in `display-buffer-alist'." (or (car list) (cdr list))))) (when value (cdr value)))) -(defun display-buffer-normalize-argument (buffer-name specifiers label other-frame) - "Normalize second argument of `display-buffer'. +(defun display-buffer-normalize-arguments (buffer-name specifiers label other-frame) + "Normalize second and third argument of `display-buffer'. BUFFER-NAME is the name of the buffer that shall be displayed, -SPECIFIERS is the second argument of `display-buffer'. LABEL the -same argument of `display-buffer'. OTHER-FRAME non-nil means use -other-frame for other-window." - (let (normalized entry) +SPECIFIERS is the second argument of `display-buffer'. LABEL is +the same argument of `display-buffer'. OTHER-FRAME non-nil means +use other-frame for other-window." + (let (normalized entry specifier pars) + (setq specifier + (cond + ((not specifiers) + nil) + ((listp specifiers) + ;; If SPECIFIERS is a list, we assume it is a list of specifiers. + (dolist (specifier specifiers) + (cond + ((consp specifier) + (setq normalized (cons specifier normalized))) + ((eq specifier 'other-window) + ;; `other-window' must be treated separately. + (let ((entry (assq (if other-frame + 'other-frame + 'same-frame-other-window) + display-buffer-macro-specifiers))) + (dolist (item (cdr entry)) + (setq normalized (cons item normalized))))) + ((symbolp specifier) + ;; Might be a macro specifier, try to expand it (the cdr is a + ;; list and we have to reverse it later, so do it one at a + ;; time). + (let ((entry (assq specifier display-buffer-macro-specifiers))) + (dolist (item (cdr entry)) + (setq normalized (cons item normalized))))))) + ;; Reverse list. + (nreverse normalized)) + ((setq entry (assq specifiers display-buffer-macro-specifiers)) + ;; A macro specifier. + (cdr entry)) + ((or other-frame (with-no-warnings pop-up-frames)) + ;; `special-display-p' group. + (if (and (with-no-warnings special-display-function) + ;; `special-display-p' returns either t or a list + ;; of frame parameters to pass to + ;; `special-display-function'. + (setq pars (with-no-warnings + (special-display-p buffer-name)))) + (list (list 'fun-with-args + (with-no-warnings special-display-function) + (when (listp pars) pars))) + ;; Pop up another frame. + (cddr (assq 'other-frame display-buffer-macro-specifiers)))) + (t + ;; In any other case pop up a new window. + (cdr (assq 'same-frame-other-window + display-buffer-macro-specifiers))))) + + ;; Handle the old meaning of the LABEL argument of `display-buffer'. (cond - ((not specifiers) - nil) - ((listp specifiers) - ;; If SPECIFIERS is a list, we assume it is a list of specifiers. - (dolist (specifier specifiers) - (cond - ((consp specifier) - (setq normalized (cons specifier normalized))) - ((eq specifier 'other-window) - ;; `other-window' must be treated separately. - (let ((entry (assq (if other-frame - 'other-frame - 'same-frame-other-window) - display-buffer-macro-specifiers))) - (dolist (item (cdr entry)) - (setq normalized (cons item normalized))))) - ((symbolp specifier) - ;; Might be a macro specifier, try to expand it (the cdr is a - ;; list and we have to reverse it later, so do it one at a - ;; time). - (let ((entry (assq specifier display-buffer-macro-specifiers))) - (dolist (item (cdr entry)) - (setq normalized (cons item normalized))))))) - ;; Reverse list. - (nreverse normalized)) - ((setq entry (assq specifiers display-buffer-macro-specifiers)) - ;; A macro specifier. - (cdr entry)) - ((or other-frame (with-no-warnings pop-up-frames)) - ;; Pop up another frame. - (cdr (assq 'other-frame display-buffer-macro-specifiers))) + ((or (memq label '(visible 0 t)) (frame-live-p label)) + ;; LABEL must be one of visible (and visible frame), 0 (any + ;; visible or iconfied frame), t (any frame), or a live frame. + (cons `(reuse-window nil same ,label) specifier)) + ((or other-frame + (with-no-warnings pop-up-frames) + (with-no-warnings display-buffer-reuse-frames)) + (cons '(reuse-window nil same 0) specifier)) (t - ;; In any other case pop up a new window. - (cdr (assq 'same-frame-other-window display-buffer-macro-specifiers)))))) + specifier)))) (defun display-buffer-normalize-options (buffer-or-name) "Subroutine of `display-buffer-normalize-specifiers'. @@ -5517,7 +5556,7 @@ LABEL the corresponding argument of `display-buffer'." (let* ((specifiers (cdr entry)) (normalized (display-buffer-normalize-alist-1 specifiers label))) - (if (assq 'override specifiers) + (if (cdr (assq 'override specifiers)) (setq list-1 (if list-1 (append list-1 normalized) @@ -5554,13 +5593,13 @@ specifiers: - `display-buffer-default-specifiers'." (let* ((list (display-buffer-normalize-alist buffer-name label)) - (other-frame (assq 'other-window-means-other-frame - (or (car list) (cdr list))))) + (other-frame (cdr (assq 'other-window-means-other-frame + (or (car list) (cdr list)))))) (append ;; Overriding user specifiers. (car list) ;; Application specifiers. - (display-buffer-normalize-argument + (display-buffer-normalize-arguments buffer-name specifiers label other-frame) ;; Emacs 23 compatibility specifiers. (unless display-buffer-normalize-options-inhibit @@ -5623,6 +5662,21 @@ override SPECIFIERS by adding an entry to `display-buffer-alist' whose car contains LABEL and whose cdr specifies the preferred alternative display method. +The following values of LABEL have a special meaning and allow to +specify the set of frames to investigate when the buffer already +appears in a window: + +`visible' - the set of visible frames. + +0 - the set of visible or iconified frames. + +t - the set of all frames. + +A live frame - the set containing that frame as its only element. + +If the buffer is already displayed in a window on a frame in the +specified set, return that window. + The method to display the buffer is derived by combining the values of `display-buffer-alist' and SPECIFIERS. Highest priority is given to overriding elements of @@ -5669,19 +5723,19 @@ this list as arguments." (display-buffer-in-side-window buffer (nth 1 specifier) (nth 2 specifier) normalized)) ((eq method 'fun-with-args) - (apply (cadr specifier) buffer (cddr specifier)))))) + (apply (nth 1 specifier) buffer (nth 2 specifier)))))) ;; If we don't have a window yet, try a fallback method. All ;; specifiers have been used up by now. (or (and (window-live-p window) window) ;; Try reusing a window showing BUFFER on any visible or ;; iconfied frame. - (display-buffer-reuse-window buffer '(nil buffer 0)) + (display-buffer-reuse-window buffer `(nil ,buffer 0)) ;; Try reusing a window not showing BUFFER on any visible or ;; iconified frame. (display-buffer-reuse-window buffer '(nil other 0)) - ;; Try making a new frame. - (display-buffer-pop-up-frame buffer) + ;; Eli says it's better to never try making a new frame. + ;; (display-buffer-pop-up-frame buffer) ;; Try using a weakly dedicated window. (display-buffer-reuse-window buffer '(nil nil t) '((reuse-window-dedicated . weak))) @@ -6726,7 +6780,7 @@ value of `display-buffer-alist'." (when (or display-buffer-reuse-frames pop-up-frames) ;; "0" (all visible and iconified frames) is hardcoded in ;; Emacs 23. - 0)) + 0)) (unless (memq even-window-heights '(nil unset)) (cons 'reuse-window-even-sizes t))) no-custom) @@ -6759,7 +6813,7 @@ where some error may be present." ;; windows 1-line tall, which means that there's no more space for ;; the modeline. (let ((window-min-height (min 2 height))) ; One text line plus a modeline. - (resize-window window delta))))) + (window-resize window delta))))) (defun enlarge-window-horizontally (delta) "Make selected window DELTA columns wider. @@ -6902,8 +6956,8 @@ WINDOW was scrolled." ;; It's silly to put `point' at the end of the previous ;; line and so maybe force horizontal scrolling. (set-window-point window (line-beginning-position 0))) - ;; Call `resize-window' with OVERRIDE argument equal WINDOW. - (resize-window window delta nil window) + ;; Call `window-resize' with OVERRIDE argument equal WINDOW. + (window-resize window delta nil window) ;; Check if the last line is surely fully visible. If ;; not, enlarge the window. (let ((end (save-excursion @@ -6926,7 +6980,7 @@ WINDOW was scrolled." (while (and (< desired-height max-height) (= desired-height (window-total-size)) (not (pos-visible-in-window-p end))) - (resize-window window 1 nil window) + (window-resize window 1 nil window) (setq desired-height (1+ desired-height))))) (error (setq delta nil))) delta)))) diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index c8435eb562f..7e332a9fd5d 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,8 @@ +2011-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (ALL_CFLAGS): Add -I../lib for generated header files + in out-of-tree build. + 2011-06-06 Paul Eggert <eggert@cs.ucla.edu> * Makefile.in (ALL_CFLAGS): Add -I$(srcdir)/../lib. diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index fe6bbc31282..1193cee4110 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in @@ -56,7 +56,7 @@ ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(C_SWITCH_X_SYSTEM) $(C_SWITCH_MACHINE) \ $(C_WARNINGS_SWITCH) $(PROFILING_CFLAGS) $(CFLAGS) \ -DHAVE_CONFIG_H -Demacs -I../src \ - -I$(srcdir) -I$(srcdir)/../src -I$(srcdir)/../lib + -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib .c.o: $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< diff --git a/src/ChangeLog b/src/ChangeLog index f664f449d3b..d52ff5da280 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,67 @@ +2011-06-28 Paul Eggert <eggert@cs.ucla.edu> + + * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var. + +2011-06-27 Juanma Barranquero <lekktu@gmail.com> + + * makefile.w32-in: Redesign dependencies so they reflect more + clearly which files are directly included by each source file, + and not through other includes. + +2011-06-27 Martin Rudalics <rudalics@gmx.at> + + * buffer.c (Qclone_number): Declare static and DEFSYM it. + (sort_overlays, overlay_strings): When an overlay's clone number + matches the window's clone number process the overlay even if + the overlay's window property doesn't match the current window. + + * window.c (Fwindow_vchild): Rename to Fwindow_top_child. + (Fwindow_hchild): Rename to Fwindow_left_child. + (Fwindow_next): Rename to Fwindow_next_sibling. + (Fwindow_prev): Rename to Fwindow_prev_sibling. + (resize_window_check): Rename to window_resize_check. + (resize_window_apply): Rename to window_resize_apply. + (Fresize_window_apply): Rename to Fwindow_resize_apply. + (Fdelete_other_windows_internal, resize_frame_windows) + (Fsplit_window_internal, Fdelete_window_internal) + (grow_mini_window, shrink_mini_window) + (Fresize_mini_window_internal): Fix callers accordingly. + +2011-06-26 Jan Djärv <jan.h.d@swipnet.se> + + * emacsgtkfixed.h: State that this is only used with Gtk+3. + (emacs_fixed_set_min_size): Remove. + (emacs_fixed_new): Take frame as argument. + + * emacsgtkfixed.c: State that this is only used with Gtk+3. + (_EmacsFixedPrivate): Remove minwidth/height. + Add struct frame *f. + (emacs_fixed_init): Initialize priv->f. + (get_parent_class, emacs_fixed_set_min_size): Remove. + (emacs_fixed_new): Set priv->f to argument. + (emacs_fixed_get_preferred_width) + (emacs_fixed_get_preferred_height): Use min_width/height from + frames size_hint to set minimum and natural (Bug#8919). + (XSetWMSizeHints, XSetWMNormalHints): Override these functions + and use min_width/height from frames size_hint to set + min_width/height (Bug#8919). + + * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new. + (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size. Fix + indentation. + +2011-06-26 Eli Zaretskii <eliz@gnu.org> + + * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling + bidi_at_paragraph_end, since fast_looking_at doesn't like to be + called at ZV. + +2011-06-26 Chong Yidong <cyd@stupidchicken.com> + + * process.c (wait_reading_process_output): Bypass select if + waiting for a cell while ignoring keyboard input, and input is + pending. Suggested by Jan Djärv (Bug#8869). + 2011-06-25 Paul Eggert <eggert@cs.ucla.edu> Use gnulib's dup2 module instead of rolling our own. @@ -351,7 +415,7 @@ 2011-06-22 Jim Meyering <meyering@redhat.com> - don't leak an XBM-image-sized buffer + Don't leak an XBM-image-sized buffer * image.c (xbm_load): Free the image buffer after using it. 2011-06-21 Paul Eggert <eggert@cs.ucla.edu> diff --git a/src/bidi.c b/src/bidi.c index 1f3b196d5a4..469afdb3819 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -744,8 +744,6 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) || type == LRE || type == LRO)); type = bidi_get_type (ch, NEUTRAL_DIR)) { - if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1) - break; if (bytepos >= ZV_BYTE) { /* Pretend there's a paragraph separator at end of @@ -753,6 +751,8 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) type = NEUTRAL_B; break; } + if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1) + break; /* Fetch next character and advance to get past it. */ ch = bidi_fetch_char (bytepos, pos, &disp_pos, bidi_it->frame_window_p, &ch_len, &nchars); diff --git a/src/buffer.c b/src/buffer.c index 006153b0424..328963be78c 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -146,7 +146,7 @@ static Lisp_Object Qoverlayp; Lisp_Object Qpriority, Qbefore_string, Qafter_string; -static Lisp_Object Qevaporate; +static Lisp_Object Qclone_number, Qevaporate; Lisp_Object Qmodification_hooks; Lisp_Object Qinsert_in_front_hooks; @@ -2900,10 +2900,13 @@ sort_overlays (Lisp_Object *overlay_vec, ptrdiff_t noverlays, struct window *w) overlays that are limited to some other window. */ if (w) { - Lisp_Object window; + Lisp_Object window, clone_number; window = Foverlay_get (overlay, Qwindow); - if (WINDOWP (window) && XWINDOW (window) != w) + clone_number = Foverlay_get (overlay, Qclone_number); + if (WINDOWP (window) && XWINDOW (window) != w + && (! NUMBERP (clone_number) + || XFASTINT (clone_number) != XFASTINT (w->clone_number))) continue; } @@ -3032,7 +3035,7 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, EMACS_INT overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) { - Lisp_Object overlay, window, str; + Lisp_Object overlay, window, clone_number, str; struct Lisp_Overlay *ov; EMACS_INT startpos, endpos; int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); @@ -3051,8 +3054,12 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) if (endpos != pos && startpos != pos) continue; window = Foverlay_get (overlay, Qwindow); - if (WINDOWP (window) && XWINDOW (window) != w) + clone_number = Foverlay_get (overlay, Qclone_number); + if (WINDOWP (window) && XWINDOW (window) != w + && (! NUMBERP (clone_number) + || XFASTINT (clone_number) != XFASTINT (w->clone_number))) continue; + if (startpos == pos && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))) record_overlay_string (&overlay_heads, str, @@ -3079,7 +3086,10 @@ overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr) if (endpos != pos && startpos != pos) continue; window = Foverlay_get (overlay, Qwindow); - if (WINDOWP (window) && XWINDOW (window) != w) + clone_number = Foverlay_get (overlay, Qclone_number); + if (WINDOWP (window) && XWINDOW (window) != w + && (! NUMBERP (clone_number) + || XFASTINT (clone_number) != XFASTINT (w->clone_number))) continue; if (startpos == pos && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str))) @@ -5219,6 +5229,7 @@ syms_of_buffer (void) DEFSYM (Qinsert_behind_hooks, "insert-behind-hooks"); DEFSYM (Qget_file_buffer, "get-file-buffer"); DEFSYM (Qpriority, "priority"); + DEFSYM (Qclone_number, "clone-number"); DEFSYM (Qbefore_string, "before-string"); DEFSYM (Qafter_string, "after-string"); DEFSYM (Qfirst_change_hook, "first-change-hook"); diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index fe3514bce93..0b57e2cdf36 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -1,4 +1,5 @@ /* A Gtk Widget that inherits GtkFixed, but can be shrinked. +This file is only use when compiling with Gtk+ 3. Copyright (C) 2011 Free Software Foundation, Inc. @@ -17,12 +18,19 @@ 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 <http://www.gnu.org/licenses/>. */ -#include "emacsgtkfixed.h" +#include <config.h> +#include "emacsgtkfixed.h" +#include <signal.h> +#include <stdio.h> +#include <setjmp.h> +#include "lisp.h" +#include "frame.h" +#include "xterm.h" struct _EmacsFixedPrivate { - int minwidth, minheight; + struct frame *f; }; @@ -59,7 +67,7 @@ emacs_fixed_init (EmacsFixed *fixed) { fixed->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixed, EMACS_TYPE_FIXED, EmacsFixedPrivate); - fixed->priv->minwidth = fixed->priv->minheight = 0; + fixed->priv->f = 0; } /** @@ -70,17 +78,12 @@ emacs_fixed_init (EmacsFixed *fixed) * Returns: a new #EmacsFixed. */ GtkWidget* -emacs_fixed_new (void) -{ - return g_object_new (EMACS_TYPE_FIXED, NULL); -} - -static GtkWidgetClass * -get_parent_class (EmacsFixed *fixed) +emacs_fixed_new (struct frame *f) { - EmacsFixedClass *klass = EMACS_FIXED_GET_CLASS (fixed); - GtkFixedClass *parent_class = g_type_class_peek_parent (klass); - return (GtkWidgetClass*) parent_class; + EmacsFixed *fixed = g_object_new (EMACS_TYPE_FIXED, NULL); + EmacsFixedPrivate *priv = fixed->priv; + priv->f = f; + return GTK_WIDGET (fixed); } static void @@ -90,9 +93,9 @@ emacs_fixed_get_preferred_width (GtkWidget *widget, { EmacsFixed *fixed = EMACS_FIXED (widget); EmacsFixedPrivate *priv = fixed->priv; - GtkWidgetClass *widget_class = get_parent_class (fixed); - widget_class->get_preferred_width (widget, minimum, natural); - if (minimum) *minimum = priv->minwidth; + int w = priv->f->output_data.x->size_hints.min_width; + if (minimum) *minimum = w; + if (natural) *natural = w; } static void @@ -102,22 +105,62 @@ emacs_fixed_get_preferred_height (GtkWidget *widget, { EmacsFixed *fixed = EMACS_FIXED (widget); EmacsFixedPrivate *priv = fixed->priv; - GtkWidgetClass *widget_class = get_parent_class (fixed); - widget_class->get_preferred_height (widget, minimum, natural); - if (minimum) *minimum = priv->minheight; + int h = priv->f->output_data.x->size_hints.min_height; + if (minimum) *minimum = h; + if (natural) *natural = h; } + +/* Override the X function so we can intercept Gtk+ 3 calls. + Use our values for min_width/height so that KDE don't freak out + (Bug#8919), and so users can resize our frames as they wish. */ + void -emacs_fixed_set_min_size (EmacsFixed *widget, int width, int height) +XSetWMSizeHints(Display* d, + Window w, + XSizeHints* hints, + Atom prop) { - EmacsFixedPrivate *priv = widget->priv; - GtkWidgetClass *widget_class = get_parent_class (widget); - int mw, nw, mh, nh; - - widget_class->get_preferred_height (GTK_WIDGET (widget), &mh, &nh); - widget_class->get_preferred_width (GTK_WIDGET (widget), &mw, &nw); + struct x_display_info *dpyinfo = x_display_info_for_display (d); + struct frame *f = x_top_window_to_frame (dpyinfo, w); + long data[18]; + data[0] = hints->flags; + data[1] = hints->x; + data[2] = hints->y; + data[3] = hints->width; + data[4] = hints->height; + data[5] = hints->min_width; + data[6] = hints->min_height; + data[7] = hints->max_width; + data[8] = hints->max_height; + data[9] = hints->width_inc; + data[10] = hints->height_inc; + data[11] = hints->min_aspect.x; + data[12] = hints->min_aspect.y; + data[13] = hints->max_aspect.x; + data[14] = hints->max_aspect.y; + data[15] = hints->base_width; + data[16] = hints->base_height; + data[17] = hints->win_gravity; + + if ((hints->flags & PMinSize) && f) + { + int w = f->output_data.x->size_hints.min_width; + int h = f->output_data.x->size_hints.min_height; + data[5] = w; + data[6] = h; + } + + XChangeProperty (d, w, prop, XA_WM_SIZE_HINTS, 32, PropModeReplace, + (unsigned char *) data, 18); +} - /* Gtk complains if min size is less than natural size. */ - if (width <= nw) priv->minwidth = width; - if (height <= nh) priv->minheight = height; +/* Override this X11 function. + This function is in the same X11 file as the one above. So we must + provide it also. */ + +void +XSetWMNormalHints (Display *d, Window w, XSizeHints *hints) +{ + XSetWMSizeHints (d, w, hints, XA_WM_NORMAL_HINTS); } diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h index 405374373ec..dbac136bd7f 100644 --- a/src/emacsgtkfixed.h +++ b/src/emacsgtkfixed.h @@ -1,4 +1,5 @@ -/* A Gtk Widget that inherits GtkFixed, but can be shrinked. +/* A Gtk Widget that inherits GtkFixed, but can be shrinked. +This file is only use when compiling with Gtk+ 3. Copyright (C) 2011 Free Software Foundation, Inc. @@ -24,6 +25,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ G_BEGIN_DECLS +struct frame; + #define EMACS_TYPE_FIXED (emacs_fixed_get_type ()) #define EMACS_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMACS_TYPE_FIXED, EmacsFixed)) #define EMACS_FIXED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMACS_TYPE_FIXED, EmacsFixedClass)) @@ -49,8 +52,7 @@ struct _EmacsFixedClass GtkFixedClass parent_class; }; -extern GtkWidget *emacs_fixed_new (void); -extern void emacs_fixed_set_min_size (EmacsFixed *widget, int width, int height); +extern GtkWidget *emacs_fixed_new (struct frame *f); extern GType emacs_fixed_get_type (void); G_END_DECLS diff --git a/src/gnutls.c b/src/gnutls.c index b59d0b265f2..2a055ac40f0 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -51,7 +51,6 @@ static Lisp_Object Qgnutls_bootprop_callbacks; static Lisp_Object Qgnutls_bootprop_loglevel; static Lisp_Object Qgnutls_bootprop_hostname; static Lisp_Object Qgnutls_bootprop_verify_flags; -static Lisp_Object Qgnutls_bootprop_verify_error; static Lisp_Object Qgnutls_bootprop_verify_hostname_error; /* Callback keys for `gnutls-boot'. Unused currently. */ diff --git a/src/gtkutil.c b/src/gtkutil.c index 7712966b0f4..48571bef275 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1090,7 +1090,7 @@ xg_create_frame_widgets (FRAME_PTR f) whbox = gtk_hbox_new (FALSE, 0); #ifdef HAVE_GTK3 - f->gwfixed = wfixed = emacs_fixed_new (); + f->gwfixed = wfixed = emacs_fixed_new (f); #else f->gwfixed = wfixed = gtk_fixed_new (); #endif @@ -1290,18 +1290,6 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) size_hints.min_width = base_width + min_cols * size_hints.width_inc; size_hints.min_height = base_height + min_rows * size_hints.height_inc; -#ifdef HAVE_GTK3 - /* Gtk3 ignores min width/height and overwrites them with its own idea - of min width/height. Put out min values to the widget so Gtk - gets the same value we want it to be. Without this, a user can't - shrink an Emacs frame. - */ - if (FRAME_GTK_WIDGET (f)) - emacs_fixed_set_min_size (EMACS_FIXED (FRAME_GTK_WIDGET (f)), - size_hints.min_width, - size_hints.min_height); -#endif - /* These currently have a one to one mapping with the X values, but I don't think we should rely on that. */ hint_flags |= GDK_HINT_WIN_GRAVITY; @@ -1340,7 +1328,7 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) { BLOCK_INPUT; gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - NULL, &size_hints, hint_flags); + NULL, &size_hints, hint_flags); f->output_data.x->size_hints = size_hints; f->output_data.x->hint_flags = hint_flags; UNBLOCK_INPUT; diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 173fc673955..88b53554925 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -382,471 +382,452 @@ full-tags: TAGS TAGS-LISP ../nt/TAGS ### DEPENDENCIES ### EMACS_ROOT = .. -CONFIG_H = $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h \ - $(EMACS_ROOT)/nt/inc/sys/stat.h -LISP_H = $(SRC)/lisp.h \ - $(SRC)/globals.h \ - $(EMACS_ROOT)/lib/intprops.h \ - $(EMACS_ROOT)/nt/inc/inttypes.h \ - $(EMACS_ROOT)/nt/inc/stdint.h -PROCESS_H = $(SRC)/process.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(SRC)/gnutls.h +GNU_LIB = $(EMACS_ROOT)/lib +NT_INC = $(EMACS_ROOT)/nt/inc + +SYSTIME_H = $(SRC)/systime.h \ + $(NT_INC)/sys/time.h +ATIMER_H = $(SRC)/atimer.h \ + $(SYSTIME_H) +BLOCKINPUT_H = $(SRC)/blockinput.h \ + $(ATIMER_H) +CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \ + $(NT_INC)/unistd.h +CHARACTER_H = $(SRC)/character.h \ + $(GNU_LIB)/verify.h +CHARSET_H = $(SRC)/charset.h \ + $(GNU_LIB)/verify.h +CODING_H = $(SRC)/coding.h \ + $(SRC)/composite.h +MS_W32_H = $(SRC)/s/ms-w32.h \ + $(NT_INC)/sys/stat.h +CONFIG_H = $(SRC)/config.h \ + $(SRC)/m/intel386.h \ + $(MS_W32_H) +DIR_H = $(NT_INC)/sys/dir.h \ + $(SRC)/ndir.h +W32GUI_H = $(SRC)/w32gui.h \ + $(SYSTIME_H) +DISPEXTERN_H = $(SRC)/dispextern.h \ + $(W32GUI_H) +FILEMODE_H = $(GNU_LIB)/filemode.h \ + $(NT_INC)/sys/stat.h +FONT_H = $(SRC)/font.h \ + $(SRC)/ccl.h +FRAME_H = $(SRC)/frame.h \ + $(DISPEXTERN_H) +FTOASTR_H = $(GNU_LIB)/ftoastr.h \ + $(GNU_LIB)/intprops.h +GRP_H = $(NT_INC)/grp.h \ + $(NT_INC)/pwd.h +INTERVALS_H = $(SRC)/intervals.h \ + $(SRC)/composite.h \ + $(DISPEXTERN_H) +INTTYPES_H = $(NT_INC)/inttypes.h \ + $(NT_INC)/stdint.h +KEYBOARD_H = $(SRC)/keyboard.h \ + $(CODING_H) \ + $(SYSTIME_H) +LANGINFO_H = $(NT_INC)/langinfo.h \ + $(NT_INC)/nl_types.h +LISP_H = $(SRC)/lisp.h \ + $(SRC)/globals.h \ + $(GNU_LIB)/intprops.h \ + $(INTTYPES_H) +MD5_H = $(GNU_LIB)/md5.h \ + $(NT_INC)/stdint.h +MENU_H = $(SRC)/menu.h \ + $(SYSTIME_H) +PROCESS_H = $(SRC)/process.h \ + $(SRC)/gnutls.h \ + $(NT_INC)/unistd.h +SHA1_H = $(GNU_LIB)/sha1.h \ + $(NT_INC)/stdint.h +SHA256_H = $(GNU_LIB)/sha256.h \ + $(NT_INC)/stdint.h +U64_H = $(GNU_LIB)/u64.h \ + $(NT_INC)/stdint.h +SHA512_H = $(GNU_LIB)/sha512.h \ + $(U64_H) +SOCKET_H = $(NT_INC)/sys/socket.h \ + $(SRC)/w32.h +SYSTTY_H = $(SRC)/systty.h \ + $(NT_INC)/sys/ioctl.h \ + $(NT_INC)/unistd.h +TERMHOOKS_H = $(SRC)/termhooks.h \ + $(SYSTIME_H) +W32TERM_H = $(SRC)/w32term.h \ + $(W32GUI_H) +WINDOW_H = $(SRC)/window.h \ + $(DISPEXTERN_H) $(BLD)/alloc.$(O) : \ $(SRC)/alloc.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/puresize.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ $(SRC)/w32.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/atimer.$(O) : \ $(SRC)/atimer.c \ + $(SRC)/syssignal.h \ + $(NT_INC)/sys/time.h \ + $(NT_INC)/unistd.h \ + $(ATIMER_H) \ + $(BLOCKINPUT_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/syssignal.h \ - $(SRC)/systime.h + $(SYSTIME_H) $(BLD)/bidi.$(O) : \ $(SRC)/bidi.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/bidimirror.h \ $(SRC)/biditype.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/dispextern.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(LISP_H) $(BLD)/buffer.$(O) : \ $(SRC)/buffer.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/param.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ $(SRC)/indent.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/region-cache.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/sys/param.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(GNU_LIB)/verify.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/bytecode.$(O) : \ $(SRC)/bytecode.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/dispextern.h \ $(SRC)/syntax.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/callint.$(O) : \ $(SRC)/callint.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/callproc.$(O) : \ $(SRC)/callproc.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/epaths.h \ - $(SRC)/frame.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/systty.h \ - $(SRC)/termhooks.h \ $(SRC)/w32.h \ - $(SRC)/w32gui.h + $(NT_INC)/sys/file.h \ + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SYSTTY_H) \ + $(TERMHOOKS_H) $(BLD)/casefiddle.$(O) : \ $(SRC)/casefiddle.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ $(SRC)/keymap.h \ - $(SRC)/syntax.h + $(SRC)/syntax.h \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/casetab.$(O) : \ $(SRC)/casetab.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/category.$(O) : \ $(SRC)/category.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/keymap.h + $(SRC)/keymap.h \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/ccl.$(O) : \ $(SRC)/ccl.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/character.$(O) : \ $(SRC)/character.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ $(SRC)/composite.h \ - $(SRC)/disptab.h + $(SRC)/disptab.h \ + $(GNU_LIB)/intprops.h \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/charset.$(O) : \ $(SRC)/charset.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/disptab.h + $(SRC)/disptab.h \ + $(NT_INC)/unistd.h \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/chartab.$(O) : \ $(SRC)/chartab.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/cmds.$(O) : \ $(SRC)/cmds.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/syntax.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/coding.$(O) : \ $(SRC)/coding.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/composite.$(O) : \ $(SRC)/composite.c \ + $(SRC)/buffer.h \ + $(CHARACTER_H) \ + $(CODING_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ $(LISP_H) \ - $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/data.$(O) : \ $(SRC)/data.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ $(SRC)/puresize.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h + $(GNU_LIB)/intprops.h \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) $(BLD)/dired.$(O) : \ $(SRC)/dired.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/grp.h \ - $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/dir.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(EMACS_ROOT)/lib/filemode.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/ndir.h \ $(SRC)/regex.h \ - $(SRC)/systime.h + $(NT_INC)/pwd.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DIR_H) \ + $(FILEMODE_H) \ + $(GRP_H) \ + $(LISP_H) \ + $(SYSTIME_H) $(BLD)/dispnew.$(O) : \ $(SRC)/dispnew.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/cm.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/frame.h \ $(SRC)/indent.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SYSTIME_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/doc.$(O) : \ $(SRC)/doc.c \ - $(CONFIG_H) \ - buildobj.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/keyboard.h \ + $(SRC)/buildobj.h \ $(SRC)/keymap.h \ - $(SRC)/systime.h + $(NT_INC)/sys/file.h \ + $(NT_INC)/unistd.h \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(KEYBOARD_H) \ + $(LISP_H) $(BLD)/doprnt.$(O) : \ $(SRC)/doprnt.c \ + $(NT_INC)/unistd.h \ + $(CHARACTER_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(LISP_H) \ - $(SRC)/character.h + $(LISP_H) $(BLD)/editfns.$(O) : \ $(SRC)/editfns.c \ + $(SRC)/buffer.h \ + $(NT_INC)/pwd.h \ + $(NT_INC)/unistd.h \ + $(GNU_LIB)/intprops.h \ + $(GNU_LIB)/strftime.h \ + $(GNU_LIB)/verify.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CODING_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(EMACS_ROOT)/lib/strftime.h \ - $(EMACS_ROOT)/lib/verify.h \ + $(FRAME_H) \ + $(INTERVALS_H) \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(SYSTIME_H) \ + $(WINDOW_H) $(BLD)/emacs.$(O) : \ $(SRC)/emacs.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ + $(SRC)/gnutls.h \ $(SRC)/keymap.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/systty.h \ - $(SRC)/termhooks.h \ $(SRC)/unexec.h \ $(SRC)/w32.h \ - $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ - $(SRC)/window.h + $(NT_INC)/sys/file.h \ + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SYSTTY_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/eval.$(O) : \ $(SRC)/eval.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h + $(BLOCKINPUT_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ + $(LISP_H) $(BLD)/fileio.$(O) : \ $(SRC)/fileio.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/pwd.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(LISP_H) \ + $(SYSTIME_H) \ + $(WINDOW_H) $(BLD)/filelock.$(O) : \ $(SRC)/filelock.c \ + $(SRC)/buffer.h \ + $(NT_INC)/pwd.h \ + $(NT_INC)/sys/file.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(CHARACTER_H) \ + $(CODING_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ - $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/systime.h + $(SYSTIME_H) $(BLD)/firstfile.$(O) : \ $(SRC)/firstfile.c \ @@ -854,271 +835,213 @@ $(BLD)/firstfile.$(O) : \ $(BLD)/floatfns.$(O) : \ $(SRC)/floatfns.c \ + $(SRC)/syssignal.h \ $(CONFIG_H) \ - $(LISP_H) \ - $(SRC)/syssignal.h + $(LISP_H) $(BLD)/fns.$(O) : \ $(SRC)/fns.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/langinfo.h \ - $(EMACS_ROOT)/nt/inc/nl_types.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(EMACS_ROOT)/lib/md5.h \ - $(EMACS_ROOT)/lib/sha1.h \ - $(EMACS_ROOT)/lib/sha256.h \ - $(EMACS_ROOT)/lib/sha512.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/unistd.h \ + $(GNU_LIB)/intprops.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LANGINFO_H) \ + $(LISP_H) \ + $(MD5_H) \ + $(SHA1_H) \ + $(SHA256_H) \ + $(SHA512_H) \ + $(WINDOW_H) $(BLD)/font.$(O) : \ $(SRC)/font.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/fontset.$(O) : \ $(SRC)/fontset.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/frame.$(O) : \ $(SRC)/frame.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/fringe.$(O) : \ $(SRC)/fringe.c \ + $(SRC)/buffer.h \ + $(BLOCKINPUT_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/buffer.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/gmalloc.$(O) : \ $(SRC)/gmalloc.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(SRC)/getpagesize.h + $(SRC)/getpagesize.h \ + $(NT_INC)/unistd.h \ + $(CONFIG_H) $(BLD)/gnutls.$(O) : \ $(SRC)/gnutls.c \ + $(SRC)/w32.h \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/w32.h + $(PROCESS_H) $(BLD)/image.$(O) : \ $(SRC)/image.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/epaths.h \ - $(SRC)/font.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ $(SRC)/w32.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(SYSTIME_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/indent.$(O) : \ $(SRC)/indent.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/frame.h \ $(SRC)/indent.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/region-cache.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ $(SRC)/termopts.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/insdel.$(O) : \ $(SRC)/insdel.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/intervals.h \ $(SRC)/region-cache.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(GNU_LIB)/intprops.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(INTERVALS_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/intervals.$(O) : \ $(SRC)/intervals.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/puresize.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h + $(GNU_LIB)/intprops.h \ + $(CONFIG_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) $(BLD)/keyboard.$(O) : \ $(SRC)/keyboard.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/macros.h \ $(SRC)/puresize.h \ $(SRC)/syntax.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(NT_INC)/sys/ioctl.h \ + $(NT_INC)/unistd.h \ + $(ATIMER_H) \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SYSTIME_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/keymap.$(O) : \ $(SRC)/keymap.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/puresize.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/lastfile.$(O) : \ $(SRC)/lastfile.c \ @@ -1126,714 +1049,560 @@ $(BLD)/lastfile.$(O) : \ $(BLD)/lread.$(O) : \ $(SRC)/lread.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/epaths.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h + $(NT_INC)/sys/file.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) $(BLD)/macros.$(O) : \ $(SRC)/macros.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/keyboard.h \ $(SRC)/macros.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CONFIG_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/marker.$(O) : \ $(SRC)/marker.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/menu.$(O) : \ $(SRC)/menu.c \ + $(SRC)/keymap.h \ + $(BLOCKINPUT_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/keymap.h \ - $(SRC)/menu.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(MENU_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/minibuf.$(O) : \ $(SRC)/minibuf.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/syntax.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/w32.$(O) : \ $(SRC)/w32.c \ + $(SRC)/ndir.h \ + $(SRC)/w32.h \ + $(SRC)/w32heap.h \ + $(NT_INC)/pwd.h \ + $(NT_INC)/sys/file.h \ + $(NT_INC)/sys/time.h \ + $(GNU_LIB)/allocator.h \ + $(CAREADLINKAT_H) \ + $(CODING_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/grp.h \ - $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/socket.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(EMACS_ROOT)/lib/allocator.h \ - $(EMACS_ROOT)/lib/careadlinkat.h \ + $(DISPEXTERN_H) \ + $(GRP_H) \ $(LISP_H) \ $(PROCESS_H) \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/ndir.h \ - $(SRC)/systime.h \ - $(SRC)/w32.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32heap.h + $(SOCKET_H) \ + $(SYSTIME_H) $(BLD)/w32heap.$(O) : \ $(SRC)/w32heap.c \ + $(SRC)/w32heap.h \ $(CONFIG_H) \ - $(LISP_H) \ - $(SRC)/w32heap.h + $(LISP_H) $(BLD)/w32inevt.$(O) : \ $(SRC)/w32inevt.c \ + $(SRC)/w32heap.h \ + $(BLOCKINPUT_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32heap.h \ - $(SRC)/w32term.h + $(TERMHOOKS_H) \ + $(W32TERM_H) $(BLD)/w32proc.$(O) : \ $(SRC)/w32proc.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/langinfo.h \ - $(EMACS_ROOT)/nt/inc/nl_types.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ $(SRC)/syswait.h \ $(SRC)/w32.h \ - $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ - $(SRC)/w32term.h + $(NT_INC)/nl_types.h \ + $(NT_INC)/sys/file.h \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(LANGINFO_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SYSTIME_H) \ + $(W32TERM_H) $(BLD)/w32console.$(O) : \ $(SRC)/w32console.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/character.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32inevt.h + $(SRC)/w32inevt.h \ + $(CHARACTER_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) $(BLD)/print.$(O) : \ $(SRC)/print.c \ + $(SRC)/buffer.h \ + $(SRC)/termchar.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(EMACS_ROOT)/lib/ftoastr.h \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(FTOASTR_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ $(LISP_H) \ $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/process.$(O) : \ $(SRC)/process.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/netdb.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/arpa/inet.h \ - $(EMACS_ROOT)/nt/inc/netinet/in.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/socket.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ + $(SRC)/gnutls.h \ $(SRC)/sysselect.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/systty.h \ $(SRC)/syswait.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ - $(SRC)/w32.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/arpa/inet.h \ + $(NT_INC)/netdb.h \ + $(NT_INC)/netinet/in.h \ + $(NT_INC)/sys/file.h \ + $(NT_INC)/sys/ioctl.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(ATIMER_H) \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SOCKET_H) \ + $(SYSTIME_H) \ + $(SYSTTY_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/ralloc.$(O) : \ $(SRC)/ralloc.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/getpagesize.h \ - $(SRC)/systime.h + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/regex.$(O) : \ $(SRC)/regex.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/regex.h \ - $(SRC)/syntax.h + $(SRC)/syntax.h \ + $(NT_INC)/unistd.h \ + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/region-cache.$(O) : \ $(SRC)/region-cache.c \ - $(CONFIG_H) \ - $(LISP_H) \ $(SRC)/buffer.h \ - $(SRC)/region-cache.h + $(SRC)/region-cache.h \ + $(CONFIG_H) \ + $(LISP_H) $(BLD)/scroll.$(O) : \ $(SRC)/scroll.c \ + $(SRC)/termchar.h \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ $(LISP_H) \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/search.$(O) : \ $(SRC)/search.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/intervals.h \ $(SRC)/regex.h \ $(SRC)/region-cache.h \ $(SRC)/syntax.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(INTERVALS_H) \ + $(LISP_H) $(BLD)/sound.$(O) : \ $(SRC)/sound.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/dispextern.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h + $(NT_INC)/unistd.h \ + $(ATIMER_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(LISP_H) $(BLD)/syntax.$(O) : \ $(SRC)/syntax.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/intervals.h \ $(SRC)/keymap.h \ $(SRC)/regex.h \ $(SRC)/syntax.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h + $(CHARACTER_H) \ + $(CONFIG_H) \ + $(INTERVALS_H) \ + $(LISP_H) $(BLD)/sysdep.$(O) : \ $(SRC)/sysdep.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/grp.h \ - $(EMACS_ROOT)/nt/inc/netdb.h \ - $(EMACS_ROOT)/nt/inc/pwd.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/socket.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(EMACS_ROOT)/lib/allocator.h \ - $(EMACS_ROOT)/lib/careadlinkat.h \ - $(EMACS_ROOT)/lib/ignore-value.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/cm.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ $(SRC)/sysselect.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/systty.h \ $(SRC)/syswait.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ - $(SRC)/w32.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/netdb.h \ + $(NT_INC)/pwd.h \ + $(NT_INC)/sys/file.h \ + $(NT_INC)/sys/stat.h \ + $(NT_INC)/unistd.h \ + $(GNU_LIB)/allocator.h \ + $(GNU_LIB)/ignore-value.h \ + $(BLOCKINPUT_H) \ + $(CAREADLINKAT_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(GRP_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SOCKET_H) \ + $(SYSTIME_H) \ + $(SYSTTY_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/term.$(O) : \ $(SRC)/term.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/file.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ $(SRC)/cm.h \ - $(SRC)/coding.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/syssignal.h \ - $(SRC)/systime.h \ - $(SRC)/systty.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ $(SRC)/tparam.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(NT_INC)/sys/file.h \ + $(NT_INC)/unistd.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(SYSTTY_H) \ + $(TERMHOOKS_H) \ + $(WINDOW_H) $(BLD)/terminal.$(O) : \ $(SRC)/terminal.c \ + $(SRC)/termchar.h \ + $(CHARSET_H) \ + $(CODING_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(FRAME_H) \ + $(KEYBOARD_H) \ $(LISP_H) \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h + $(TERMHOOKS_H) $(BLD)/textprop.$(O) : \ $(SRC)/textprop.c \ + $(SRC)/buffer.h \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(INTERVALS_H) \ $(LISP_H) \ - $(SRC)/buffer.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/intervals.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(WINDOW_H) $(BLD)/tparam.$(O) : \ $(SRC)/tparam.c \ + $(SRC)/tparam.h \ $(CONFIG_H) \ - $(LISP_H) \ - $(SRC)/tparam.h + $(LISP_H) $(BLD)/undo.$(O) : \ $(SRC)/undo.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ $(SRC)/buffer.h \ $(SRC)/commands.h \ - $(SRC)/dispextern.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/window.h + $(CONFIG_H) \ + $(LISP_H) \ + $(WINDOW_H) $(BLD)/unexw32.$(O) : \ $(SRC)/unexw32.c \ - $(CONFIG_H) \ $(SRC)/unexec.h \ - $(SRC)/w32heap.h + $(SRC)/w32heap.h \ + $(CONFIG_H) $(BLD)/vm-limit.$(O) : \ $(SRC)/vm-limit.c \ + $(SRC)/mem-limits.h \ $(CONFIG_H) \ - $(LISP_H) \ - $(SRC)/mem-limits.h + $(LISP_H) $(BLD)/window.$(O) : \ $(SRC)/window.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/frame.h \ $(SRC)/indent.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/xdisp.$(O) : \ $(SRC)/xdisp.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ $(SRC)/commands.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ $(SRC)/indent.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ $(SRC)/macros.h \ $(SRC)/region-cache.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/xfaces.$(O) : \ $(SRC)/xfaces.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(NT_INC)/sys/stat.h \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/w32fns.$(O) : \ $(SRC)/w32fns.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/epaths.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ $(SRC)/w32.h \ $(SRC)/w32font.h \ - $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(SYSTIME_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/w32menu.$(O) : \ $(SRC)/w32menu.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ - $(SRC)/menu.h \ - $(SRC)/systime.h \ - $(SRC)/termhooks.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(BLOCKINPUT_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FRAME_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(MENU_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/w32term.$(O) : \ $(SRC)/w32term.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/ioctl.h \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(PROCESS_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ $(SRC)/disptab.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/intervals.h \ - $(SRC)/keyboard.h \ $(SRC)/keymap.h \ - $(SRC)/systime.h \ - $(SRC)/systty.h \ $(SRC)/termchar.h \ - $(SRC)/termhooks.h \ $(SRC)/termopts.h \ $(SRC)/w32font.h \ - $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ - $(SRC)/w32term.h \ - $(SRC)/window.h + $(NT_INC)/sys/stat.h \ + $(ATIMER_H) \ + $(BLOCKINPUT_H) \ + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(INTERVALS_H) \ + $(KEYBOARD_H) \ + $(LISP_H) \ + $(PROCESS_H) \ + $(SYSTIME_H) \ + $(SYSTTY_H) \ + $(TERMHOOKS_H) \ + $(W32TERM_H) \ + $(WINDOW_H) $(BLD)/w32select.$(O) : \ $(SRC)/w32select.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ $(SRC)/composite.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ - $(SRC)/w32term.h + $(BLOCKINPUT_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(LISP_H) \ + $(W32TERM_H) $(BLD)/w32reg.$(O) : \ $(SRC)/w32reg.c \ + $(BLOCKINPUT_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h + $(W32TERM_H) $(BLD)/w32xfns.$(O) : \ $(SRC)/w32xfns.c \ + $(SRC)/fontset.h \ + $(BLOCKINPUT_H) \ + $(CHARSET_H) \ $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ + $(FRAME_H) \ + $(KEYBOARD_H) \ $(LISP_H) \ - $(SRC)/atimer.h \ - $(SRC)/blockinput.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/keyboard.h \ - $(SRC)/systime.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h + $(W32TERM_H) $(BLD)/w32font.$(O) : \ $(SRC)/w32font.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ $(SRC)/w32font.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CODING_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(W32TERM_H) $(BLD)/w32uniscribe.$(O) : \ $(SRC)/w32uniscribe.c \ - $(CONFIG_H) \ - $(EMACS_ROOT)/nt/inc/sys/time.h \ - $(LISP_H) \ - $(SRC)/ccl.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ $(SRC)/composite.h \ - $(SRC)/dispextern.h \ - $(SRC)/font.h \ $(SRC)/fontset.h \ - $(SRC)/frame.h \ - $(SRC)/systime.h \ $(SRC)/w32font.h \ - $(SRC)/w32gui.h \ - $(SRC)/w32term.h + $(CHARACTER_H) \ + $(CHARSET_H) \ + $(CONFIG_H) \ + $(DISPEXTERN_H) \ + $(FONT_H) \ + $(FRAME_H) \ + $(LISP_H) \ + $(W32TERM_H) # Each object file depends on stamp_BLD, because in parallel builds we must # make sure $(BLD) exists before starting compilations. diff --git a/src/process.c b/src/process.c index c46437fe8cb..0fe7068af3b 100644 --- a/src/process.c +++ b/src/process.c @@ -4479,13 +4479,19 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, set_waiting_for_input (&timeout); } + /* Skip the `select' call if input is available and we're + waiting for keyboard input or a cell change (which can be + triggered by processing X events). In the latter case, set + nfds to 1 to avoid breaking the loop. */ no_avail = 0; - if (read_kbd && detect_input_pending ()) + if ((read_kbd || !NILP (wait_for_cell)) + && detect_input_pending ()) { - nfds = 0; + nfds = read_kbd ? 0 : 1; no_avail = 1; } - else + + if (!no_avail) { #ifdef ADAPTIVE_READ_BUFFERING diff --git a/src/window.c b/src/window.c index ebfe318defd..93f763ec9af 100644 --- a/src/window.c +++ b/src/window.c @@ -84,8 +84,8 @@ static int foreach_window_1 (struct window *, int (* fn) (struct window *, void *), void *); static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); -static int resize_window_check (struct window *, int); -static void resize_window_apply (struct window *, int); +static int window_resize_check (struct window *, int); +static void window_resize_apply (struct window *, int); static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); /* This is the window in which the terminal's cursor should @@ -436,37 +436,37 @@ Return nil if WINDOW has no parent. */) return decode_any_window (window)->parent; } -DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0, - doc: /* Return WINDOW's first vertical child window. +DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0, + doc: /* Return WINDOW's topmost child window. WINDOW can be any window and defaults to the selected one. -Return nil if WINDOW has no vertical child. */) +Return nil if WINDOW is not a vertical combination. */) (Lisp_Object window) { return decode_any_window (window)->vchild; } -DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0, - doc: /* Return WINDOW's first horizontal child window. +DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0, + doc: /* Return WINDOW's leftmost child window. WINDOW can be any window and defaults to the selected one. -Return nil if WINDOW has no horizontal child. */) +Return nil if WINDOW is not a horizontal combination. */) (Lisp_Object window) { return decode_any_window (window)->hchild; } -DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0, - doc: /* Return WINDOW's right sibling window. +DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, + doc: /* Return WINDOW's next sibling window. WINDOW can be any window and defaults to the selected one. -Return nil if WINDOW has no right sibling. */) +Return nil if WINDOW has no next sibling. */) (Lisp_Object window) { return decode_any_window (window)->next; } -DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0, - doc: /* Return WINDOW's left sibling window. +DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, + doc: /* Return WINDOW's previous sibling window. WINDOW can be any window and defaults to the selected one. -Return nil if WINDOW has no left sibling. */) +Return nil if WINDOW has no previous sibling. */) (Lisp_Object window) { return decode_any_window (window)->prev; @@ -2697,13 +2697,13 @@ window-start value is reasonable when this function is called. */) XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); w->top_line = r->top_line; resize_root_window (window, delta, Qnil, Qnil); - if (resize_window_check (w, 0)) - resize_window_apply (w, 0); + if (window_resize_check (w, 0)) + window_resize_apply (w, 0); else { resize_root_window (window, delta, Qnil, Qt); - if (resize_window_check (w, 0)) - resize_window_apply (w, 0); + if (window_resize_check (w, 0)) + window_resize_apply (w, 0); else resize_failed = 1; } @@ -2715,13 +2715,13 @@ window-start value is reasonable when this function is called. */) XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols)); w->left_col = r->left_col; resize_root_window (window, delta, Qt, Qnil); - if (resize_window_check (w, 1)) - resize_window_apply (w, 1); + if (window_resize_check (w, 1)) + window_resize_apply (w, 1); else { resize_root_window (window, delta, Qt, Qt); - if (resize_window_check (w, 1)) - resize_window_apply (w, 1); + if (window_resize_check (w, 1)) + window_resize_apply (w, 1); else resize_failed = 1; } @@ -3417,7 +3417,7 @@ Note: This function does not operate on any subwindows of WINDOW. */) `window-min-height' or `window-min-width'. It does check that window sizes do not drop below one line (two columns). */ static int -resize_window_check (struct window *w, int horflag) +window_resize_check (struct window *w, int horflag) { struct window *c; @@ -3431,7 +3431,7 @@ resize_window_check (struct window *w, int horflag) while (c) { if ((XINT (c->new_total) != XINT (w->new_total)) - || !resize_window_check (c, horflag)) + || !window_resize_check (c, horflag)) return 0; c = NILP (c->next) ? 0 : XWINDOW (c->next); } @@ -3444,7 +3444,7 @@ resize_window_check (struct window *w, int horflag) int sum_of_sizes = 0; while (c) { - if (!resize_window_check (c, horflag)) + if (!window_resize_check (c, horflag)) return 0; sum_of_sizes = sum_of_sizes + XINT (c->new_total); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3463,7 +3463,7 @@ resize_window_check (struct window *w, int horflag) int sum_of_sizes = 0; while (c) { - if (!resize_window_check (c, horflag)) + if (!window_resize_check (c, horflag)) return 0; sum_of_sizes = sum_of_sizes + XINT (c->new_total); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3476,7 +3476,7 @@ resize_window_check (struct window *w, int horflag) while (c) { if ((XINT (c->new_total) != XINT (w->new_total)) - || !resize_window_check (c, horflag)) + || !window_resize_check (c, horflag)) return 0; c = NILP (c->next) ? 0 : XWINDOW (c->next); } @@ -3496,9 +3496,9 @@ resize_window_check (struct window *w, int horflag) each of these windows. This function does not perform any error checks. Make sure you have - run resize_window_check on W before applying this function. */ + run window_resize_check on W before applying this function. */ static void -resize_window_apply (struct window *w, int horflag) +window_resize_apply (struct window *w, int horflag) { struct window *c; int pos; @@ -3532,7 +3532,7 @@ resize_window_apply (struct window *w, int horflag) XSETFASTINT (c->left_col, pos); else XSETFASTINT (c->top_line, pos); - resize_window_apply (c, horflag); + window_resize_apply (c, horflag); if (!horflag) pos = pos + XINT (c->total_lines); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3548,7 +3548,7 @@ resize_window_apply (struct window *w, int horflag) XSETFASTINT (c->left_col, pos); else XSETFASTINT (c->top_line, pos); - resize_window_apply (c, horflag); + window_resize_apply (c, horflag); if (horflag) pos = pos + XINT (c->total_cols); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3561,7 +3561,7 @@ resize_window_apply (struct window *w, int horflag) } -DEFUN ("resize-window-apply", Fresize_window_apply, Sresize_window_apply, 1, 2, 0, +DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 1, 2, 0, doc: /* Apply requested size values for window-tree of FRAME. Optional argument HORIZONTAL omitted or nil means apply requested height values. HORIZONTAL non-nil means apply requested width values. @@ -3586,12 +3586,12 @@ be applied on the Elisp level. */) f = XFRAME (frame); r = XWINDOW (FRAME_ROOT_WINDOW (f)); - if (!resize_window_check (r, horflag) + if (!window_resize_check (r, horflag) || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) return Qnil; BLOCK_INPUT; - resize_window_apply (r, horflag); + window_resize_apply (r, horflag); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -3643,22 +3643,22 @@ resize_frame_windows (struct frame *f, int size, int horflag) XSETINT (delta, new_size - old_size); /* Try a "normal" resize first. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); - if (resize_window_check (r, horflag) && new_size == XINT (r->new_total)) - resize_window_apply (r, horflag); + if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) + window_resize_apply (r, horflag); else { /* Try with "reasonable" minimum sizes next. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); - if (resize_window_check (r, horflag) + if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) - resize_window_apply (r, horflag); + window_resize_apply (r, horflag); else { /* Finally, try with "safe" minimum sizes. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); - if (resize_window_check (r, horflag) + if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) - resize_window_apply (r, horflag); + window_resize_apply (r, horflag); else { /* We lost. Delete all windows but the frame's @@ -3767,7 +3767,7 @@ set correctly. See the code of `split-window' for how this is done. */) XSETINT (p->new_total, XINT (horflag ? p->total_cols : p->total_lines) - XINT (total_size)); - if (!resize_window_check (p, horflag)) + if (!window_resize_check (p, horflag)) error ("Window sizes don't fit"); else /* Undo the temporary pretension. */ @@ -3775,7 +3775,7 @@ set correctly. See the code of `split-window' for how this is done. */) } else { - if (!resize_window_check (o, horflag)) + if (!window_resize_check (o, horflag)) error ("Resizing old window failed"); else if (XINT (total_size) + XINT (o->new_total) != XINT (horflag ? o->total_cols : o->total_lines)) @@ -3863,13 +3863,13 @@ set correctly. See the code of `split-window' for how this is done. */) n->total_cols = o->total_cols; } - /* Iso-coordinates and sizes are assigned by resize_window_apply, + /* Iso-coordinates and sizes are assigned by window_resize_apply, get them ready here. */ n->new_total = total_size; n->new_normal = normal_size; BLOCK_INPUT; - resize_window_apply (p, horflag); + window_resize_apply (p, horflag); adjust_glyphs (f); /* Set buffer of NEW to buffer of reference window. Don't run any hooks. */ @@ -3947,13 +3947,13 @@ when WINDOW is the only window on its frame. */) XWINDOW (s->next)->prev = sibling; } - if (resize_window_check (r, horflag) + if (window_resize_check (r, horflag) && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) /* We can delete WINDOW now. */ { /* Block input. */ BLOCK_INPUT; - resize_window_apply (p, horflag); + window_resize_apply (p, horflag); windows_or_buffers_changed++; Vwindow_list = Qnil; @@ -4076,10 +4076,10 @@ grow_mini_window (struct window *w, int delta) root = FRAME_ROOT_WINDOW (f); r = XWINDOW (root); value = call2 (Qresize_root_window_vertically, root, make_number (- delta)); - if (INTEGERP (value) && resize_window_check (r, 0)) + if (INTEGERP (value) && window_resize_check (r, 0)) { BLOCK_INPUT; - resize_window_apply (r, 0); + window_resize_apply (r, 0); /* Grow the mini-window. */ XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); @@ -4111,10 +4111,10 @@ shrink_mini_window (struct window *w) r = XWINDOW (root); value = call2 (Qresize_root_window_vertically, root, make_number (size - 1)); - if (INTEGERP (value) && resize_window_check (r, 0)) + if (INTEGERP (value) && window_resize_check (r, 0)) { BLOCK_INPUT; - resize_window_apply (r, 0); + window_resize_apply (r, 0); /* Shrink the mini-window. */ XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); @@ -4152,12 +4152,12 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini r = XWINDOW (FRAME_ROOT_WINDOW (f)); height = XINT (r->total_lines) + XINT (w->total_lines); - if (resize_window_check (r, 0) + if (window_resize_check (r, 0) && XINT (w->new_total) > 0 && height == XINT (r->new_total) + XINT (w->new_total)) { BLOCK_INPUT; - resize_window_apply (r, 0); + window_resize_apply (r, 0); w->total_lines = w->new_total; XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines)); @@ -6600,10 +6600,10 @@ function `window-nest' and altered by the function `set-window-nest'. */); defsubr (&Swindow_clone_number); defsubr (&Swindow_buffer); defsubr (&Swindow_parent); - defsubr (&Swindow_vchild); - defsubr (&Swindow_hchild); - defsubr (&Swindow_next); - defsubr (&Swindow_prev); + defsubr (&Swindow_top_child); + defsubr (&Swindow_left_child); + defsubr (&Swindow_next_sibling); + defsubr (&Swindow_prev_sibling); defsubr (&Swindow_splits); defsubr (&Sset_window_splits); defsubr (&Swindow_nest); @@ -6617,7 +6617,7 @@ function `window-nest' and altered by the function `set-window-nest'. */); defsubr (&Swindow_new_normal); defsubr (&Sset_window_new_total); defsubr (&Sset_window_new_normal); - defsubr (&Sresize_window_apply); + defsubr (&Swindow_resize_apply); defsubr (&Swindow_body_size); defsubr (&Swindow_hscroll); defsubr (&Sset_window_hscroll); |