diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index eb3eadf2da8..04d1ff76f36 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -102,7 +102,6 @@ HAVE_ALARM HAVE_ALLOCA HAVE_ALLOCA_H HAVE_ALSA -HAVE_ATTRIBUTE_ALIGNED HAVE_BDFFONT HAVE_BOXES HAVE_C99_STRTOLD diff --git a/build-aux/config.guess b/build-aux/config.guess index 2773ac4f5ed..31e01efec3e 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-11-01' +timestamp='2017-11-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -244,6 +244,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; + *:MidnightBSD:*:*) + echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -479,7 +482,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-risco0s%ssysv\\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); diff --git a/build-aux/config.sub b/build-aux/config.sub index bbad4c45e5d..fb579478695 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-11-01' +timestamp='2017-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -313,7 +313,6 @@ case $basic_machine in | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ - | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown diff --git a/configure.ac b/configure.ac index 2dd21b77dac..29016d89ae2 100644 --- a/configure.ac +++ b/configure.ac @@ -5113,22 +5113,6 @@ else fi AC_SUBST(LIBXMENU) -AC_CACHE_CHECK([for struct alignment], - [emacs_cv_struct_alignment], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include - struct __attribute__ ((aligned (8))) s { char c; }; - struct t { char c; struct s s; }; - char verify[offsetof (struct t, s) == 8 ? 1 : -1]; - ]])], - [emacs_cv_struct_alignment=yes], - [emacs_cv_struct_alignment=no])]) -if test "$emacs_cv_struct_alignment" = yes; then - AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], 1, - [Define to 1 if 'struct __attribute__ ((aligned (N)))' aligns the - structure to an N-byte boundary.]) -fi - if test "${GNU_MALLOC}" = "yes" ; then AC_DEFINE(GNU_MALLOC, 1, [Define to 1 if you want to use the GNU memory allocator.]) diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 663d0fd92b9..b0348e74d47 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -248,7 +248,7 @@ of 8k bytes, and small vectors are packed into blocks of 4k bytes). @cindex storage of vector-like Lisp objects Beyond the basic vector, a lot of objects like window, buffer, and frame are managed as if they were vectors. The corresponding C data -structures include the @code{struct vectorlike_header} field whose +structures include the @code{union vectorlike_header} field whose @code{size} member contains the subtype enumerated by @code{enum pvec_type} and an information about how many @code{Lisp_Object} fields this structure contains and what the size of the rest data is. This information is @@ -1085,7 +1085,7 @@ Some of the fields of @code{struct buffer} are: @table @code @item header -A header of type @code{struct vectorlike_header} is common to all +A header of type @code{union vectorlike_header} is common to all vectorlike objects. @item own_text diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 9bd75b91e46..022c3f5b370 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2017-09-16.10} +\def\texinfoversion{2017-09-11.18} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -11425,9 +11425,11 @@ directory should work if nowhere else does.} % \dimen0 = #1\relax \advance\dimen0 by \voffset + \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page % \dimen2 = \hsize \advance\dimen2 by \normaloffset + \advance\dimen2 by 1in % reference point is 1 inch from left edge of page % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index ff84df94a69..9e4755b63ac 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -667,9 +667,7 @@ close_emacs_globals (ptrdiff_t num_symbols) "#ifndef DEFINE_SYMBOLS\n" "extern\n" "#endif\n" - "struct {\n" - " struct GCALIGNED Lisp_Symbol s;\n" - "} lispsym[%td];\n"), + "struct Lisp_Symbol lispsym[%td];\n"), num_symbols); } diff --git a/lib/faccessat.c b/lib/faccessat.c index 6cf9c99df20..fa9235820dc 100644 --- a/lib/faccessat.c +++ b/lib/faccessat.c @@ -16,10 +16,31 @@ /* written by Eric Blake */ +/* If the user's config.h happens to include , let it include only + the system's here, so that orig_faccessat doesn't recurse to + rpl_faccessat. */ +#define _GL_INCLUDING_UNISTD_H #include #include +#include #include +#include +#include +#undef _GL_INCLUDING_UNISTD_H + +#if HAVE_FACCESSAT +static int +orig_faccessat (int fd, char const *name, int mode, int flag) +{ + return faccessat (fd, name, mode, flag); +} +#endif + +/* Write "unistd.h" here, not , otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include + above. */ +#include "unistd.h" #ifndef HAVE_ACCESS /* Mingw lacks access, but it also lacks real vs. effective ids, so @@ -28,6 +49,29 @@ # define access euidaccess #endif +#if HAVE_FACCESSAT + +int +rpl_faccessat (int fd, char const *file, int mode, int flag) +{ + int result = orig_faccessat (fd, file, mode, flag); + + if (result == 0 && file[strlen (file) - 1] == '/') + { + struct stat st; + result = fstatat (fd, file, &st, 0); + if (result == 0 && !S_ISDIR (st.st_mode)) + { + errno = ENOTDIR; + return -1; + } + } + + return result; +} + +#else /* !HAVE_FACCESSAT */ + /* Invoke access or euidaccess on file, FILE, using mode MODE, in the directory open on descriptor FD. If possible, do it without changing the working directory. Otherwise, resort to using save_cwd/fchdir, then @@ -36,10 +80,12 @@ Note that this implementation only supports AT_EACCESS, although some native versions also support AT_SYMLINK_NOFOLLOW. */ -#define AT_FUNC_NAME faccessat -#define AT_FUNC_F1 euidaccess -#define AT_FUNC_F2 access -#define AT_FUNC_USE_F1_COND AT_EACCESS -#define AT_FUNC_POST_FILE_PARAM_DECLS , int mode, int flag -#define AT_FUNC_POST_FILE_ARGS , mode -#include "at-func.c" +# define AT_FUNC_NAME faccessat +# define AT_FUNC_F1 euidaccess +# define AT_FUNC_F2 access +# define AT_FUNC_USE_F1_COND AT_EACCESS +# define AT_FUNC_POST_FILE_PARAM_DECLS , int mode, int flag +# define AT_FUNC_POST_FILE_ARGS , mode +# include "at-func.c" + +#endif diff --git a/lib/fstatat.c b/lib/fstatat.c index 67e48d95d71..294861f51b1 100644 --- a/lib/fstatat.c +++ b/lib/fstatat.c @@ -28,7 +28,7 @@ #include #undef __need_system_sys_stat_h -#if HAVE_FSTATAT +#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG static int orig_fstatat (int fd, char const *filename, struct stat *buf, int flags) { diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index e9358a6855d..a7b33ba34e8 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -689,6 +689,7 @@ REPLACE_DIRFD = @REPLACE_DIRFD@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ REPLACE_FCNTL = @REPLACE_FCNTL@ @@ -2997,6 +2998,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ diff --git a/lib/unistd.in.h b/lib/unistd.in.h index ca8090a3526..91447835811 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -461,13 +461,25 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " #if @GNULIB_FACCESSAT@ -# if !@HAVE_FACCESSAT@ +# if @REPLACE_FACCESSAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef faccessat +# define faccessat rpl_faccessat +# endif +_GL_FUNCDECL_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag)); +# else +# if !@HAVE_FACCESSAT@ _GL_FUNCDECL_SYS (faccessat, int, (int fd, char const *file, int mode, int flag) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (faccessat, int, (int fd, char const *file, int mode, int flag)); +# endif _GL_CXXALIASWARN (faccessat); #elif defined GNULIB_POSIXCHECK # undef faccessat diff --git a/lisp/files.el b/lisp/files.el index e3a34af2dc3..ae90d19f2f2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1855,7 +1855,13 @@ The value includes abbreviation according to `directory-abbrev-alist'.") "Return a version of FILENAME shortened using `directory-abbrev-alist'. This also substitutes \"~\" for the user's home directory (unless the home directory is a root directory) and removes automounter prefixes -\(see the variable `automount-dir-prefix')." +\(see the variable `automount-dir-prefix'). + +When this function is first called, it caches the user's home +directory as a regexp in `abbreviated-home-dir', and reuses it +afterwards. Lisp programs that temporarily set the home directory +to a different value should let-bind `abbreviated-home-dir' for +the modified home directory to take effect." ;; Get rid of the prefixes added by the automounter. (save-match-data (if (and automount-dir-prefix diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 2d2540b1330..3b0613b2806 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -255,14 +255,14 @@ See `find-name-arg' to customize the arguments." (defalias 'lookfor-dired 'find-grep-dired) ;;;###autoload (defun find-grep-dired (dir regexp) - "Find files in DIR matching a regexp REGEXP and start Dired on output. + "Find files in DIR that contain matches for REGEXP and start Dired on output. The command run (after changing into DIR) is find . \\( -type f -exec `grep-program' `find-grep-options' \\ -e REGEXP {} \\; \\) -ls -where the car of the variable `find-ls-option' specifies what to -use in place of \"-ls\" as the final argument." +where the first string in the value of the variable `find-ls-option' +specifies what to use in place of \"-ls\" as the final argument." ;; Doc used to say "Thus ARG can also contain additional grep options." ;; i) Presumably ARG == REGEXP? ;; ii) No it can't have options, since it gets shell-quoted. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 8ec01e1810b..ab0204cb961 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -10740,10 +10740,8 @@ comment at the start of cc-engine.el for more info." (t ; We're at (1+ here). (cond ((progn (c-forward-syntactic-ws) - (eq (point) (1- there))) - t) - ((c-syntactic-re-search-forward c-keywords-regexp there t) - t) + (eq (point) (1- there)))) + ((c-syntactic-re-search-forward c-keywords-regexp there t)) ((c-syntactic-re-search-forward "{" there t t) (backward-char) (c-looking-at-statement-block)) @@ -10752,8 +10750,12 @@ comment at the start of cc-engine.el for more info." (cond ((c-syntactic-re-search-forward "[;,]" nil t t) (eq (char-before) ?\;)) - ((c-syntactic-re-search-forward c-keywords-regexp nil t t) - t) + ((progn (c-forward-syntactic-ws) + (eobp))) + ((c-syntactic-re-search-forward c-keywords-regexp nil t t)) + ((c-syntactic-re-search-forward "{" nil t t) + (backward-char) + (c-looking-at-statement-block)) (t nil))) (goto-char here)))) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 1930f4fc832..aac167357ec 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -318,7 +318,11 @@ region is invalid." (goto-char (point-min)) (forward-line (1- line)) (cl-flet ((fallback-bol - () (progn (back-to-indentation) (point))) + () + (back-to-indentation) + (if (eobp) + (line-beginning-position 0) + (point))) (fallback-eol (beg) (progn @@ -335,11 +339,11 @@ region is invalid." (not (= sexp-end beg)) sexp-end) (and (< (goto-char (1+ beg)) (point-max)) - (point)))) - (safe-end (or end - (fallback-eol beg)))) - (cons (if end beg (fallback-bol)) - safe-end)) + (point))))) + (if end + (cons beg end) + (cons (setq beg (fallback-bol)) + (fallback-eol beg)))) (let* ((beg (fallback-bol)) (end (fallback-eol beg))) (cons beg end))))))) diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 58541677509..8df251276b5 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el @@ -237,8 +237,8 @@ smallest." (cons 'jit-lock-bounds (cons new-beg new-end))))) (defvar-local mhtml--last-submode nil - "Record the last visited submode, so the cursor-sensor function -can function properly.") + "Record the last visited submode. +This is used by `mhtml--pre-command'.") (defvar-local mhtml--stashed-crucial-variables nil "Alist of stashed values of the crucial variables.") @@ -359,7 +359,6 @@ can function properly.") Code inside a