commit 3fd2100bff58008b1eaf48922539d914c6ce6c16 (HEAD, refs/remotes/origin/master) Author: Mattias EngdegÄrd Date: Wed Mar 6 22:50:36 2019 +0100 Rename regexp-opt argument noreorder to keep-order * doc/lispref/searching.texi (Regular Expression Functions): * lisp/emacs-lisp/regexp-opt.el (regexp-opt): Rename newly added `noreorder' argument to `keep-order', to avoid a negative in the name. Suggested by Phil Sainty (Bug#34641). diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 38e6204055..740be2a31f 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -950,7 +950,7 @@ whitespace: @end defun @cindex optimize regexp -@defun regexp-opt strings &optional paren noreorder +@defun regexp-opt strings &optional paren keep-order This function returns an efficient regular expression that will match any of the strings in the list @var{strings}. This is useful when you need to make matching or searching as fast as possible---for example, @@ -988,7 +988,7 @@ if it is necessary to ensure that a postfix operator appended to it will apply to the whole expression. @end table -The optional argument @var{noreorder}, if @code{nil} or omitted, +The optional argument @var{keep-order}, if @code{nil} or omitted, allows the returned regexp to match the strings in any order. If non-@code{nil}, the match is guaranteed to be performed in the order given, as if the strings were made into a regexp by joining them with diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index 4404b905a6..fce6a47d98 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -84,7 +84,7 @@ ;;; Code: ;;;###autoload -(defun regexp-opt (strings &optional paren noreorder) +(defun regexp-opt (strings &optional paren keep-order) "Return a regexp to match a string in the list STRINGS. Each string should be unique in STRINGS and should not contain any regexps, quoted or not. Optional PAREN specifies how the @@ -114,7 +114,7 @@ nil necessary to ensure that a postfix operator appended to it will apply to the whole expression. -The optional argument NOREORDER, if nil or omitted, allows the +The optional argument KEEP-ORDER, if nil or omitted, allows the returned regexp to match the strings in any order. If non-nil, the match is guaranteed to be performed in the order given, as if the strings were made into a regexp by joining them with the @@ -149,7 +149,7 @@ usually more efficient than that of a simplified version: (concat (or open "\\(?:") "a\\`\\)")) ;; If we cannot reorder, give up all attempts at ;; optimisation. There is room for improvement (Bug#34641). - ((and noreorder (regexp-opt--contains-prefix sorted-strings)) + ((and keep-order (regexp-opt--contains-prefix sorted-strings)) (concat (or open "\\(?:") (mapconcat #'regexp-quote strings "\\|") "\\)")) commit 870a33328123f91c2b96fbdead8b7ebadc53b9c8 Author: Paul Eggert Date: Wed Mar 6 11:04:57 2019 -0800 Fix typo in fix for Bug#33498 * src/frame.c (delete_frame): Fix typo in previous patch, which caused GCC to complain about the use of an uninitialized variable. diff --git a/src/frame.c b/src/frame.c index 3d83dc0a0d..1219569068 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2236,7 +2236,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) for at least one other frame - so make it visible and quit. */ if (!FRAME_VISIBLE_P (f1) && !FRAME_ICONIFIED_P (f1)) - Fmake_frame_visible (frame1); + Fmake_frame_visible (minibuffer_child_frame); return Qnil; } commit 2260e48d2eeaa9ea2b9c17389cc25d00f85c414c Author: Martin Rudalics Date: Wed Mar 6 14:49:00 2019 +0100 ; * lisp/window.el (fit-frame-to-buffer): Fix once more. diff --git a/lisp/window.el b/lisp/window.el index 85f2ee1e03..39f4fa139b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8225,7 +8225,7 @@ MAX-HEIGHT, MIN-HEIGHT, MAX-WIDTH and MIN-WIDTH specify bounds on the new total size of FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of `window-min-height' and `window-min-width' respectively. These arguments are specified -in the canonical character width and height of WINDOW's frame. +in the canonical character width and height of FRAME. If the optional argument ONLY is `vertically', resize the frame vertically only. If ONLY is `horizontally', resize the frame commit be147d24198479bd569e71603c1d80f579311872 Author: Michael Albinus Date: Wed Mar 6 12:06:09 2019 +0100 Handle empty strings in Tramp's expand-file-name implementations * lisp/net/tramp.el (tramp-handle-expand-file-name): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): * lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name): * lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name): Handle empty NAME. * test/lisp/net/tramp-tests.el (tramp-test01-file-name-syntax) (tramp-test01-file-name-syntax-simplified) (tramp-test01-file-name-syntax-separate): Use neutral IPv4 address. (tramp-test05-expand-file-name): Check also "." and "". diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 569fdb5561..2d8f42004a 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -883,6 +883,8 @@ file names." "Like `expand-file-name' for Tramp files." ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". (setq dir (or dir default-directory "/")) + ;; Handle empty NAME. + (when (zerop (length name)) (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) (setq name (concat (file-name-as-directory dir) name))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 58c2fe5fd3..ee16138f70 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2716,6 +2716,8 @@ If the localname part of the given file name starts with \"/../\" then the result will be a local, non-Tramp, file name." ;; If DIR is not given, use `default-directory' or "/". (setq dir (or dir default-directory "/")) + ;; Handle empty NAME. + (when (zerop (length name)) (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) (setq name (concat (file-name-as-directory dir) name))) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 64a8fa2250..e6e2485ea0 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -692,6 +692,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." "Like `expand-file-name' for Tramp files." ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". (setq dir (or dir default-directory "/")) + ;; Handle empty NAME. + (when (zerop (length name)) (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) (setq name (concat (file-name-as-directory dir) name))) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 42deaf3797..0d9e04d0bd 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -353,6 +353,8 @@ If the localname part of the given file name starts with \"/../\" then the result will be a local, non-Tramp, file name." ;; If DIR is not given, use `default-directory' or "/". (setq dir (or dir default-directory "/")) + ;; Handle empty NAME. + (when (zerop (length name)) (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) (setq name (concat (file-name-as-directory dir) name))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b35b36eac7..97ec5e174b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3069,6 +3069,8 @@ User is always nil." "Like `expand-file-name' for Tramp files." ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". (setq dir (or dir default-directory "/")) + ;; Handle empty NAME. + (when (zerop (length name)) (setq name ".")) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) (setq name (concat (file-name-as-directory dir) name))) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index f470385be9..69d5ba8b7d 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -238,8 +238,8 @@ properly. BODY shall not contain a timeout." (should (tramp-tramp-file-p "/method:user@[::1]:")) ;; Using an IPv4 mapped IPv6 address. - (should (tramp-tramp-file-p "/method:[::ffff:192.168.0.1]:")) - (should (tramp-tramp-file-p "/method:user@[::ffff:192.168.0.1]:")) + (should (tramp-tramp-file-p "/method:[::ffff:1.2.3.4]:")) + (should (tramp-tramp-file-p "/method:user@[::ffff:1.2.3.4]:")) ;; Local file name part. (should (tramp-tramp-file-p "/method:::")) @@ -268,7 +268,7 @@ properly. BODY shall not contain a timeout." (should-not (tramp-tramp-file-p "/1.2.3.4:")) (should-not (tramp-tramp-file-p "/[]:")) (should-not (tramp-tramp-file-p "/[::1]:")) - (should-not (tramp-tramp-file-p "/[::ffff:192.168.0.1]:")) + (should-not (tramp-tramp-file-p "/[::ffff:1.2.3.4]:")) (should-not (tramp-tramp-file-p "/host:/:")) (should-not (tramp-tramp-file-p "/host1|host2:")) (should-not (tramp-tramp-file-p "/user1@host1|user2@host2:")) @@ -318,8 +318,8 @@ properly. BODY shall not contain a timeout." (should (tramp-tramp-file-p "/user@[::1]:")) ;; Using an IPv4 mapped IPv6 address. - (should (tramp-tramp-file-p "/[::ffff:192.168.0.1]:")) - (should (tramp-tramp-file-p "/user@[::ffff:192.168.0.1]:")) + (should (tramp-tramp-file-p "/[::ffff:1.2.3.4]:")) + (should (tramp-tramp-file-p "/user@[::ffff:1.2.3.4]:")) ;; Local file name part. (should (tramp-tramp-file-p "/host::")) @@ -372,8 +372,8 @@ properly. BODY shall not contain a timeout." (should (tramp-tramp-file-p "/[method/user@::1]")) ;; Using an IPv4 mapped IPv6 address. - (should (tramp-tramp-file-p "/[method/::ffff:192.168.0.1]")) - (should (tramp-tramp-file-p "/[method/user@::ffff:192.168.0.1]")) + (should (tramp-tramp-file-p "/[method/::ffff:1.2.3.4]")) + (should (tramp-tramp-file-p "/[method/user@::ffff:1.2.3.4]")) ;; Local file name part. (should (tramp-tramp-file-p "/[method/]")) @@ -1988,6 +1988,18 @@ properly. BODY shall not contain a timeout." (should (string-equal (expand-file-name "/method:host:/path/../file") "/method:host:/file")) + (should + (string-equal + (expand-file-name "/method:host:/path/.") "/method:host:/path")) + (should + (string-equal + (expand-file-name "/method:host:/path/..") "/method:host:/")) + (should + (string-equal + (expand-file-name "." "/method:host:/path/") "/method:host:/path")) + (should + (string-equal + (expand-file-name "" "/method:host:/path/") "/method:host:/path")) ;; Quoting local part. (should (string-equal commit a3be45ddf43da73ce91731cfd4792abf14596637 Author: Martin Rudalics Date: Wed Mar 6 10:54:07 2019 +0100 * lisp/window.el (fit-frame-to-buffer): Make doc-string more accurate. diff --git a/lisp/window.el b/lisp/window.el index 98cdf98cda..85f2ee1e03 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8219,10 +8219,13 @@ Return 0 otherwise." (defun fit-frame-to-buffer (&optional frame max-height min-height max-width min-width only) "Adjust size of FRAME to display the contents of its buffer exactly. FRAME can be any live frame and defaults to the selected one. -Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT, -MAX-WIDTH and MIN-WIDTH specify bounds on the new total size of -FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of -`window-min-height' and `window-min-width' respectively. +Fit only if FRAME's root window is live. + +MAX-HEIGHT, MIN-HEIGHT, MAX-WIDTH and MIN-WIDTH specify bounds on +the new total size of FRAME's root window. MIN-HEIGHT and +MIN-WIDTH default to the values of `window-min-height' and +`window-min-width' respectively. These arguments are specified +in the canonical character width and height of WINDOW's frame. If the optional argument ONLY is `vertically', resize the frame vertically only. If ONLY is `horizontally', resize the frame