Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-05-06 07:55:02 +08:00
commit 96f9fe6514
8 changed files with 32 additions and 33 deletions

View file

@ -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

View file

@ -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

View file

@ -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))

View file

@ -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)))

View file

@ -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))))

View file

@ -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)

View file

@ -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)))

View file

@ -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))))