commit 8f9d93f3054a5a99a760101fa81a013c67d52f58 (HEAD, refs/remotes/origin/master) Author: Dmitry Gutov Date: Sat Dec 29 02:13:54 2018 +0200 project-find-file: Move the common parent directory to the prompt * lisp/progmodes/project.el (project--completing-read-strict): Extract the common parent directory of all files first (https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00444.html). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index f3f29cbac9..628694450f 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -401,23 +401,38 @@ recognized." ;; removing it when it has no matches. Neither seems natural ;; enough. Removal is confusing; early expansion makes the prompt ;; too long. - (let* (;; (initial-input - ;; (let ((common-prefix (try-completion "" collection))) - ;; (if (> (length common-prefix) 0) - ;; (file-name-directory common-prefix)))) + (let* ((common-parent-directory + (let ((common-prefix (try-completion "" collection))) + (if (> (length common-prefix) 0) + (file-name-directory common-prefix)))) + (cpd-length (length common-parent-directory)) + (prompt (if (zerop cpd-length) + prompt + (concat prompt (format " in %s" common-parent-directory)))) + ;; XXX: This requires collection to be "flat" as well. + (substrings (mapcar (lambda (s) (substring s cpd-length)) + (all-completions "" collection))) + (new-collection + (lambda (string pred action) + (cond + ((eq action 'metadata) + (if (functionp collection) (funcall collection nil nil 'metadata))) + (t + (complete-with-action action substrings string pred))))) (new-prompt (if default (format "%s (default %s): " prompt default) (format "%s: " prompt))) (res (completing-read new-prompt - collection predicate t + new-collection predicate t nil ;; initial-input hist default inherit-input-method))) - (if (and (equal res default) - (not (test-completion res collection predicate))) - (completing-read (format "%s: " prompt) - collection predicate t res hist nil - inherit-input-method) - res))) + (when (and (equal res default) + (not (test-completion res collection predicate))) + (setq res + (completing-read (format "%s: " prompt) + new-collection predicate t res hist nil + inherit-input-method))) + (concat common-parent-directory res))) (declare-function multifile-continue "multifile" ()) commit cf62106878ef76592a90fbe584927003b5420f99 Author: Michael Albinus Date: Fri Dec 28 10:22:42 2018 +0100 * lisp/net/tramp-sh.el (tramp-set-remote-path): Handle platforms w/o getconf. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 789d16cd06..991a210263 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3960,8 +3960,10 @@ variable PATH." (format "PATH=%s; export PATH" (mapconcat 'identity (tramp-get-remote-path vec) ":"))) (pipe-buf - (with-tramp-connection-property vec "pipe-buf" - (tramp-send-command-and-read vec "getconf PIPE_BUF /"))) + (or (with-tramp-connection-property vec "pipe-buf" + (tramp-send-command-and-read + vec "getconf PIPE_BUF / 2>/dev/null || echo nil" 'noerror)) + 4096)) tmpfile) (tramp-message vec 5 "Setting $PATH environment variable") (if (< (length command) pipe-buf) commit 8167316fd6406adbeb8fe91db9ee59e2f47bddb0 Author: Paul Eggert Date: Thu Dec 27 21:55:01 2018 -0800 Improve motivations in gomoku messages * lisp/play/gomoku.el (gomoku-terminate-game): Don't make six-year-old children cry (Bug#33803). diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index 6ce2750f86..32b29b70f4 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -656,48 +656,48 @@ that DVAL has been added on SQUARE." ((eq result 'emacs-won) (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) (cond ((< gomoku-number-of-moves 20) - "This was a REALLY QUICK win.") + "I won... I hope you like the game as you get better.") (gomoku-human-refused-draw "I won... Too bad you refused my offer of a draw!") (gomoku-human-took-back - "I won... Taking moves back will not help you!") + "I won... It's OK to take back more moves next time.") ((not gomoku-emacs-played-first) - "I won... Playing first did not help you much!") + "I won... Use C-c C-b to take back a move on second thought.") ((and (zerop gomoku-number-of-human-wins) (zerop gomoku-number-of-draws) (> gomoku-number-of-emacs-wins 1)) - "I'm becoming tired of winning...") + "I won... It might be time take a break before trying again.") ("I won."))) ((eq result 'human-won) (setq gomoku-number-of-human-wins (1+ gomoku-number-of-human-wins)) (concat "OK, you won this one." (cond (gomoku-human-took-back - " I, for one, never take my moves back...") + " For a bigger challenge, play without taking moves back.") (gomoku-emacs-played-first - ".. so what?") - (" Now, let me play first just once.")))) + " Congratulations!") + (" For a bigger challenge, let me play first.")))) ((eq result 'human-resigned) (setq gomoku-number-of-emacs-wins (1+ gomoku-number-of-emacs-wins)) - "So you resign. That's just one more win for me.") + "I see that you resigned. Better luck next time.") ((eq result 'nobody-won) (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) (concat "This is a draw. " (cond (gomoku-human-took-back - "I, for one, never take my moves back...") + " For a bigger challenge, try without taking moves back.") (gomoku-emacs-played-first - "Just chance, I guess.") - ("Now, let me play first just once.")))) + "Wow, that was a long game. We both played well.") + (" For a bigger challenge, let me play first.")))) ((eq result 'draw-agreed) (setq gomoku-number-of-draws (1+ gomoku-number-of-draws)) (concat "Draw agreed. " (cond (gomoku-human-took-back - "I, for one, never take my moves back...") + " For a bigger challenge, try without taking moves back.") (gomoku-emacs-played-first - "You were lucky.") - ("Now, let me play first just once.")))) + "Good game.") + (" For a bigger challenge, let me play first.")))) ((eq result 'crash-game) "Sorry, I have been interrupted and cannot resume that game..."))) (gomoku-display-statistics) commit 47d656f6024786dfdaf53be1c6db6a47b8666b7f Author: Paul Pogonyshev Date: Thu Dec 27 20:10:47 2018 -0800 Accept 1-arg 'substring' calls in byte compiler Those have been supported by the function implementation since commit 2014-03-31T12:06:34Z!dmantipov@yandex.ru (Bug#33807). * lisp/emacs-lisp/bytecomp.el: substring has 1-3 args, not 2-3. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index c0a764bafc..43f2289ab7 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3534,7 +3534,7 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\"" (byte-defop-compiler (>= byte-geq) 2-and) (byte-defop-compiler get 2) (byte-defop-compiler nth 2) -(byte-defop-compiler substring 2-3) +(byte-defop-compiler substring 1-3) (byte-defop-compiler (move-marker byte-set-marker) 2-3) (byte-defop-compiler set-marker 2-3) (byte-defop-compiler match-beginning 1) commit ee7514b91beb254a7dc62f618046d34036555cea Author: Paul Eggert Date: Thu Dec 27 11:45:21 2018 -0800 Update from Gnulib * build-aux/config.guess, lib/regcomp.c, lib/regex.c: * lib/regex_internal.h, lib/regexec.c: Copy from Gnulib. diff --git a/build-aux/config.guess b/build-aux/config.guess index 94c4ac154a..28bec27b30 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -391,15 +391,20 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - case `isainfo -b` in - 32) - echo i386-pc-solaris2"$UNAME_REL" - ;; - 64) - echo x86_64-pc-solaris2"$UNAME_REL" - ;; - esac + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize diff --git a/lib/regcomp.c b/lib/regcomp.c index 0b05a63b63..2672ffcc37 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length, return NULL; return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); } -#ifdef _LIBC weak_alias (__re_compile_pattern, re_compile_pattern) -#endif /* Set by 're_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own @@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax) re_syntax_options = syntax; return ret; } -#ifdef _LIBC weak_alias (__re_set_syntax, re_set_syntax) -#endif int re_compile_fastmap (struct re_pattern_buffer *bufp) @@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) bufp->fastmap_accurate = 1; return 0; } -#ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) -#endif static inline void __attribute__ ((always_inline)) @@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, the return codes and their meanings.) */ int -regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) +regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags) { reg_errcode_t ret; reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED @@ -515,16 +509,14 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) return (int) ret; } -#ifdef _LIBC libc_hidden_def (__regcomp) weak_alias (__regcomp, regcomp) -#endif /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, +regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, size_t errbuf_size) { const char *msg; @@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, return msg_size; } -#ifdef _LIBC weak_alias (__regerror, regerror) -#endif #ifdef RE_ENABLE_I18N @@ -657,10 +647,8 @@ regfree (regex_t *preg) re_free (preg->translate); preg->translate = NULL; } -#ifdef _LIBC libc_hidden_def (__regfree) weak_alias (__regfree, regfree) -#endif /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ diff --git a/lib/regex.c b/lib/regex.c index 2a86e10703..1fccd99f33 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -20,10 +20,10 @@ #ifndef _LIBC # include -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 6) # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" # endif -# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 3) # pragma GCC diagnostic ignored "-Wold-style-definition" # pragma GCC diagnostic ignored "-Wtype-limits" # endif diff --git a/lib/regex_internal.h b/lib/regex_internal.h index b0e49cd828..2c5ca29fef 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -144,10 +144,9 @@ # define __mbrtowc mbrtowc # define __wcrtomb wcrtomb # define __regfree regfree -# define attribute_hidden #endif /* not _LIBC */ -#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1) +#if !__GNUC_PREREQ (3, 1) # define __attribute__(arg) #endif @@ -868,15 +867,6 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx) } #endif /* RE_ENABLE_I18N */ -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - #if __GNUC_PREREQ (3,4) # undef __attribute_warn_unused_result__ # define __attribute_warn_unused_result__ \ diff --git a/lib/regexec.c b/lib/regexec.c index c7d099c38e..5f682695c4 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -189,7 +189,7 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len); We return 0 if we find a match and REG_NOMATCH if not. */ int -regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string, +regexec (const regex_t *__restrict preg, const char *__restrict string, size_t nmatch, regmatch_t pmatch[], int eflags) { reg_errcode_t err; @@ -232,8 +232,8 @@ __typeof__ (__regexec) __compat_regexec; int attribute_compat_text_section -__compat_regexec (const regex_t *_Restrict_ preg, - const char *_Restrict_ string, size_t nmatch, +__compat_regexec (const regex_t *__restrict preg, + const char *__restrict string, size_t nmatch, regmatch_t pmatch[], int eflags) { return regexec (preg, string, nmatch, pmatch, commit a8576aba8fa45549985566bc8be4921dce508dd9 Author: Eli Zaretskii Date: Thu Dec 27 18:52:30 2018 +0200 Avoid assertion violation in directory-files * src/dired.c (directory_files_internal): Make sure MATCH is either nil or a string. (Bug#33889) diff --git a/src/dired.c b/src/dired.c index b81e35384e..3f5c93b573 100644 --- a/src/dired.c +++ b/src/dired.c @@ -236,6 +236,9 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, #endif ; + if (!NILP (match)) + CHECK_STRING (match); + /* Loop reading directory entries. */ for (struct dirent *dp; (dp = read_dirent (d, directory)); ) { commit 13dfe15ef4bc63ce66daffdc502a92aa9be44d92 Author: Michael Albinus Date: Thu Dec 27 12:24:24 2018 +0100 Bump Tramp version to 2.4.1 * doc/misc/trampver.texi: * lisp/net/tramp.el: * lisp/net/trampver.el: Change version to "2.4.1". diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index aac7243446..af7b6786a6 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -7,7 +7,7 @@ @c In the Tramp GIT, the version number is auto-frobbed from tramp.el, @c and the bug report address is auto-frobbed from configure.ac. -@set trampver 2.4.1-pre +@set trampver 2.4.1 @set tramp-bug-report-address tramp-devel@@gnu.org @c Other flags from configuration. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3ec3d60873..c6ec59a4ab 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.4.1-pre +;; Version: 2.4.1 ;; Package-Requires: ((emacs "24.1")) ;; This file is part of GNU Emacs. diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index b8684da8cf..a59f3c6d74 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -31,7 +31,7 @@ ;; aclocal.m4; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.4.1-pre" +(defconst tramp-version "2.4.1" "This version of Tramp.") ;;;###tramp-autoload @@ -65,7 +65,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-lessp emacs-version "24.1")) "ok" - (format "Tramp 2.4.1-pre is not fit for %s" + (format "Tramp 2.4.1 is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x)))