diff options
| author | Po Lu | 2023-05-06 07:55:02 +0800 |
|---|---|---|
| committer | Po Lu | 2023-05-06 07:55:02 +0800 |
| commit | 96f9fe6514a2139373c50e19a77fd217ef62e6ef (patch) | |
| tree | 8227f00dfe25e470b9ef5bfaf12a250e457cd4f8 | |
| parent | 0fbe79727b07879cb4f0a5cb8d7288353c082bd0 (diff) | |
| parent | 1ef219e220c9645a5592eb73837aba8d50e4265c (diff) | |
| download | emacs-96f9fe6514a2139373c50e19a77fd217ef62e6ef.tar.gz emacs-96f9fe6514a2139373c50e19a77fd217ef62e6ef.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
| -rwxr-xr-x | build-aux/git-hooks/post-commit | 4 | ||||
| -rwxr-xr-x | build-aux/git-hooks/pre-push | 4 | ||||
| -rw-r--r-- | lisp/dired.el | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 39 | ||||
| -rw-r--r-- | lisp/icomplete.el | 5 | ||||
| -rw-r--r-- | lisp/net/ange-ftp.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 2 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-lib-tests.el | 4 |
8 files changed, 32 insertions, 33 deletions
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 @@ | |||
| 34 | 34 | ||
| 35 | ### Code: | 35 | ### Code: |
| 36 | 36 | ||
| 37 | HOOKS_DIR=$(dirname $0) | 37 | HOOKS_DIR=`dirname "$0"` |
| 38 | 38 | ||
| 39 | # Prefer gawk if available, as it handles NUL bytes properly. | 39 | # Prefer gawk if available, as it handles NUL bytes properly. |
| 40 | if type gawk >/dev/null 2>&1; then | 40 | if type gawk >/dev/null 2>&1; then |
| @@ -44,4 +44,4 @@ else | |||
| 44 | fi | 44 | fi |
| 45 | 45 | ||
| 46 | git rev-parse HEAD | $awk -v reason=post-commit \ | 46 | git rev-parse HEAD | $awk -v reason=post-commit \ |
| 47 | -f $HOOKS_DIR/commit-msg-files.awk | 47 | -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 @@ | |||
| 31 | 31 | ||
| 32 | ### Code: | 32 | ### Code: |
| 33 | 33 | ||
| 34 | HOOKS_DIR=$(dirname $0) | 34 | HOOKS_DIR=`dirname "$0"` |
| 35 | 35 | ||
| 36 | # Prefer gawk if available, as it handles NUL bytes properly. | 36 | # Prefer gawk if available, as it handles NUL bytes properly. |
| 37 | if type gawk >/dev/null 2>&1; then | 37 | if type gawk >/dev/null 2>&1; then |
| @@ -85,4 +85,4 @@ $awk -v origin_name="$1" ' | |||
| 85 | # Print every SHA after oldref, up to (and including) newref. | 85 | # Print every SHA after oldref, up to (and including) newref. |
| 86 | system("git rev-list --first-parent --reverse " oldref ".." newref) | 86 | system("git rev-list --first-parent --reverse " oldref ".." newref) |
| 87 | } | 87 | } |
| 88 | ' | $awk -v reason=pre-push -f $HOOKS_DIR/commit-msg-files.awk | 88 | ' | $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." | |||
| 1647 | ;; save the answer in `dired-use-ls-dired'. | 1647 | ;; save the answer in `dired-use-ls-dired'. |
| 1648 | (or (setq dired-use-ls-dired | 1648 | (or (setq dired-use-ls-dired |
| 1649 | (eq 0 (call-process insert-directory-program | 1649 | (eq 0 (call-process insert-directory-program |
| 1650 | nil nil nil "--dired"))) | 1650 | nil nil nil "--dired" "-N"))) |
| 1651 | (progn | 1651 | (progn |
| 1652 | (message "ls does not support --dired; \ | 1652 | (message "ls does not support --dired -N; \ |
| 1653 | see `dired-use-ls-dired' for more details.") | 1653 | see `dired-use-ls-dired' for more details.") |
| 1654 | nil)) | 1654 | nil)) |
| 1655 | dired-use-ls-dired))) | 1655 | dired-use-ls-dired))) |
| @@ -1665,7 +1665,7 @@ see `dired-use-ls-dired' for more details.") | |||
| 1665 | ;; "--dired", so we cannot add it to the `process-file' | 1665 | ;; "--dired", so we cannot add it to the `process-file' |
| 1666 | ;; call for wildcards. | 1666 | ;; call for wildcards. |
| 1667 | (when (file-remote-p dir) | 1667 | (when (file-remote-p dir) |
| 1668 | (setq switches (string-replace "--dired" "" switches))) | 1668 | (setq switches (string-replace "--dired -N" "" switches))) |
| 1669 | (let* ((default-directory (car dir-wildcard)) | 1669 | (let* ((default-directory (car dir-wildcard)) |
| 1670 | (script (format "ls %s %s" switches (cdr dir-wildcard))) | 1670 | (script (format "ls %s %s" switches (cdr dir-wildcard))) |
| 1671 | (remotep (file-remote-p dir)) | 1671 | (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.") | |||
| 221 | 221 | ||
| 222 | (defun byte-optimize--substitutable-p (expr) | 222 | (defun byte-optimize--substitutable-p (expr) |
| 223 | "Whether EXPR is a constant that can be propagated." | 223 | "Whether EXPR is a constant that can be propagated." |
| 224 | ;; Only consider numbers, symbols and strings to be values for substitution | ||
| 225 | ;; purposes. Numbers and symbols are immutable, and mutating string | ||
| 226 | ;; literals (or results from constant-evaluated string-returning functions) | ||
| 227 | ;; can be considered undefined. | ||
| 228 | ;; (What about other quoted values, like conses?) | ||
| 229 | (or (booleanp expr) | 224 | (or (booleanp expr) |
| 230 | (numberp expr) | 225 | (numberp expr) |
| 231 | (stringp expr) | 226 | (arrayp expr) |
| 232 | (and (consp expr) | 227 | (let ((head (car-safe expr))) |
| 233 | (or (and (memq (car expr) '(quote function)) | 228 | (cond ((eq head 'quote) t) |
| 234 | (symbolp (cadr expr))) | 229 | ;; Don't substitute #'(lambda ...) since that would enable |
| 235 | ;; (internal-get-closed-var N) can be considered constant for | 230 | ;; uncontrolled inlining. |
| 236 | ;; const-prop purposes. | 231 | ((eq head 'function) (symbolp (cadr expr))) |
| 237 | (and (eq (car expr) 'internal-get-closed-var) | 232 | ;; (internal-get-closed-var N) can be considered constant for |
| 238 | (integerp (cadr expr))))) | 233 | ;; const-prop purposes. |
| 234 | ((eq head 'internal-get-closed-var) (integerp (cadr expr))))) | ||
| 239 | (keywordp expr))) | 235 | (keywordp expr))) |
| 240 | 236 | ||
| 241 | (defmacro byte-optimize--pcase (exp &rest cases) | 237 | (defmacro byte-optimize--pcase (exp &rest cases) |
| @@ -469,10 +465,6 @@ for speeding up processing.") | |||
| 469 | form | 465 | form |
| 470 | (byte-optimize-form newform for-effect)))) | 466 | (byte-optimize-form newform for-effect)))) |
| 471 | 467 | ||
| 472 | ;; FIXME: Strictly speaking, I think this is a bug: (closure...) | ||
| 473 | ;; is a *value* and shouldn't appear in the car. | ||
| 474 | (`((closure . ,_) . ,_) form) | ||
| 475 | |||
| 476 | (`(setq ,var ,expr) | 468 | (`(setq ,var ,expr) |
| 477 | (let ((lexvar (assq var byte-optimize--lexvars)) | 469 | (let ((lexvar (assq var byte-optimize--lexvars)) |
| 478 | (value (byte-optimize-form expr nil))) | 470 | (value (byte-optimize-form expr nil))) |
| @@ -500,7 +492,7 @@ for speeding up processing.") | |||
| 500 | (cons fn (mapcar #'byte-optimize-form exps))) | 492 | (cons fn (mapcar #'byte-optimize-form exps))) |
| 501 | 493 | ||
| 502 | (`(,(pred (not symbolp)) . ,_) | 494 | (`(,(pred (not symbolp)) . ,_) |
| 503 | (byte-compile-warn-x fn "`%s' is a malformed function" fn) | 495 | (byte-compile-warn-x form "`%s' is a malformed function" fn) |
| 504 | form) | 496 | form) |
| 505 | 497 | ||
| 506 | ((guard (when for-effect | 498 | ((guard (when for-effect |
| @@ -1420,10 +1412,13 @@ See Info node `(elisp) Integer Basics'." | |||
| 1420 | 1412 | ||
| 1421 | 1413 | ||
| 1422 | (defun byte-optimize-funcall (form) | 1414 | (defun byte-optimize-funcall (form) |
| 1423 | ;; (funcall (lambda ...) ...) ==> ((lambda ...) ...) | 1415 | ;; (funcall #'(lambda ...) ...) -> ((lambda ...) ...) |
| 1424 | ;; (funcall foo ...) ==> (foo ...) | 1416 | ;; (funcall #'SYM ...) -> (SYM ...) |
| 1425 | (let ((fn (nth 1 form))) | 1417 | ;; (funcall 'SYM ...) -> (SYM ...) |
| 1426 | (if (memq (car-safe fn) '(quote function)) | 1418 | (let* ((fn (nth 1 form)) |
| 1419 | (head (car-safe fn))) | ||
| 1420 | (if (or (eq head 'function) | ||
| 1421 | (and (eq head 'quote) (symbolp (nth 1 fn)))) | ||
| 1427 | (cons (nth 1 fn) (cdr (cdr form))) | 1422 | (cons (nth 1 fn) (cdr (cdr form))) |
| 1428 | form))) | 1423 | form))) |
| 1429 | 1424 | ||
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." | |||
| 427 | for (cat . alist) in completion-category-defaults collect | 427 | for (cat . alist) in completion-category-defaults collect |
| 428 | `(,cat . ,(cl-loop | 428 | `(,cat . ,(cl-loop |
| 429 | for entry in alist for (prop . val) = entry | 429 | for entry in alist for (prop . val) = entry |
| 430 | if (eq prop 'styles) | 430 | if (and (eq prop 'styles) |
| 431 | ;; Never step in front of 'external', as that | ||
| 432 | ;; might lose us completions. | ||
| 433 | (not (memq 'external val))) | ||
| 431 | collect `(,prop . (flex ,@(delq 'flex val))) | 434 | collect `(,prop . (flex ,@(delq 'flex val))) |
| 432 | else collect entry)))) | 435 | else collect entry)))) |
| 433 | 436 | ||
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." | |||
| 4242 | ((eq identification 'user) user) | 4242 | ((eq identification 'user) user) |
| 4243 | ((eq identification 'host) host) | 4243 | ((eq identification 'host) host) |
| 4244 | ((eq identification 'localname) localname) | 4244 | ((eq identification 'localname) localname) |
| 4245 | ((eq identification 'hop) nil) | ||
| 4245 | (t (ange-ftp-replace-name-component file "")))))) | 4246 | (t (ange-ftp-replace-name-component file "")))))) |
| 4246 | 4247 | ||
| 4247 | (defun ange-ftp-load (file &optional noerror nomessage nosuffix must-suffix) | 4248 | (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." | |||
| 2566 | (setq switches | 2566 | (setq switches |
| 2567 | (append switches (split-string (tramp-sh--quoting-style-options v)))) | 2567 | (append switches (split-string (tramp-sh--quoting-style-options v)))) |
| 2568 | (unless (tramp-get-ls-command-with v "--dired") | 2568 | (unless (tramp-get-ls-command-with v "--dired") |
| 2569 | (setq switches (delete "--dired" switches))) | 2569 | (setq switches (delete "-N" (delete "--dired" switches)))) |
| 2570 | (when wildcard | 2570 | (when wildcard |
| 2571 | (setq wildcard (tramp-run-real-handler | 2571 | (setq wildcard (tramp-run-real-handler |
| 2572 | #'file-name-nondirectory (list localname))) | 2572 | #'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 @@ | |||
| 530 | 530 | ||
| 531 | (ert-deftest old-struct () | 531 | (ert-deftest old-struct () |
| 532 | (cl-defstruct foo x) | 532 | (cl-defstruct foo x) |
| 533 | (let ((x [cl-struct-foo]) | 533 | (let ((x (vector 'cl-struct-foo)) |
| 534 | (saved cl-old-struct-compat-mode)) | 534 | (saved cl-old-struct-compat-mode)) |
| 535 | (cl-old-struct-compat-mode -1) | 535 | (cl-old-struct-compat-mode -1) |
| 536 | (should (eq (type-of x) 'vector)) | 536 | (should (eq (type-of x) 'vector)) |
| @@ -540,7 +540,7 @@ | |||
| 540 | (let ((cl-struct-foo (cl--struct-get-class 'foo))) | 540 | (let ((cl-struct-foo (cl--struct-get-class 'foo))) |
| 541 | (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check) | 541 | (setf (symbol-function 'cl-struct-foo) :quick-object-witness-check) |
| 542 | (should (eq (type-of x) 'foo)) | 542 | (should (eq (type-of x) 'foo)) |
| 543 | (should (eq (type-of [foo]) 'vector))) | 543 | (should (eq (type-of (vector 'foo)) 'vector))) |
| 544 | 544 | ||
| 545 | (cl-old-struct-compat-mode (if saved 1 -1)))) | 545 | (cl-old-struct-compat-mode (if saved 1 -1)))) |
| 546 | 546 | ||