diff --git a/build-aux/git-hooks/post-commit b/build-aux/git-hooks/post-commit index 10f43b539ac..e02fee48db4 100755 --- a/build-aux/git-hooks/post-commit +++ b/build-aux/git-hooks/post-commit @@ -34,7 +34,7 @@ ### Code: -HOOKS_DIR=$(dirname $0) +HOOKS_DIR=`dirname "$0"` # Prefer gawk if available, as it handles NUL bytes properly. if type gawk >/dev/null 2>&1; then @@ -44,4 +44,4 @@ else fi git rev-parse HEAD | $awk -v reason=post-commit \ - -f $HOOKS_DIR/commit-msg-files.awk + -f "$HOOKS_DIR"/commit-msg-files.awk diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push index 8d5dde2bbaf..a342814c1e3 100755 --- a/build-aux/git-hooks/pre-push +++ b/build-aux/git-hooks/pre-push @@ -31,7 +31,7 @@ ### Code: -HOOKS_DIR=$(dirname $0) +HOOKS_DIR=`dirname "$0"` # Prefer gawk if available, as it handles NUL bytes properly. if type gawk >/dev/null 2>&1; then @@ -85,4 +85,4 @@ $awk -v origin_name="$1" ' # Print every SHA after oldref, up to (and including) newref. system("git rev-list --first-parent --reverse " oldref ".." newref) } -' | $awk -v reason=pre-push -f $HOOKS_DIR/commit-msg-files.awk +' | $awk -v reason=pre-push -f "$HOOKS_DIR"/commit-msg-files.awk diff --git a/lisp/dired.el b/lisp/dired.el index 1c8d011d765..e70467ca53b 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1647,9 +1647,9 @@ If HDR is non-nil, insert a header line with the directory name." ;; save the answer in `dired-use-ls-dired'. (or (setq dired-use-ls-dired (eq 0 (call-process insert-directory-program - nil nil nil "--dired"))) + nil nil nil "--dired" "-N"))) (progn - (message "ls does not support --dired; \ + (message "ls does not support --dired -N; \ see `dired-use-ls-dired' for more details.") nil)) dired-use-ls-dired))) @@ -1665,7 +1665,7 @@ see `dired-use-ls-dired' for more details.") ;; "--dired", so we cannot add it to the `process-file' ;; call for wildcards. (when (file-remote-p dir) - (setq switches (string-replace "--dired" "" switches))) + (setq switches (string-replace "--dired -N" "" switches))) (let* ((default-directory (car dir-wildcard)) (script (format "ls %s %s" switches (cdr dir-wildcard))) (remotep (file-remote-p dir)) diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 0f7a3cb2665..8fe5066c49e 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -221,21 +221,17 @@ for speeding up processing.") (defun byte-optimize--substitutable-p (expr) "Whether EXPR is a constant that can be propagated." - ;; Only consider numbers, symbols and strings to be values for substitution - ;; purposes. Numbers and symbols are immutable, and mutating string - ;; literals (or results from constant-evaluated string-returning functions) - ;; can be considered undefined. - ;; (What about other quoted values, like conses?) (or (booleanp expr) (numberp expr) - (stringp expr) - (and (consp expr) - (or (and (memq (car expr) '(quote function)) - (symbolp (cadr expr))) - ;; (internal-get-closed-var N) can be considered constant for - ;; const-prop purposes. - (and (eq (car expr) 'internal-get-closed-var) - (integerp (cadr expr))))) + (arrayp expr) + (let ((head (car-safe expr))) + (cond ((eq head 'quote) t) + ;; Don't substitute #'(lambda ...) since that would enable + ;; uncontrolled inlining. + ((eq head 'function) (symbolp (cadr expr))) + ;; (internal-get-closed-var N) can be considered constant for + ;; const-prop purposes. + ((eq head 'internal-get-closed-var) (integerp (cadr expr))))) (keywordp expr))) (defmacro byte-optimize--pcase (exp &rest cases) @@ -469,10 +465,6 @@ for speeding up processing.") form (byte-optimize-form newform for-effect)))) - ;; FIXME: Strictly speaking, I think this is a bug: (closure...) - ;; is a *value* and shouldn't appear in the car. - (`((closure . ,_) . ,_) form) - (`(setq ,var ,expr) (let ((lexvar (assq var byte-optimize--lexvars)) (value (byte-optimize-form expr nil))) @@ -500,7 +492,7 @@ for speeding up processing.") (cons fn (mapcar #'byte-optimize-form exps))) (`(,(pred (not symbolp)) . ,_) - (byte-compile-warn-x fn "`%s' is a malformed function" fn) + (byte-compile-warn-x form "`%s' is a malformed function" fn) form) ((guard (when for-effect @@ -1420,10 +1412,13 @@ See Info node `(elisp) Integer Basics'." (defun byte-optimize-funcall (form) - ;; (funcall (lambda ...) ...) ==> ((lambda ...) ...) - ;; (funcall foo ...) ==> (foo ...) - (let ((fn (nth 1 form))) - (if (memq (car-safe fn) '(quote function)) + ;; (funcall #'(lambda ...) ...) -> ((lambda ...) ...) + ;; (funcall #'SYM ...) -> (SYM ...) + ;; (funcall 'SYM ...) -> (SYM ...) + (let* ((fn (nth 1 form)) + (head (car-safe fn))) + (if (or (eq head 'function) + (and (eq head 'quote) (symbolp (nth 1 fn)))) (cons (nth 1 fn) (cdr (cdr form))) form))) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 6ed2cbe395c..e6fdd1f1836 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -427,7 +427,10 @@ if that doesn't produce a completion match." for (cat . alist) in completion-category-defaults collect `(,cat . ,(cl-loop for entry in alist for (prop . val) = entry - if (eq prop 'styles) + if (and (eq prop 'styles) + ;; Never step in front of 'external', as that + ;; might lose us completions. + (not (memq 'external val))) collect `(,prop . (flex ,@(delq 'flex val))) else collect entry)))) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1c20a27801d..16ec33f92dc 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4242,6 +4242,7 @@ directory, so that Emacs will know its current contents." ((eq identification 'user) user) ((eq identification 'host) host) ((eq identification 'localname) localname) + ((eq identification 'hop) nil) (t (ange-ftp-replace-name-component file "")))))) (defun ange-ftp-load (file &optional noerror nomessage nosuffix must-suffix) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 94fbc588b5d..d020615af07 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2566,7 +2566,7 @@ The method used must be an out-of-band method." (setq switches (append switches (split-string (tramp-sh--quoting-style-options v)))) (unless (tramp-get-ls-command-with v "--dired") - (setq switches (delete "--dired" switches))) + (setq switches (delete "-N" (delete "--dired" switches)))) (when wildcard (setq wildcard (tramp-run-real-handler #'file-name-nondirectory (list localname))) diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index 4e1a0fd63a2..b14731c4d0a 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -530,7 +530,7 @@ (ert-deftest old-struct () (cl-defstruct foo x) - (let ((x [cl-struct-foo]) + (let ((x (vector 'cl-struct-foo)) (saved cl-old-struct-compat-mode)) (cl-old-struct-compat-mode -1) (should (eq (type-of x) 'vector)) @@ -540,7 +540,7 @@ (let ((cl-struct-foo (cl--struct-get-class 'foo))) (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check) (should (eq (type-of x) 'foo)) - (should (eq (type-of [foo]) 'vector))) + (should (eq (type-of (vector 'foo)) 'vector))) (cl-old-struct-compat-mode (if saved 1 -1))))