commit debaa72dd89eee0dffc930a7ccff742ca5a81d88 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Mon Apr 15 20:53:13 2019 -0700 Fix uninit var in widget.c * src/widget.c (EmacsFrameQueryGeometry): Avoid use of uninitialized variables ok_width, ok_height (Bug#35277). diff --git a/src/widget.c b/src/widget.c index 508974dd46..e662dd3ecd 100644 --- a/src/widget.c +++ b/src/widget.c @@ -434,21 +434,20 @@ EmacsFrameResize (Widget widget) } static XtGeometryResult -EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result) +EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, + XtWidgetGeometry *result) { - EmacsFrame ew = (EmacsFrame) widget; - int mask = request->request_mode; - Dimension ok_width, ok_height; - if (mask & (CWWidth | CWHeight)) + if (mask & (CWWidth | CWHeight) && !frame_resize_pixelwise) { - if (!frame_resize_pixelwise) - round_size_to_char (ew, - (mask & CWWidth) ? request->width : ew->core.width, - ((mask & CWHeight) ? request->height - : ew->core.height), - &ok_width, &ok_height); + EmacsFrame ew = (EmacsFrame) widget; + Dimension ok_width, ok_height; + + round_size_to_char (ew, + mask & CWWidth ? request->width : ew->core.width, + mask & CWHeight ? request->height : ew->core.height, + &ok_width, &ok_height); if ((mask & CWWidth) && (ok_width != request->width)) { result->request_mode |= CWWidth; commit a6b4c3bbeb6383c554e03a65fbdb7ee5994abdf7 Author: Paul Eggert Date: Mon Apr 15 20:23:24 2019 -0700 Remove Vparam_value_alist * src/xfaces.c (Vparam_value_alist): Remove. All uses removed. (Finternal_set_lisp_face_attribute): Simplify by using AUTO_FRAME_ARG. diff --git a/src/xfaces.c b/src/xfaces.c index c6723ebe2c..13c979db63 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -321,11 +321,6 @@ bool face_change; static bool tty_suppress_bold_inverse_default_colors_p; -/* A list of the form `((x . y))' used to avoid consing in - Finternal_set_lisp_face_attribute. */ - -static Lisp_Object Vparam_value_alist; - /* The total number of colors currently allocated. */ #ifdef GLYPH_DEBUG @@ -3348,11 +3343,8 @@ FRAME 0 means change the face on all frames, and change the default else /* Update the current frame's parameters. */ { - Lisp_Object cons; - cons = XCAR (Vparam_value_alist); - XSETCAR (cons, param); - XSETCDR (cons, value); - Fmodify_frame_parameters (frame, Vparam_value_alist); + AUTO_FRAME_ARG (arg, param, value); + Fmodify_frame_parameters (frame, arg); } } } @@ -6633,8 +6625,6 @@ syms_of_xfaces (void) /* The name of the function used to compute colors on TTYs. */ DEFSYM (Qtty_color_alist, "tty-color-alist"); - Vparam_value_alist = list1 (Fcons (Qnil, Qnil)); - staticpro (&Vparam_value_alist); Vface_alternative_font_family_alist = Qnil; staticpro (&Vface_alternative_font_family_alist); Vface_alternative_font_registry_alist = Qnil; commit 7a382383ac7912541bcceea16676ade20cc6b9ba Author: Noam Postavsky Date: Fri Apr 5 08:00:09 2019 -0400 Properly bracket concat of comment-start-skip (Bug#34805) * lisp/emacs-lisp/smie.el (smie-indent-fixindent): * lisp/cedet/semantic/doc.el (semantic-doc-snarf-comment-for-tag): * lisp/progmodes/fortran.el (fortran-previous-statement) (fortran-next-statement) (fortran-fill-statement): * lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-statement): Bracket comment-start-skip and comment-end-skip to avoid unexpected regexp operator precedence. diff --git a/lisp/cedet/semantic/doc.el b/lisp/cedet/semantic/doc.el index 5611629c14..4f98cf4102 100644 --- a/lisp/cedet/semantic/doc.el +++ b/lisp/cedet/semantic/doc.el @@ -103,7 +103,8 @@ If NOSNARF is `lex', then return the lex token." nil ;; ok, try to clean the text up. ;; Comment start thingy - (while (string-match (concat "^\\s-*" comment-start-skip) ct) + (while (string-match (concat "^\\s-*\\(?:" comment-start-skip "\\)") + ct) (setq ct (concat (substring ct 0 (match-beginning 0)) (substring ct (match-end 0))))) ;; Arbitrary punctuation at the beginning of each line. diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 92b639d71e..e0293c3cbb 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1446,9 +1446,9 @@ in order to figure out the indentation of some other (further down) point." (and (smie-indent--bolp) (save-excursion (comment-normalize-vars) - (re-search-forward (concat comment-start-skip + (re-search-forward (concat "\\(?:" comment-start-skip "\\)" "fixindent" - comment-end-skip) + "\\(?:" comment-end-skip "\\)") ;; 1+ to account for the \n comment termination. (1+ (line-end-position)) t)) (current-column))) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 152667040f..f01e866f55 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1275,7 +1275,8 @@ Directive lines are treated as comments." (concat "[ \t]*" (regexp-quote fortran-continuation-string))) (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]") - (looking-at (concat "[ \t]*" comment-start-skip))))) + (looking-at (concat "[ \t]*\\(?:" + comment-start-skip "\\)"))))) (cond ((and continue-test (not not-first-statement)) (message "Incomplete continuation statement.")) @@ -1298,7 +1299,8 @@ Directive lines are treated as comments." (or (looking-at fortran-comment-line-start-skip) (looking-at fortran-directive-re) (looking-at "[ \t]*$\\| [^ 0\n]\\|\t[1-9]") - (looking-at (concat "[ \t]*" comment-start-skip))))) + (looking-at (concat "[ \t]*\\(?:" + comment-start-skip "\\)"))))) (if (not not-last-statement) 'last-statement))) @@ -2146,7 +2148,8 @@ Always returns non-nil (to prevent `fill-paragraph' being called)." (or (looking-at "[ \t]*$") (looking-at fortran-comment-line-start-skip) (and comment-start-skip - (looking-at (concat "[ \t]*" comment-start-skip))))) + (looking-at (concat "[ \t]*\\(?:" + comment-start-skip "\\)"))))) (save-excursion ;; Find beginning of statement. (fortran-next-statement) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 1dc0c61d06..13d0cfa67e 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -6699,7 +6699,7 @@ search, and an argument indicating an interactive call." (if (and interactive (or (nth 3 state) (nth 4 state) - (looking-at (concat "[ \t]*" comment-start-skip)))) + (looking-at (concat "[ \t]*\\(?:" comment-start-skip "\\)")))) (forward-sentence (- count)) (while (> count 0) (vhdl-beginning-of-statement-1 lim) commit 74412e7dcb10909ffebb27db7d6eaffe96599810 Author: Eli Zaretskii Date: Mon Apr 15 19:11:16 2019 +0300 Minor change in a comment * test/src/callproc-tests.el (call-process-w32-debug-spawn-error): Minor copyedits of the commentary. diff --git a/test/src/callproc-tests.el b/test/src/callproc-tests.el index f351b6e214..1cad8360de 100644 --- a/test/src/callproc-tests.el +++ b/test/src/callproc-tests.el @@ -51,11 +51,12 @@ (setq internal-when-entered-debugger -1)))) (should (eq :got-error ;; NOTE: `should-error' would inhibit debugger. (condition-case-unless-debug () - ;; On Windows, "nul.FOO" act like an always-empty - ;; file for any FOO, in any directory. So this - ;; passes Emacs' test for the file's existence, - ;; and ensures we hit an error in the w32 process - ;; spawn code. + ;; On MS-Windows, "nul.FOO" resolves to the null + ;; device, and thus acts like an always-empty + ;; file, for any FOO, in any directory. So + ;; c:/null.exe passes Emacs' test for the file's + ;; existence, and ensures we hit an error in the + ;; w32 process spawn code. (call-process "c:/nul.exe") (error :got-error)))) (should have-called-debugger))) commit 3ec22997a208b8260c2a0e7a61888d7c0db4e4fd Author: Eli Zaretskii Date: Mon Apr 15 17:17:01 2019 +0300 Fix MS-Windows build broken by make-fingerprint changes * lib-src/make-fingerprint.c (fseeko) [WNDOWSNT]: Define to fseeko64 for non-MinGW64 MinGW. * lib-src/ntlib.c (stat): Fix calculation of file size. (fstat): New function, a subset of src/w32.c:fstat. This is needed because make-fingerprint.c now calls 'fstat', and the MS version will fail to produce reliable results because nt/inc/sys/stat.h redefines 'struct stat'. diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c index dc21fc2aa9..535e575132 100644 --- a/lib-src/make-fingerprint.c +++ b/lib-src/make-fingerprint.c @@ -50,6 +50,11 @@ along with GNU Emacs. If not, see . */ is really just insurance. */ #undef fopen #include + +#ifndef MINGW_W64 +# undef fseeko +# define fseeko fseeko64 +#endif #endif /* WINDOWSNT */ int diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index dbafc47da2..d992f54a0f 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c @@ -290,8 +290,8 @@ is_exec (const char * name) /* FIXME? This is in configure.ac now - is this still needed? */ #define IS_DIRECTORY_SEP(x) ((x) == '/' || (x) == '\\') -/* We need this because nt/inc/sys/stat.h defines struct stat that is - incompatible with the MS run-time libraries. */ +/* We need stat/fsfat below because nt/inc/sys/stat.h defines struct + stat that is incompatible with the MS run-time libraries. */ int stat (const char * path, struct stat * buf) { @@ -377,7 +377,9 @@ stat (const char * path, struct stat * buf) buf->st_dev = _getdrive (); buf->st_rdev = buf->st_dev; - buf->st_size = wfd.nFileSizeLow; + buf->st_size = wfd.nFileSizeHigh; + buf->st_size <<= 32; + buf->st_size += wfd.nFileSizeLow; /* Convert timestamps to Unix format. */ buf->st_mtime = convert_time (wfd.ftLastWriteTime); @@ -408,6 +410,98 @@ lstat (const char * path, struct stat * buf) return stat (path, buf); } +int +fstat (int desc, struct stat * buf) +{ + HANDLE fh = (HANDLE) _get_osfhandle (desc); + BY_HANDLE_FILE_INFORMATION info; + unsigned __int64 fake_inode; + int permission; + + if (!init) + { + /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */ + SYSTEMTIME st; + + st.wYear = 1970; + st.wMonth = 1; + st.wDay = 1; + st.wHour = 0; + st.wMinute = 0; + st.wSecond = 0; + st.wMilliseconds = 0; + + SystemTimeToFileTime (&st, &utc_base_ft); + utc_base = (long double) utc_base_ft.dwHighDateTime + * 4096.0L * 1024.0L * 1024.0L + utc_base_ft.dwLowDateTime; + init = 1; + } + + switch (GetFileType (fh) & ~FILE_TYPE_REMOTE) + { + case FILE_TYPE_DISK: + buf->st_mode = S_IFREG; + if (!GetFileInformationByHandle (fh, &info)) + { + errno = EACCES; + return -1; + } + break; + case FILE_TYPE_PIPE: + buf->st_mode = S_IFIFO; + goto non_disk; + case FILE_TYPE_CHAR: + case FILE_TYPE_UNKNOWN: + default: + buf->st_mode = S_IFCHR; + non_disk: + memset (&info, 0, sizeof (info)); + info.dwFileAttributes = 0; + info.ftCreationTime = utc_base_ft; + info.ftLastAccessTime = utc_base_ft; + info.ftLastWriteTime = utc_base_ft; + } + + if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + buf->st_mode = S_IFDIR; + + buf->st_nlink = info.nNumberOfLinks; + /* Might as well use file index to fake inode values, but this + is not guaranteed to be unique unless we keep a handle open + all the time. */ + fake_inode = info.nFileIndexHigh; + fake_inode <<= 32; + fake_inode += info.nFileIndexLow; + buf->st_ino = fake_inode; + + buf->st_dev = info.dwVolumeSerialNumber; + buf->st_rdev = info.dwVolumeSerialNumber; + + buf->st_size = info.nFileSizeHigh; + buf->st_size <<= 32; + buf->st_size += info.nFileSizeLow; + + /* Convert timestamps to Unix format. */ + buf->st_mtime = convert_time (info.ftLastWriteTime); + buf->st_atime = convert_time (info.ftLastAccessTime); + if (buf->st_atime == 0) buf->st_atime = buf->st_mtime; + buf->st_ctime = convert_time (info.ftCreationTime); + if (buf->st_ctime == 0) buf->st_ctime = buf->st_mtime; + + /* determine rwx permissions */ + if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + permission = S_IREAD; + else + permission = S_IREAD | S_IWRITE; + + if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + permission |= S_IEXEC; + + buf->st_mode |= permission | (permission >> 3) | (permission >> 6); + + return 0; +} + /* On Windows, you cannot rename into an existing file. */ int sys_rename (const char *from, const char *to) commit e29260b5f946156652c92fe77f97450c756d0367 Author: Michael Albinus Date: Mon Apr 15 13:24:55 2019 +0200 * .gitlab-ci.yml (test-filenotify-gio): Add autorevert changes. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b022e4b8af..92efcf6497 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,13 +53,15 @@ test-filenotify-gio: only: changes: - .gitlab-ci.yml + - lisp/autorevert.el - lisp/filenotify.el - lisp/net/tramp-sh.el - src/gfilenotify.c + - test/lisp/autorevert-tests.el - test/lisp/filenotify-tests.el script: - DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libglib2.0-dev libglib2.0-bin libglib2.0-0 - ./autogen.sh autoconf - ./configure --without-makeinfo --with-file-notification=gfile - make bootstrap - - make -C test filenotify-tests + - make -C test autorevert-tests filenotify-tests