aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2023-06-28 08:29:27 +0800
committerPo Lu2023-06-28 08:29:27 +0800
commit8f87af4237df02355cc4b4e9d0f73bf1c90210fa (patch)
tree2ddd5cdce834167585935a3e5a7296f280941b4a
parent93d431f0048edf277a6521acbc7048e3957db4b4 (diff)
parent28b7745c677c394b21a663e5b7cdef2eb7329fde (diff)
downloademacs-8f87af4237df02355cc4b4e9d0f73bf1c90210fa.tar.gz
emacs-8f87af4237df02355cc4b4e9d0f73bf1c90210fa.zip
Merge remote-tracking branch 'origin/master' into feature/android
-rw-r--r--lisp/dired.el12
-rw-r--r--lisp/emacs-lisp/bytecomp.el5
-rw-r--r--lisp/misc.el6
-rw-r--r--lisp/progmodes/cc-engine.el44
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el6
5 files changed, 47 insertions, 26 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 914d0a0e783..b4cfaa1842f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1632,6 +1632,7 @@ In other cases, DIR should be a directory name or a directory filename.
1632If HDR is non-nil, insert a header line with the directory name." 1632If HDR is non-nil, insert a header line with the directory name."
1633 (let ((opoint (point)) 1633 (let ((opoint (point))
1634 (process-environment (copy-sequence process-environment)) 1634 (process-environment (copy-sequence process-environment))
1635 (remotep (file-remote-p dir))
1635 end) 1636 end)
1636 (if (and 1637 (if (and
1637 ;; Don't try to invoke `ls' if we are on DOS/Windows where 1638 ;; Don't try to invoke `ls' if we are on DOS/Windows where
@@ -1641,7 +1642,7 @@ If HDR is non-nil, insert a header line with the directory name."
1641 (null ls-lisp-use-insert-directory-program))) 1642 (null ls-lisp-use-insert-directory-program)))
1642 ;; FIXME: Big ugly hack for Eshell's eshell-ls-use-in-dired. 1643 ;; FIXME: Big ugly hack for Eshell's eshell-ls-use-in-dired.
1643 (not (bound-and-true-p eshell-ls-use-in-dired)) 1644 (not (bound-and-true-p eshell-ls-use-in-dired))
1644 (or (file-remote-p dir) 1645 (or remotep
1645 (if (eq dired-use-ls-dired 'unspecified) 1646 (if (eq dired-use-ls-dired 'unspecified)
1646 ;; Check whether "ls --dired" gives exit code 0, and 1647 ;; Check whether "ls --dired" gives exit code 0, and
1647 ;; save the answer in `dired-use-ls-dired'. 1648 ;; save the answer in `dired-use-ls-dired'.
@@ -1656,19 +1657,14 @@ see `dired-use-ls-dired' for more details.")
1656 ;; Use -N with --dired, to countermand possible non-default 1657 ;; Use -N with --dired, to countermand possible non-default
1657 ;; quoting style, in particular via the environment variable 1658 ;; quoting style, in particular via the environment variable
1658 ;; QUOTING_STYLE. 1659 ;; QUOTING_STYLE.
1659 (setq switches (concat "--dired -N " switches))) 1660 (unless remotep
1661 (setq switches (concat "--dired -N " switches))))
1660 ;; Expand directory wildcards and fill file-list. 1662 ;; Expand directory wildcards and fill file-list.
1661 (let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir))) 1663 (let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir)))
1662 (cond (dir-wildcard 1664 (cond (dir-wildcard
1663 (setq switches (concat "-d " switches)) 1665 (setq switches (concat "-d " switches))
1664 ;; We don't know whether the remote ls supports
1665 ;; "--dired", so we cannot add it to the `process-file'
1666 ;; call for wildcards.
1667 (when (file-remote-p dir)
1668 (setq switches (string-replace "--dired -N" "" switches)))
1669 (let* ((default-directory (car dir-wildcard)) 1666 (let* ((default-directory (car dir-wildcard))
1670 (script (format "ls %s %s" switches (cdr dir-wildcard))) 1667 (script (format "ls %s %s" switches (cdr dir-wildcard)))
1671 (remotep (file-remote-p dir))
1672 (sh (or (and remotep "/bin/sh") 1668 (sh (or (and remotep "/bin/sh")
1673 (executable-find shell-file-name) 1669 (executable-find shell-file-name)
1674 (executable-find "sh"))) 1670 (executable-find "sh")))
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 659d698b603..99202185d8d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3473,8 +3473,9 @@ lambda-expression."
3473 run-hook-with-args-until-failure)) 3473 run-hook-with-args-until-failure))
3474 (pcase (cdr form) 3474 (pcase (cdr form)
3475 (`(',var . ,_) 3475 (`(',var . ,_)
3476 (when (memq var byte-compile-lexical-variables) 3476 (when (and (memq var byte-compile-lexical-variables)
3477 (byte-compile-report-error 3477 (byte-compile-warning-enabled-p 'lexical var))
3478 (byte-compile-warn
3478 (format-message "%s cannot use lexical var `%s'" fn var)))))) 3479 (format-message "%s cannot use lexical var `%s'" fn var))))))
3479 ;; Warn about using obsolete hooks. 3480 ;; Warn about using obsolete hooks.
3480 (if (memq fn '(add-hook remove-hook)) 3481 (if (memq fn '(add-hook remove-hook))
diff --git a/lisp/misc.el b/lisp/misc.el
index 81769696f95..de82b97fa6f 100644
--- a/lisp/misc.el
+++ b/lisp/misc.el
@@ -71,13 +71,15 @@ Also see the `copy-from-above-command' command."
71 (interactive "p") 71 (interactive "p")
72 (unless n 72 (unless n
73 (setq n 1)) 73 (setq n 1))
74 (let ((line (buffer-substring (line-beginning-position) (line-end-position)))) 74 (let ((line (concat (buffer-substring (line-beginning-position)
75 (line-end-position))
76 "\n")))
75 (save-excursion 77 (save-excursion
76 (forward-line 1) 78 (forward-line 1)
77 (unless (bolp) 79 (unless (bolp)
78 (insert "\n")) 80 (insert "\n"))
79 (dotimes (_ n) 81 (dotimes (_ n)
80 (insert line "\n"))))) 82 (insert line)))))
81 83
82(declare-function rectangle--duplicate-right "rect" (n)) 84(declare-function rectangle--duplicate-right "rect" (n))
83 85
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index c4ae8aadd65..721daf9d53f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -12997,11 +12997,19 @@ comment at the start of cc-engine.el for more info."
12997(defvar c-laomib-cache nil) 12997(defvar c-laomib-cache nil)
12998(make-variable-buffer-local 'c-laomib-cache) 12998(make-variable-buffer-local 'c-laomib-cache)
12999 12999
13000(defun c-laomib-get-cache (containing-sexp) 13000(defun c-laomib-get-cache (containing-sexp start)
13001 ;; Get an element from `c-laomib-cache' matching CONTAINING-SEXP. 13001 ;; Get an element from `c-laomib-cache' matching CONTAINING-SEXP, and which
13002 ;; is suitable for start postiion START.
13002 ;; Return that element or nil if one wasn't found. 13003 ;; Return that element or nil if one wasn't found.
13003 (let ((elt (assq containing-sexp c-laomib-cache))) 13004 (let ((ptr c-laomib-cache)
13004 (when elt 13005 elt)
13006 (while
13007 (and ptr
13008 (setq elt (car ptr))
13009 (or (not (eq (car elt) containing-sexp))
13010 (< start (car (cddr elt)))))
13011 (setq ptr (cdr ptr)))
13012 (when ptr
13005 ;; Move the fetched `elt' to the front of the cache. 13013 ;; Move the fetched `elt' to the front of the cache.
13006 (setq c-laomib-cache (delq elt c-laomib-cache)) 13014 (setq c-laomib-cache (delq elt c-laomib-cache))
13007 (push elt c-laomib-cache) 13015 (push elt c-laomib-cache)
@@ -13013,18 +13021,26 @@ comment at the start of cc-engine.el for more info."
13013 ;; the components of the new element (see comment for `c-laomib-cache'). 13021 ;; the components of the new element (see comment for `c-laomib-cache').
13014 ;; The return value is of no significance. 13022 ;; The return value is of no significance.
13015 (when lim 13023 (when lim
13016 (let ((old-elt (assq lim c-laomib-cache)) 13024 (let (old-elt
13017 ;; (elt (cons containing-sexp (cons start nil)))
13018 (new-elt (list lim start end result)) 13025 (new-elt (list lim start end result))
13019 big-ptr 13026 big-ptr
13020 (cur-ptr c-laomib-cache) 13027 (cur-ptr c-laomib-cache)
13021 togo (size 0) cur-size 13028 togo (size 0) cur-size)
13022 ) 13029
13023 (if old-elt (setq c-laomib-cache (delq old-elt c-laomib-cache))) 13030 ;; If there is an elt which overlaps with the new element, remove it.
13031 (while
13032 (and cur-ptr
13033 (setq old-elt (car cur-ptr))
13034 (or (not (eq (car old-elt) lim))
13035 (not (and (> start (car (cddr old-elt)))
13036 (<= start (cadr old-elt))))))
13037 (setq cur-ptr (cdr cur-ptr)))
13038 (when (and cur-ptr old-elt)
13039 (setq c-laomib-cache (delq old-elt c-laomib-cache)))
13024 13040
13025 (while (>= (length c-laomib-cache) 4) 13041 (while (>= (length c-laomib-cache) 4)
13026 ;; We delete the least recently used elt which doesn't enclose START, 13042 ;; We delete the least recently used elt which doesn't enclose START,
13027 ;; or.. 13043 ;; or ...
13028 (dolist (elt c-laomib-cache) 13044 (dolist (elt c-laomib-cache)
13029 (if (or (<= start (cadr elt)) 13045 (if (or (<= start (cadr elt))
13030 (> start (car (cddr elt)))) 13046 (> start (car (cddr elt))))
@@ -13032,8 +13048,10 @@ comment at the start of cc-engine.el for more info."
13032 13048
13033 ;; ... delete the least recently used elt which isn't the biggest. 13049 ;; ... delete the least recently used elt which isn't the biggest.
13034 (when (not togo) 13050 (when (not togo)
13051 (setq cur-ptr c-laomib-cache)
13035 (while (cdr cur-ptr) 13052 (while (cdr cur-ptr)
13036 (setq cur-size (- (nth 2 (cadr cur-ptr)) (car (cadr cur-ptr)))) 13053 (setq cur-size (- (cadr (cadr cur-ptr))
13054 (car (cddr (cadr cur-ptr)))))
13037 (when (> cur-size size) 13055 (when (> cur-size size)
13038 (setq size cur-size 13056 (setq size cur-size
13039 big-ptr cur-ptr)) 13057 big-ptr cur-ptr))
@@ -13225,7 +13243,7 @@ comment at the start of cc-engine.el for more info."
13225 (goto-char pos) 13243 (goto-char pos)
13226 (when (eq braceassignp 'dontknow) 13244 (when (eq braceassignp 'dontknow)
13227 (let* ((cache-entry (and containing-sexp 13245 (let* ((cache-entry (and containing-sexp
13228 (c-laomib-get-cache containing-sexp))) 13246 (c-laomib-get-cache containing-sexp pos)))
13229 (lim2 (or (cadr cache-entry) lim)) 13247 (lim2 (or (cadr cache-entry) lim))
13230 sub-bassign-p) 13248 sub-bassign-p)
13231 (if cache-entry 13249 (if cache-entry
@@ -13247,6 +13265,8 @@ comment at the start of cc-engine.el for more info."
13247 ) 13265 )
13248 (setq braceassignp (nth 3 cache-entry)) 13266 (setq braceassignp (nth 3 cache-entry))
13249 (goto-char (nth 2 cache-entry))) 13267 (goto-char (nth 2 cache-entry)))
13268 (c-laomib-put-cache containing-sexp
13269 start (point) sub-bassign-p)
13250 (setq braceassignp sub-bassign-p))) 13270 (setq braceassignp sub-bassign-p)))
13251 (t)) 13271 (t))
13252 13272
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index 01ca56386e3..983cbfc8bc7 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -812,8 +812,10 @@ See Bug#57915."
812 ;; In ELisp function arguments are always statically scoped (bug#47552). 812 ;; In ELisp function arguments are always statically scoped (bug#47552).
813 (let ((cl--test-a 'dyn) 813 (let ((cl--test-a 'dyn)
814 ;; FIXME: How do we silence the "Lexical argument shadows" warning? 814 ;; FIXME: How do we silence the "Lexical argument shadows" warning?
815 (f (cl-function (lambda (&key cl--test-a b) 815 (f
816 (list cl--test-a (symbol-value 'cl--test-a) b))))) 816 (with-suppressed-warnings ((lexical cl--test-a))
817 (cl-function (lambda (&key cl--test-a b)
818 (list cl--test-a (symbol-value 'cl--test-a) b))))))
817 (should (equal (funcall f :cl--test-a 'lex :b 2) '(lex dyn 2))))) 819 (should (equal (funcall f :cl--test-a 'lex :b 2) '(lex dyn 2)))))
818 820
819(cl-defstruct cl--test-s 821(cl-defstruct cl--test-s