commit 738266240dc1a19911770bf676330aa72352da79 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Tue Apr 6 09:50:07 2021 +0200 Fix Bug#47601 in Tramp * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): Use `tramp-handle-file-newer-than-file-p'. (Bug#47601) (tramp-sh-handle-file-newer-than-file-p, tramp-run-test2): Remove. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 499bf8abe4..b902ee6f35 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -949,7 +949,7 @@ Format specifiers \"%s\" are replaced before the script is used.") (file-name-directory . tramp-handle-file-name-directory) (file-name-nondirectory . tramp-handle-file-name-nondirectory) ;; `file-name-sans-versions' performed by default handler. - (file-newer-than-file-p . tramp-sh-handle-file-newer-than-file-p) + (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) (file-notify-add-watch . tramp-sh-handle-file-notify-add-watch) (file-notify-rm-watch . tramp-handle-file-notify-rm-watch) (file-notify-valid-p . tramp-handle-file-notify-valid-p) @@ -1557,49 +1557,6 @@ ID-FORMAT valid values are `string' and `integer'." (or (tramp-check-cached-permissions v ?r) (tramp-run-test "-r" filename))))) -;; When the remote shell is started, it looks for a shell which groks -;; tilde expansion. Here, we assume that all shells which grok tilde -;; expansion will also provide a `test' command which groks `-nt' (for -;; newer than). If this breaks, tell me about it and I'll try to do -;; something smarter about it. -(defun tramp-sh-handle-file-newer-than-file-p (file1 file2) - "Like `file-newer-than-file-p' for Tramp files." - (cond ((not (file-exists-p file1)) nil) - ((not (file-exists-p file2)) t) - (t ;; We are sure both files exist at this point. We try to - ;; get the mtime of both files. If they are not equal to - ;; the "dont-know" value, then we subtract the times and - ;; obtain the result. - (let ((fa1 (file-attributes file1)) - (fa2 (file-attributes file2))) - (if (and - (not - (tramp-compat-time-equal-p - (tramp-compat-file-attribute-modification-time fa1) - tramp-time-dont-know)) - (not - (tramp-compat-time-equal-p - (tramp-compat-file-attribute-modification-time fa2) - tramp-time-dont-know))) - (time-less-p - (tramp-compat-file-attribute-modification-time fa2) - (tramp-compat-file-attribute-modification-time fa1)) - ;; If one of them is the dont-know value, then we can - ;; still try to run a shell command on the remote host. - ;; However, this only works if both files are Tramp - ;; files and both have the same method, same user, same - ;; host. - (unless (tramp-equal-remote file1 file2) - (with-parsed-tramp-file-name - (if (tramp-tramp-file-p file1) file1 file2) nil - (tramp-error - v 'file-error - "Files %s and %s must have same method, user, host" - file1 file2))) - (with-parsed-tramp-file-name file1 nil - (tramp-run-test2 - (tramp-get-test-nt-command v) file1 file2))))))) - ;; Functions implemented using the basic functions above. (defun tramp-sh-handle-file-directory-p (filename) @@ -3959,24 +3916,6 @@ Returns the exit code of the `test' program." switch (tramp-shell-quote-argument localname))))) -(defun tramp-run-test2 (format-string file1 file2) - "Run `test'-like program on the remote system, given FILE1, FILE2. -FORMAT-STRING contains the program name, switches, and place holders. -Returns the exit code of the `test' program. Barfs if the methods, -hosts, or files, disagree." - (unless (tramp-equal-remote file1 file2) - (with-parsed-tramp-file-name (if (tramp-tramp-file-p file1) file1 file2) nil - (tramp-error - v 'file-error - "tramp-run-test2 only implemented for same method, user, host"))) - (with-parsed-tramp-file-name file1 v1 - (with-parsed-tramp-file-name file1 v2 - (tramp-send-command-and-check - v1 - (format format-string - (tramp-shell-quote-argument v1-localname) - (tramp-shell-quote-argument v2-localname)))))) - (defconst tramp-sunos-unames (regexp-opt '("SunOS 5.10" "SunOS 5.11")) "Regexp to determine remote SunOS.") commit e0c3925961c17ed4920c3f7ca72e7c513766cb91 Author: Stefan Monnier Date: Tue Apr 6 00:26:38 2021 -0400 * lisp/msb.el: Use lexical-binding Remove redundant `:group` args. (msb--add-to-menu): Strength-reduce `eval` to `symbol-value` and use `push`. (msb--create-sort-item): Strength-reduce `eval` to `symbol-value`. (msb-menu-bar-update-buffers): Replace `(lambda...) with a proper closure. diff --git a/lisp/msb.el b/lisp/msb.el index 14209d9956..1064f94090 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -1,4 +1,4 @@ -;;; msb.el --- customizable buffer-selection with multiple menus +;;; msb.el --- customizable buffer-selection with multiple menus -*- lexical-binding: t; -*- ;; Copyright (C) 1993-1995, 1997-2021 Free Software Foundation, Inc. @@ -252,14 +252,12 @@ error every time you do \\[msb]." :type `(choice (const :tag "long" :value ,msb--very-many-menus) (const :tag "short" :value ,msb--few-menus) (sexp :tag "user")) - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defcustom msb-modes-key 4000 "The sort key for files sorted by mode." :type 'integer - :set 'msb-custom-set - :group 'msb + :set #'msb-custom-set :version "20.3") (defcustom msb-separator-diff 100 @@ -267,8 +265,7 @@ error every time you do \\[msb]." The separators will appear between all menus that have a sorting key that differs by this value or more." :type '(choice integer (const nil)) - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defvar msb-files-by-directory-sort-key 0 "The sort key for files sorted by directory.") @@ -278,8 +275,7 @@ that differs by this value or more." If this variable is set to 15 for instance, then the submenu will be split up in minor parts, 15 items each. A value of nil means no limit." :type '(choice integer (const nil)) - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defcustom msb-max-file-menu-items 10 "The maximum number of items from different directories. @@ -293,27 +289,23 @@ them together. If the value is not a number, then the value 10 is used." :type 'integer - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defcustom msb-most-recently-used-sort-key -1010 "Where should the menu with the most recently used buffers be placed?" :type 'integer - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defcustom msb-display-most-recently-used 15 "How many buffers should be in the most-recently-used menu. No buffers at all if less than 1 or nil (or any non-number)." :type 'integer - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defcustom msb-most-recently-used-title "Most recently used (%d)" "The title for the most-recently-used menu." :type 'string - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defvar msb-horizontal-shift-function (lambda () 0) "Function that specifies how many pixels to shift the top menu leftwards.") @@ -323,8 +315,7 @@ No buffers at all if less than 1 or nil (or any non-number)." Non-nil means that the buffer menu should include buffers that have names that starts with a space character." :type 'boolean - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defvar msb-item-handling-function 'msb-item-handler "The appearance of a buffer menu. @@ -354,15 +345,13 @@ Set this to nil or t if you don't want any sorting (faster)." :type '(choice (const msb-sort-by-name) (const :tag "Newest first" t) (const :tag "Oldest first" nil)) - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (defcustom msb-files-by-directory nil "Non-nil means that files should be sorted by directory. This is instead of the groups in `msb-menu-cond'." :type 'boolean - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (define-obsolete-variable-alias 'msb-after-load-hooks 'msb-after-load-hook "24.1") @@ -370,8 +359,7 @@ This is instead of the groups in `msb-menu-cond'." (defcustom msb-after-load-hook nil "Hook run after the msb package has been loaded." :type 'hook - :set 'msb-custom-set - :group 'msb) + :set #'msb-custom-set) (make-obsolete-variable 'msb-after-load-hook "use `with-eval-after-load' instead." "28.1") @@ -458,10 +446,10 @@ An item look like (NAME . BUFFER)." ;;; ;;; msb -;;; -;;; This function can be used instead of (mouse-buffer-menu EVENT) -;;; function in "mouse.el". -;;; +;; +;; This function can be used instead of (mouse-buffer-menu EVENT) +;; function in "mouse.el". +;; (defun msb (event) "Pop up several menus of buffers for selection with the mouse. This command switches buffers in the window that you clicked on, and @@ -707,7 +695,7 @@ See `msb-menu-cond' for a description of its elements." (cl-loop for fi across function-info-vector if (and (setq result - (eval (aref fi 1))) ;Test CONDITION + (eval (aref fi 1) t)) ;Test CONDITION (not (and (eq result 'no-multi) multi-flag)) (progn (when (eq result 'multi) @@ -727,12 +715,11 @@ All side-effects. Adds an element of form (BUFFER-TITLE . BUFFER) to the buffer-list variable in FUNCTION-INFO." (let ((list-symbol (aref function-info 0))) ;BUFFER-LIST-VARIABLE ;; Here comes the hairy side-effect! - (set list-symbol - (cons (cons (funcall (aref function-info 4) ;ITEM-HANDLER - buffer - max-buffer-name-length) - buffer) - (eval list-symbol))))) + (push (cons (funcall (aref function-info 4) ;ITEM-HANDLER + buffer + max-buffer-name-length) + buffer) + (symbol-value list-symbol)))) (defsubst msb--choose-menu (buffer function-info-vector max-buffer-name-length) "Select the appropriate menu for BUFFER." @@ -754,7 +741,7 @@ to the buffer-list variable in FUNCTION-INFO." (defun msb--create-sort-item (function-info) "Return (SORT-KEY TITLE . BUFFER-LIST) or nil if the buffer-list is empty." - (let ((buffer-list (eval (aref function-info 0)))) + (let ((buffer-list (symbol-value (aref function-info 0)))) (when buffer-list (let ((sorter (aref function-info 5)) ;SORTER (sort-key (aref function-info 2))) ;MENU-SORT-KEY @@ -925,7 +912,7 @@ It takes the form ((TITLE . BUFFER-LIST)...)." for value = (msb--create-sort-item elt) if value collect value)))) (setq menu - (mapcar 'cdr ;Remove the SORT-KEY + (mapcar #'cdr ;Remove the SORT-KEY ;; Sort the menus - not the items. (msb--add-separators (sort @@ -1113,8 +1100,8 @@ variable `msb-menu-cond'." (nconc (list (frame-parameter frame 'name) (frame-parameter frame 'name)) - `(lambda () - (interactive) (menu-bar-select-frame ,frame)))) + (lambda () + (interactive) (menu-bar-select-frame frame)))) frames))))) (setcdr global-buffers-menu-map (if (and buffers-menu frames-menu) @@ -1128,7 +1115,7 @@ variable `msb-menu-cond'." ;; C-down-mouse-1). (defvar msb-mode-map (let ((map (make-sparse-keymap "Msb"))) - (define-key map [remap mouse-buffer-menu] 'msb) + (define-key map [remap mouse-buffer-menu] #'msb) map)) ;;;###autoload @@ -1137,14 +1124,14 @@ variable `msb-menu-cond'." This mode overrides the binding(s) of `mouse-buffer-menu' to provide a different buffer menu using the function `msb'." - :global t :group 'msb + :global t (if msb-mode (progn - (add-hook 'menu-bar-update-hook 'msb-menu-bar-update-buffers) - (remove-hook 'menu-bar-update-hook 'menu-bar-update-buffers) + (add-hook 'menu-bar-update-hook #'msb-menu-bar-update-buffers) + (remove-hook 'menu-bar-update-hook #'menu-bar-update-buffers) (msb-menu-bar-update-buffers t)) - (remove-hook 'menu-bar-update-hook 'msb-menu-bar-update-buffers) - (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) + (remove-hook 'menu-bar-update-hook #'msb-menu-bar-update-buffers) + (add-hook 'menu-bar-update-hook #'menu-bar-update-buffers) (menu-bar-update-buffers t))) (defun msb-unload-function () commit 7b0a5a555f4986b743275756f61c18fef62873ac Author: Stefan Monnier Date: Tue Apr 6 00:13:44 2021 -0400 * lisp/hippie-exp.el: Use lexical-binding Remove redundant `:group` args. (make-hippie-expand-function): Turn it into a function returning a closure. (try-expand-all-abbrevs): Strength-reduce `eval` to `symbol-value` and use `abbrev-table-p` rather than `vectorp`. diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el index 4d02023293..cbb69b206d 100644 --- a/lisp/hippie-exp.el +++ b/lisp/hippie-exp.el @@ -1,4 +1,4 @@ -;;; hippie-exp.el --- expand text trying various ways to find its expansion +;;; hippie-exp.el --- expand text trying various ways to find its expansion -*- lexical-binding: t; -*- ;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc. @@ -58,7 +58,7 @@ ;; The variable `hippie-expand-dabbrev-as-symbol' controls whether ;; characters of syntax '_' is considered part of the words to expand ;; dynamically. -;; See also the macro `make-hippie-expand-function' below. +;; See also the function `make-hippie-expand-function' below. ;; ;; A short description of the current try-functions in this file: ;; `try-complete-file-name' : very convenient to have in any buffer, @@ -215,50 +215,42 @@ "The list of expansion functions tried in order by `hippie-expand'. To change the behavior of `hippie-expand', remove, change the order of, or insert functions in this list." - :type '(repeat function) - :group 'hippie-expand) + :type '(repeat function)) (defcustom hippie-expand-verbose t "Non-nil makes `hippie-expand' output which function it is trying." - :type 'boolean - :group 'hippie-expand) + :type 'boolean) (defcustom hippie-expand-dabbrev-skip-space nil "Non-nil means tolerate trailing spaces in the abbreviation to expand." - :group 'hippie-expand :type 'boolean) (defcustom hippie-expand-dabbrev-as-symbol t "Non-nil means expand as symbols, i.e. syntax `_' is considered a letter." - :group 'hippie-expand :type 'boolean) (defcustom hippie-expand-no-restriction t "Non-nil means that narrowed buffers are widened during search." - :group 'hippie-expand :type 'boolean) (defcustom hippie-expand-max-buffers () "The maximum number of buffers (apart from the current) searched. If nil, all buffers are searched." :type '(choice (const :tag "All" nil) - integer) - :group 'hippie-expand) + integer)) (defcustom hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode) "A list specifying which buffers not to search (if not current). Can contain both regexps matching buffer names (as strings) and major modes \(as atoms)." - :type '(repeat (choice regexp (symbol :tag "Major Mode"))) - :group 'hippie-expand) + :type '(repeat (choice regexp (symbol :tag "Major Mode")))) (defcustom hippie-expand-only-buffers () "A list specifying the only buffers to search (in addition to current). Can contain both regexps matching buffer names (as strings) and major modes \(as atoms). If non-nil, this variable overrides the variable `hippie-expand-ignore-buffers'." - :type '(repeat (choice regexp (symbol :tag "Major Mode"))) - :group 'hippie-expand) + :type '(repeat (choice regexp (symbol :tag "Major Mode")))) ;;;###autoload (defun hippie-expand (arg) @@ -407,18 +399,19 @@ undoes the expansion." ;; try-expand-line-all-buffers))) ;; ;;;###autoload -(defmacro make-hippie-expand-function (try-list &optional verbose) +(defun make-hippie-expand-function (try-list &optional verbose) "Construct a function similar to `hippie-expand'. Make it use the expansion functions in TRY-LIST. An optional second argument VERBOSE non-nil makes the function verbose." - `(lambda (arg) - ,(concat - "Try to expand text before point, using the following functions: \n" - (mapconcat 'prin1-to-string (eval try-list) ", ")) - (interactive "P") - (let ((hippie-expand-try-functions-list ,try-list) - (hippie-expand-verbose ,verbose)) - (hippie-expand arg)))) + (lambda (arg) + (:documentation + (concat + "Try to expand text before point, using the following functions: \n" + (mapconcat #'prin1-to-string try-list ", "))) + (interactive "P") + (let ((hippie-expand-try-functions-list try-list) + (hippie-expand-verbose verbose)) + (hippie-expand arg)))) ;;; Here follows the try-functions and their requisites: @@ -434,7 +427,8 @@ string). It returns t if a new completion is found, nil otherwise." (he-init-string (he-file-name-beg) (point)) (let ((name-part (file-name-nondirectory he-search-string)) (dir-part (expand-file-name (or (file-name-directory - he-search-string) "")))) + he-search-string) + "")))) (if (not (he-string-member name-part he-tried-table)) (setq he-tried-table (cons name-part he-tried-table))) (if (and (not (equal he-search-string "")) @@ -442,7 +436,7 @@ string). It returns t if a new completion is found, nil otherwise." (setq he-expand-list (sort (file-name-all-completions name-part dir-part) - 'string-lessp)) + #'string-lessp)) (setq he-expand-list ()))))) (while (and he-expand-list @@ -538,7 +532,7 @@ string). It returns t if a new completion is found, nil otherwise." (or (boundp sym) (fboundp sym) (symbol-plist sym)))) - 'string-lessp))))) + #'string-lessp))))) (while (and he-expand-list (he-string-member (car he-expand-list) he-tried-table)) (setq he-expand-list (cdr he-expand-list))) @@ -822,9 +816,10 @@ string). It returns t if a new expansion is found, nil otherwise." (setq he-expand-list (and (not (equal he-search-string "")) (mapcar (lambda (sym) - (if (and (boundp sym) (vectorp (eval sym))) + (if (and (boundp sym) + (abbrev-table-p (symbol-value sym))) (abbrev-expansion (downcase he-search-string) - (eval sym)))) + (symbol-value sym)))) (append '(local-abbrev-table global-abbrev-table) abbrev-table-name-list)))))) commit 1d93540371aadec8f877bd781267d38d411c40a0 Author: Stefan Monnier Date: Mon Apr 5 17:30:11 2021 -0400 * lisp/comint.el: Fix understickiness of non-comint properties When a third party package adds properties to the prompt they don't necessarily want to be `read-nonsticky` (e.g. for the `cursor-intangible` property), so replace the catchall `rear-nonsticky t` with an actual list of the properties that we want to be `rear-nonsticky`. (comint-send-input, comint-output-filter): Don't mark all properties as non-sticky. diff --git a/lisp/comint.el b/lisp/comint.el index b04d404676..4f13ff31ac 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1917,7 +1917,8 @@ Similarly for Soar, Scheme, etc." (unless (or no-newline comint-use-prompt-regexp) ;; Cover the terminating newline (add-text-properties end (1+ end) - '(rear-nonsticky t + '(rear-nonsticky + (field inhibit-line-move-field-capture read-only) field boundary inhibit-line-move-field-capture t))))) @@ -2126,7 +2127,8 @@ Make backspaces delete the previous character." (add-text-properties comint-last-output-start (point) '(front-sticky (field inhibit-line-move-field-capture) - rear-nonsticky t + rear-nonsticky + (field inhibit-line-move-field-capture read-only) field output inhibit-line-move-field-capture t)))) @@ -2155,7 +2157,9 @@ Make backspaces delete the previous character." (font-lock-prepend-text-property prompt-start (point) 'font-lock-face 'comint-highlight-prompt) - (add-text-properties prompt-start (point) '(rear-nonsticky t))) + (add-text-properties prompt-start (point) + '(rear-nonsticky + (field inhibit-line-move-field-capture read-only)))) (goto-char saved-point))))))) (defun comint-preinput-scroll-to-bottom () commit c049c8da58106e422494914447e06fd7c9deb301 Author: Juri Linkov Date: Tue Apr 6 00:18:59 2021 +0300 * lisp/tab-bar.el: Add repeat-map keymaps. * lisp/tab-bar.el (tab-bar-switch-repeat-map): New keymap used for 'tab-next' and 'tab-previous'. (tab-bar-move-repeat-map): New keymap used for 'tab-move'. https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg01103.html diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 2e27b293c5..f3c2fb7ed9 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -2075,6 +2075,28 @@ When `switch-to-buffer-obey-display-actions' is non-nil, (define-key tab-prefix-map "\C-r" 'find-file-read-only-other-tab) (define-key tab-prefix-map "t" 'other-tab-prefix) +(defvar tab-bar-switch-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map "o" 'tab-next) + (define-key map "O" 'tab-previous) + map) + "Keymap to repeat tab switch key sequences `C-x t o o O'. +Used in `repeat-mode'.") +(put 'tab-next 'repeat-map 'tab-bar-switch-repeat-map) +(put 'tab-previous 'repeat-map 'tab-bar-switch-repeat-map) + +(defvar tab-bar-move-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map "m" 'tab-move) + (define-key map "M" (lambda () + (interactive) + (setq repeat-map 'tab-bar-move-repeat-map) + (tab-move -1))) + map) + "Keymap to repeat tab move key sequences `C-x t m m M'. +Used in `repeat-mode'.") +(put 'tab-move 'repeat-map 'tab-bar-move-repeat-map) + (provide 'tab-bar) commit 15de559d98b1b19733bacf0c39716d5ebabe6dfa Author: Juri Linkov Date: Tue Apr 6 00:02:43 2021 +0300 * lisp/repeat.el (repeat-keep-prefix): New defcustom. * lisp/repeat.el (repeat-map): New autoloaded global variable. (repeat-post-hook): Use 'repeat-map' when non-nil and reset it to nil afterwards. (repeat-post-hook): Keep the current prefix when 'repeat-keep-prefix' is non-nil. * lisp/window.el (other-window-repeat-map): Add "O" that sets 'repeat-map' to 'other-window-repeat-map' before calling '(other-window -1)'. https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg01387.html diff --git a/etc/NEWS b/etc/NEWS index 1421efcaa0..c8400ba8c2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2251,6 +2251,10 @@ You can type 'C-x u u' instead of 'C-x u C-x u' to undo many changes, 'M-g n n p p' to navigate next-error matches. Any other key exits transient mode and then is executed normally. 'repeat-exit-key' defines an additional key to exit mode like 'isearch-exit' ('RET'). +With 'repeat-keep-prefix' you can keep the prefix arg of the previous command. +For example, this can help to reverse the window navigation direction +with e.g. 'C-x o M-- o o'. Also it can help to set a new step with +e.g. 'C-x { C-5 { { {' will set the window resizing step to 5 columns. * New Modes and Packages in Emacs 28.1 diff --git a/lisp/repeat.el b/lisp/repeat.el index a5ab43950c..1830bcc049 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -342,6 +342,14 @@ For example, you can set it to like `isearch-exit'." :group 'convenience :version "28.1") +(defcustom repeat-keep-prefix t + "Keep the prefix arg of the previous command." + :type 'boolean + :group 'convenience + :version "28.1") + +;;;###autoload (defvar repeat-map nil) + ;;;###autoload (define-minor-mode repeat-mode "Toggle Repeat mode. @@ -364,8 +372,9 @@ When Repeat mode is enabled, and the command symbol has the property named (defun repeat-post-hook () "Function run after commands to set transient keymap for repeatable keys." (when repeat-mode - (let ((rep-map (and (symbolp this-command) - (get this-command 'repeat-map)))) + (let ((rep-map (or repeat-map + (and (symbolp this-command) + (get this-command 'repeat-map))))) (when rep-map (when (boundp rep-map) (setq rep-map (symbol-value rep-map))) @@ -382,6 +391,9 @@ When Repeat mode is enabled, and the command symbol has the property named (when (or (lookup-key map (this-single-command-keys) nil) prefix-command-p) + (when (and repeat-keep-prefix (not prefix-command-p)) + (setq prefix-arg current-prefix-arg)) + ;; Messaging (unless prefix-command-p (map-keymap (lambda (key _) (push key keys)) map) @@ -402,7 +414,8 @@ When Repeat mode is enabled, and the command symbol has the property named (when repeat-exit-key (define-key map repeat-exit-key 'ignore)) - (set-transient-map map))))))) + (set-transient-map map)))))) + (setq repeat-map nil)) (provide 'repeat) diff --git a/lisp/window.el b/lisp/window.el index f27631bb86..071761ea50 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -10256,6 +10256,10 @@ displaying that processes's buffer." (defvar other-window-repeat-map (let ((map (make-sparse-keymap))) (define-key map "o" 'other-window) + (define-key map "O" (lambda () + (interactive) + (setq repeat-map 'other-window-repeat-map) + (other-window -1))) map) "Keymap to repeat other-window key sequences. Used in `repeat-mode'.") (put 'other-window 'repeat-map 'other-window-repeat-map) commit 9c51a9d00007902232865e6e6265cdd0d7075ae8 Author: Juri Linkov Date: Mon Apr 5 23:46:35 2021 +0300 * lisp/repeat.el (repeat-post-hook): Fix key lookup. * lisp/repeat.el (repeat-post-hook): Rename let-bound repeat-map to rep-map. Define let-bound prefix-command-p. Use lookup-key with this-single-command-keys instead of last-command-event. Don't show message when typing prefix keys. https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00083.html diff --git a/lisp/repeat.el b/lisp/repeat.el index a2b04b81b0..a5ab43950c 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -364,35 +364,39 @@ When Repeat mode is enabled, and the command symbol has the property named (defun repeat-post-hook () "Function run after commands to set transient keymap for repeatable keys." (when repeat-mode - (let ((repeat-map (and (symbolp this-command) - (get this-command 'repeat-map)))) - (when repeat-map - (when (boundp repeat-map) - (setq repeat-map (symbol-value repeat-map))) - (let ((map (copy-keymap repeat-map)) - keys mess) - (map-keymap (lambda (key _) (push key keys)) map) + (let ((rep-map (and (symbolp this-command) + (get this-command 'repeat-map)))) + (when rep-map + (when (boundp rep-map) + (setq rep-map (symbol-value rep-map))) + (let ((prefix-command-p (memq this-original-command + '(universal-argument + universal-argument-more + digit-argument + negative-argument))) + (map (copy-keymap rep-map)) + keys) ;; Exit when the last char is not among repeatable keys, ;; so e.g. `C-x u u' repeats undo, whereas `C-/ u' doesn't. - (when (or (memq last-command-event keys) - (memq this-original-command '(universal-argument - universal-argument-more - digit-argument - negative-argument))) + (when (or (lookup-key map (this-single-command-keys) nil) + prefix-command-p) + ;; Messaging - (setq mess (format-message - "Repeat with %s%s" - (mapconcat (lambda (key) - (key-description (vector key))) - keys ", ") - (if repeat-exit-key - (format ", or exit with %s" - (key-description repeat-exit-key)) - ""))) - (if (current-message) - (message "%s [%s]" (current-message) mess) - (message mess)) + (unless prefix-command-p + (map-keymap (lambda (key _) (push key keys)) map) + (let ((mess (format-message + "Repeat with %s%s" + (mapconcat (lambda (key) + (key-description (vector key))) + keys ", ") + (if repeat-exit-key + (format ", or exit with %s" + (key-description repeat-exit-key)) + "")))) + (if (current-message) + (message "%s [%s]" (current-message) mess) + (message mess)))) ;; Adding an exit key (when repeat-exit-key commit 14d295871a93c37a33d558ec4e8d49a93b787d8e Author: Michael Albinus Date: Mon Apr 5 19:37:30 2021 +0200 Use powershell for Tramp on MS Windows * lisp/net/tramp-sh.el (tramp-use-ssh-controlmaster-options): Nil on MS Windows. (tramp-connection-properties): Add "encoding-shell". (tramp-maybe-open-connection): Use it. Change exit handling. (tramp-actions-before-shell): Add `tramp-no-job-control-regexp'. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-no-job-control-regexp): New defcustom. (tramp-get-debug-buffer): Set coding system. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c3e1745d2f..499bf8abe4 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -103,12 +103,12 @@ detected as prompt when being sent on echoing hosts, therefore.") (defconst tramp-end-of-heredoc (md5 tramp-end-of-output) "String used to recognize end of heredoc strings.") -(defcustom tramp-use-ssh-controlmaster-options t +(defcustom tramp-use-ssh-controlmaster-options (not (eq system-type 'windows-nt)) "Whether to use `tramp-ssh-controlmaster-options'. Set it to nil, if you use Control* or Proxy* options in your ssh configuration." :group 'tramp - :version "24.4" + :version "28.1" :type 'boolean) (defvar tramp-ssh-controlmaster-options nil @@ -389,7 +389,14 @@ The string is used in `tramp-methods'.") (regexp-opt '("rcp" "remcp" "rsh" "telnet" "nc" "krlogin" "fcp")) "\\'") - nil ,(user-login-name)))) + nil ,(user-login-name))) + + ;; MS Windows Openssh client does not cooperate well with cmdproxy. + (when-let ((encoding-shell + (and (eq system-type 'windows-nt) (executable-find "powershell")))) + (add-to-list 'tramp-connection-properties + `(,(regexp-opt '("/sshx:" "/scpx:")) + "encoding-shell" ,encoding-shell)))) ;;;###tramp-autoload (defconst tramp-completion-function-alist-rsh @@ -484,6 +491,7 @@ shell from reading its init file." '((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) + (tramp-no-job-control-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) @@ -4857,8 +4865,6 @@ connection if a previous connection has died for some reason." (setenv "HISTSIZE" "0")))) (setenv "PROMPT_COMMAND") (setenv "PS1" tramp-initial-end-of-output) - (unless (stringp tramp-encoding-shell) - (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) (let* ((current-host tramp-system-name) (target-alist (tramp-compute-multi-hops vec)) ;; We will apply `tramp-ssh-controlmaster-options' @@ -4870,17 +4876,23 @@ connection if a previous connection has died for some reason." ;; W32 systems. (process-coding-system-alist nil) (coding-system-for-read nil) - (extra-args (tramp-get-sh-extra-args tramp-encoding-shell)) + (encoding-shell + (tramp-get-connection-property + vec "encoding-shell" tramp-encoding-shell)) + (extra-args (tramp-get-sh-extra-args encoding-shell)) ;; This must be done in order to avoid our file ;; name handler. (p (let ((default-directory (tramp-compat-temporary-file-directory))) + (unless (stringp encoding-shell) + (tramp-error + vec 'file-error "`tramp-encoding-shell' not set")) (apply #'start-process (tramp-get-connection-name vec) (tramp-get-connection-buffer vec) (append - (list tramp-encoding-shell) + (list encoding-shell) (and extra-args (split-string extra-args)) (and tramp-encoding-command-interactive (list tramp-encoding-command-interactive))))))) @@ -4899,8 +4911,7 @@ connection if a previous connection has died for some reason." ;; Check whether process is alive. (tramp-barf-if-no-shell-prompt - p 10 - "Couldn't find local shell prompt for %s" tramp-encoding-shell) + p 10 "Couldn't find local shell prompt for %s" encoding-shell) ;; Now do all the connections as specified. (while target-alist @@ -4974,12 +4985,8 @@ connection if a previous connection has died for some reason." ?h (or l-host "") ?u (or l-user "") ?p (or l-port "") ?c (format-spec options (format-spec-make ?t tmpfile)) ?l (concat remote-shell " " extra-args " -i")) - ;; Local shell could be a Windows COMSPEC. It - ;; doesn't know the ";" syntax, but we must - ;; exit always for `start-file-process'. It - ;; could also be a restricted shell, which does - ;; not allow "exec". - (when r-shell '("&&" "exit" "||" "exit"))) + ;; A restricted shell does not allow "exec". + (when r-shell '("; exit"))) " ")) ;; Send the command. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 8141f026f7..99955b5459 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -354,12 +354,13 @@ Notes: All these arguments can be overwritten by connection properties. See Info node `(tramp) Predefined connection information'. -When using `su' or `sudo' the phrase \"open connection to a remote -host\" sounds strange, but it is used nevertheless, for consistency. -No connection is opened to a remote host, but `su' or `sudo' is -started on the local host. You should specify a remote host -`localhost' or the name of the local host. Another host name is -useful only in combination with `tramp-default-proxies-alist'.") +When using `su', `sudo' or `doas' the phrase \"open connection to +a remote host\" sounds strange, but it is used nevertheless, for +consistency. No connection is opened to a remote host, but `su', +`sudo' or `doas' is started on the local host. You should +specify a remote host `localhost' or the name of the local host. +Another host name is useful only in combination with +`tramp-default-proxies-alist'.") (defcustom tramp-default-method ;; An external copy method seems to be preferred, because it performs @@ -690,6 +691,15 @@ The regexp should match at end of buffer." :version "27.1" :type 'regexp) +;; Powershell requires "ssh -t -t" for terminal emulation. If it +;; doesn't fit, there is an error. +(defcustom tramp-no-job-control-regexp + (regexp-quote "Thus no job control in this shell.") + "Regular expression matching powershell's job control message. +The regexp should match at end of buffer." + :version "28.1" + :type 'regexp) + (defcustom tramp-operation-not-permitted-regexp (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" (regexp-opt '("Operation not permitted") t)) @@ -1808,6 +1818,7 @@ The outline level is equal to the verbosity of the Tramp message." "Get the debug buffer for VEC." (with-current-buffer (get-buffer-create (tramp-debug-buffer-name vec)) (when (bobp) + (set-buffer-file-coding-system 'utf-8) (setq buffer-undo-list t) ;; Activate `outline-mode'. This runs `text-mode-hook' and ;; `outline-mode-hook'. We must prevent that local processes @@ -1848,7 +1859,7 @@ ARGUMENTS to actually emit the message (if applicable)." (when (bobp) (insert (format - ";; Emacs: %s Tramp: %s -*- mode: outline; -*-" + ";; Emacs: %s Tramp: %s -*- mode: outline; coding: utf-8; -*-" emacs-version tramp-version)) (when (>= tramp-verbose 10) (let ((tramp-verbose 0)) commit ddc4bba41387fdc7caef874f65d1ac78d12305e7 Author: Dario Gjorgjevski Date: Mon Apr 5 18:15:16 2021 +0200 Do not search the global keymap in project--keymap-prompt * lisp/progmodes/project.el: (project--keymap-prompt) Pass project--keymap-prompt as a list to where-is-internal so that the global keymap is not searched at all (bug#47501). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 3dd11118ea..910f70db03 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1322,7 +1322,7 @@ are legal even if they aren't listed in the dispatch menu." key tmp))) (let ((key (if key (vector key) - (where-is-internal cmd project-prefix-map t)))) + (where-is-internal cmd (list project-prefix-map) t)))) (format "[%s] %s" (propertize (key-description key) 'face 'bold) label))) commit 20669c1b929699670869afa40ee6d407ccb42848 Author: Lin Sun Date: Mon Apr 5 18:12:14 2021 +0200 Don't call `image-toggle-display-text' when toggling *lisp/image-mode.el (image-mode-to-text): Do not call the image-toggle-display-text twice when toggle image display (bug#47521). diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 2de16cb6af..f4ff35f9c4 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -732,8 +732,9 @@ displays an image file as text." (setq image-type previous-image-type) ;; Enable image minor mode with `C-c C-c'. (image-minor-mode 1) - ;; Show the image file as text. - (image-toggle-display-text))) + (unless (image-get-display-property) + ;; Show the image file as text. + (image-toggle-display-text)))) (defun image-mode-as-hex () "Set a non-image mode as major mode in combination with image minor mode. commit d2edc29db6278deb20bc04c878757eeee2029086 Author: Utkarsh Singh Date: Mon Apr 5 18:09:41 2021 +0200 Fix cd to directories called "eshell" in eshell * lisp/eshell/em-script.el (eshell-script-initialize): Allow changing directory to directories called "eshell" (bug#47547). Copyright-paperwork-exempt: yes diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 658ea085c9..1f08e89191 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -60,8 +60,9 @@ This includes when running `eshell-command'." "Initialize the script parsing code." (setq-local eshell-interpreter-alist (cons (cons (lambda (file _args) - (string= (file-name-nondirectory file) - "eshell")) + (and (file-regular-p file) + (string= (file-name-nondirectory file) + "eshell"))) 'eshell/source) eshell-interpreter-alist)) (setq-local eshell-complex-commands commit 81940e9c0eddf64b1699341e8a35ef556e1593f8 Author: Stefan Kangas Date: Mon Apr 5 17:28:05 2021 +0200 Remove redundant #' before lambda in calc/*.el * lisp/calc/calc-alg.el (math-defsimplify): * lisp/calc/calc-ext.el (math-defintegral, math-defintegral-2): * lisp/calc/calc-prog.el (math-do-arg-check): Remove redundant #' before lambda. diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index 1327cf0a39..162026d092 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -444,12 +444,12 @@ Code can refer to the expression to simplify via lexical variable `expr' and should return the simplified expression to use (or nil)." (declare (indent 1) (debug (sexp body))) (cons 'progn - (mapcar #'(lambda (func) - `(put ',func 'math-simplify - (nconc - (get ',func 'math-simplify) - (list - #'(lambda (expr) ,@code))))) + (mapcar (lambda (func) + `(put ',func 'math-simplify + (nconc + (get ',func 'math-simplify) + (list + (lambda (expr) ,@code))))) (if (symbolp funcs) (list funcs) funcs)))) (math-defsimplify (+ -) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 24781ed6c8..e85ecf0390 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -2784,23 +2784,23 @@ If X is not an error form, return 1." (declare (indent 1) (debug (sexp body))) (setq math-integral-cache nil) (cons 'progn - (mapcar #'(lambda (func) - `(put ',func 'math-integral - (nconc - (get ',func 'math-integral) - (list - #'(lambda (u) ,@code))))) + (mapcar (lambda (func) + `(put ',func 'math-integral + (nconc + (get ',func 'math-integral) + (list + (lambda (u) ,@code))))) (if (symbolp funcs) (list funcs) funcs)))) (defmacro math-defintegral-2 (funcs &rest code) (declare (indent 1) (debug (sexp body))) (setq math-integral-cache nil) (cons 'progn - (mapcar #'(lambda (func) - `(put ',func 'math-integral-2 - (nconc - (get ',func 'math-integral-2) - (list #'(lambda (u v) ,@code))))) + (mapcar (lambda (func) + `(put ',func 'math-integral-2 + (nconc + (get ',func 'math-integral-2) + (list (lambda (u v) ,@code))))) (if (symbolp funcs) (list funcs) funcs)))) (defvar var-IntegAfterRules 'calc-IntegAfterRules) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index dd221457f8..4e27d7671e 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1881,9 +1881,9 @@ Redefine the corresponding command." (if (fboundp (setq chk (intern (concat "math-" qual-name)))) (append rest (if is-rest - `((mapcar #'(lambda (x) - (or (,chk x) - (math-reject-arg x ',qual))) + `((mapcar (lambda (x) + (or (,chk x) + (math-reject-arg x ',qual))) ,var)) `((or (,chk ,var) (math-reject-arg ,var ',qual))))) @@ -1894,9 +1894,9 @@ Redefine the corresponding command." qual-name 1)))))) (append rest (if is-rest - `((mapcar #'(lambda (x) - (and (,chk x) - (math-reject-arg x ',qual))) + `((mapcar (lambda (x) + (and (,chk x) + (math-reject-arg x ',qual))) ,var)) `((and (,chk ,var) commit 0342354c155728f8d55005bd34a66e1ab3179cc7 Author: Stefan Kangas Date: Mon Apr 5 15:51:08 2021 +0200 * lisp/shadowfile.el (cl-lib): Revert removing require. diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 7fe3ed2f9b..a03965cf6c 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -73,6 +73,7 @@ ;;; Code: +(require 'cl-lib) (require 'tramp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; commit 6a8935a1531b8b64777bf357ed65a2ae69eade9e Author: Stefan Kangas Date: Mon Apr 5 15:15:31 2021 +0200 * lisp/pcomplete.el: Remove aliases commented out for 20 years. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index bffdcaa2de..64acc416c2 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -1311,18 +1311,6 @@ If specific documentation can't be given, be generic." (pcomplete-read-hosts pcomplete-hosts-file 'pcomplete--host-name-cache 'pcomplete--host-name-cache-timestamp))) -;; create a set of aliases which allow completion functions to be not -;; quite so verbose - -;;; jww (1999-10-20): are these a good idea? -;; (defalias 'pc-here 'pcomplete-here) -;; (defalias 'pc-test 'pcomplete-test) -;; (defalias 'pc-opt 'pcomplete-opt) -;; (defalias 'pc-match 'pcomplete-match) -;; (defalias 'pc-match-string 'pcomplete-match-string) -;; (defalias 'pc-match-beginning 'pcomplete-match-beginning) -;; (defalias 'pc-match-end 'pcomplete-match-end) - (provide 'pcomplete) ;;; pcomplete.el ends here commit 6686a31591d2d22a4d1c7b6e68a618823186c48e Author: Stefan Kangas Date: Mon Apr 5 15:14:19 2021 +0200 Remove local uniquify functions in favour of seq-uniq * lisp/emacs-lisp/seq.el (seq-uniq): Add autoload cookie. * lisp/pcomplete.el: (pcomplete-uniquify-list): Use seq-uniq. * lisp/eshell/esh-util.el (eshell-uniqify-list) (eshell-uniquify-list): * lisp/nxml/rng-util.el (rng-uniquify-equal): * lisp/progmodes/idlwave.el (idlwave-uniquify): * lisp/textmodes/artist.el (artist-uniq): Make into obsolete function aliases for seq-uniq. Update callers. * lisp/nxml/rng-util.el (rng-uniquify-eq): Make obsolete in favor of seq-uniq. Update callers. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 7aa5684cfd..6c15463ad5 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -431,6 +431,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil." (setq index (1+ index))) nil))) +;;;###autoload (cl-defgeneric seq-uniq (sequence &optional testfn) "Return a list of the elements of SEQUENCE with duplicates removed. TESTFN is used to compare elements, or `equal' if TESTFN is nil." diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index b0a7544bda..0780d6ee83 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -130,7 +130,7 @@ The format of each entry is (?e . (lambda (lst) (mapcar #'file-name-extension lst))) (?t . (lambda (lst) (mapcar #'file-name-nondirectory lst))) (?q . (lambda (lst) (mapcar #'eshell-escape-arg lst))) - (?u . (lambda (lst) (eshell-uniquify-list lst))) + (?u . (lambda (lst) (seq-uniq lst))) (?o . (lambda (lst) (sort lst #'string-lessp))) (?O . (lambda (lst) (nreverse (sort lst #'string-lessp)))) (?j . (eshell-join-members)) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 1dcbed3d96..a48f62654d 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -291,20 +291,6 @@ Prepend remote identification of `default-directory', if any." (define-obsolete-function-alias 'eshell-flatten-list #'flatten-tree "27.1") -(defun eshell-uniquify-list (l) - "Remove occurring multiples in L. You probably want to sort first." - (let ((m l)) - (while m - (while (and (cdr m) - (string= (car m) - (cadr m))) - (setcdr m (cddr m))) - (setq m (cdr m)))) - l) -(define-obsolete-function-alias - 'eshell-uniqify-list - 'eshell-uniquify-list "27.1") - (defun eshell-stringify (object) "Convert OBJECT into a string value." (cond @@ -700,6 +686,8 @@ gid format. Valid values are `string' and `integer', defaulting to ;; Obsolete. +(define-obsolete-function-alias 'eshell-uniquify-list #'seq-uniq "28.1") +(define-obsolete-function-alias 'eshell-uniqify-list #'seq-uniq "28.1") (define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1") (define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1") diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index d5a608d6ff..a38da79422 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el @@ -182,7 +182,7 @@ If TYPE-ID is non-nil, then locate the schema for this TYPE-ID." (while files (setq type-ids (rng-possible-type-ids-using (car files) type-ids)) (setq files (cdr files))) - (rng-uniquify-equal (sort type-ids 'string<)))) + (seq-uniq (sort type-ids 'string<)))) (defun rng-locate-schema-file-using (files) "Locate a schema using the schema locating files FILES. diff --git a/lisp/nxml/rng-match.el b/lisp/nxml/rng-match.el index 4fc6727d0e..7a2739c061 100644 --- a/lisp/nxml/rng-match.el +++ b/lisp/nxml/rng-match.el @@ -472,7 +472,7 @@ list is nullable and whose cdr is the normalized list." (cons nullable (if sorted head - (rng-uniquify-eq (sort head 'rng-compare-ipattern)))))) + (seq-uniq (sort head 'rng-compare-ipattern) #'eq))))) (defun rng-compare-ipattern (p1 p2) (< (rng--ipattern-index p1) diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el index 7ea6fb2e49..33768a46c9 100644 --- a/lisp/nxml/rng-nxml.el +++ b/lisp/nxml/rng-nxml.el @@ -522,7 +522,7 @@ set `xmltok-dtd'. Returns the position of the end of the token." (unless attribute-flag (setcdr ns-prefixes (cons nil (cdr ns-prefixes)))))) (setq iter (cdr iter))) - (rng-uniquify-equal + (seq-uniq (sort (apply #'append (cons extra-strings (mapcar (lambda (name) diff --git a/lisp/nxml/rng-util.el b/lisp/nxml/rng-util.el index a20e95086c..67e2ee9f1e 100644 --- a/lisp/nxml/rng-util.el +++ b/lisp/nxml/rng-util.el @@ -36,26 +36,6 @@ (defconst rng-builtin-datatypes-uri (rng-make-datatypes-uri "")) -(defun rng-uniquify-eq (list) - "Destructively remove `eq' duplicates from LIST." - (and list - (let ((head list)) - (while (cdr head) - (if (eq (car head) (cadr head)) - (setcdr head (cddr head))) - (setq head (cdr head))) - list))) - -(defun rng-uniquify-equal (list) - "Destructively remove `equal' duplicates from LIST." - (and list - (let ((head list)) - (while (cdr head) - (if (equal (car head) (cadr head)) - (setcdr head (cddr head))) - (setq head (cdr head))) - list))) - (defun rng-blank-p (str) (string-match "\\`[ \t\n\r]*\\'" str)) (defun rng-substq (new old list) @@ -104,6 +84,14 @@ LIST is not modified." (define-error 'rng-error nil) +;; Obsolete. + +(defun rng-uniquify-eq (list) + (declare (obsolete seq-uniq "28.1")) + (seq-uniq list #'eq)) + +(define-obsolete-function-alias 'rng-uniquify-equal #'seq-uniq "28.1") + (provide 'rng-util) ;;; rng-util.el ends here diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index b648ecf098..bffdcaa2de 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -1260,18 +1260,9 @@ If specific documentation can't be given, be generic." (defun pcomplete-uniquify-list (l) "Sort and remove multiples in L." - (setq l (sort l 'string-lessp)) - (let ((m l)) - (while m - (while (and (cdr m) - (string= (car m) - (cadr m))) - (setcdr m (cddr m))) - (setq m (cdr m)))) - l) -(define-obsolete-function-alias - 'pcomplete-uniqify-list - 'pcomplete-uniquify-list "27.1") + (setq l (sort l #'string-lessp)) + (seq-uniq l)) +(define-obsolete-function-alias 'pcomplete-uniqify-list #'pcomplete-uniquify-list "27.1") (defun pcomplete-process-result (cmd &rest args) "Call CMD using `call-process' and return the simplest result." diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index f53f3f3b99..75f2016fc2 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -7601,15 +7601,6 @@ associated TAG, if any." (put-text-property (match-beginning 0) (match-end 0) 'face 'font-lock-string-face)))))) -(defun idlwave-uniquify (list) - (let ((ht (make-hash-table :size (length list) :test 'equal))) - (delq nil - (mapcar (lambda (x) - (unless (gethash x ht) - (puthash x t ht) - x)) - list)))) - (defun idlwave-after-successful-completion (type slash &optional verify) "Add `=' or `(' after successful completion of keyword and function. Restore the pre-completion window configuration if possible." @@ -9101,6 +9092,9 @@ This function was written since `list-abbrevs' looks terrible for IDLWAVE mode." ;; Run the hook (run-hooks 'idlwave-load-hook) +;; Obsolete. +(define-obsolete-function-alias 'idlwave-uniquify #'seq-uniq "28.1") + (provide 'idlwave) ;;; idlwave.el ends here diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 22ade15921..fbb9d2174f 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1753,13 +1753,6 @@ info-variant-part." "Call function FN with ARGS, if FN is not nil." `(if ,fn (funcall ,fn ,@args))) -(defun artist-uniq (l) - "Remove consecutive duplicates in list L. Comparison is done with `equal'." - (cond ((null l) nil) - ((null (cdr l)) l) ; only one element in list - ((equal (car l) (car (cdr l))) (artist-uniq (cdr l))) ; first 2 equal - (t (cons (car l) (artist-uniq (cdr l)))))) ; first 2 are different - (defun artist-string-split (str r) "Split string STR at occurrences of regexp R, returning a list of strings." (let ((res nil) @@ -2761,7 +2754,7 @@ to append to the end of the list, when doing free-hand drawing)." Also, the `artist-key-poly-point-list' is reversed." (setq artist-key-poly-point-list - (artist-uniq artist-key-poly-point-list)) + (seq-uniq artist-key-poly-point-list)) (if (>= (length artist-key-poly-point-list) 2) @@ -5372,10 +5365,7 @@ The event, EV, is the mouse event." (concat "Hello Tomas,\n\n" "I have a nice bug report on Artist for you! Here it is:"))))) - -;; -;; Now provide this minor mode -;; +(define-obsolete-function-alias 'artist-uniq #'seq-uniq "28.1") (provide 'artist) commit 20f7fa691b7c2859b96550d9ccb326bf394e160d Author: Stefan Kangas Date: Mon Apr 5 14:24:00 2021 +0200 Obsolete local set difference functions in favor of seq-difference * lisp/emacs-lisp/seq.el (seq-difference): Add autoload cookie. * lisp/gnus/gnus-range.el (gnus-set-difference): * lisp/gnus/spam.el (spam-set-difference): Make obsolete in favor of seq-difference. Update callers. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index f2f7d677e8..7aa5684cfd 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -468,6 +468,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil." (seq-reverse sequence1) '())) +;;;###autoload (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. Equality is defined by TESTFN if non-nil or by `equal' if nil." diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el index 1f564f192b..4249b50b9f 100644 --- a/lisp/gnus/gnus-cite.el +++ b/lisp/gnus/gnus-cite.el @@ -839,7 +839,7 @@ See also the documentation for `gnus-article-highlight-citation'." (setq current (car loop) loop (cdr loop)) (setcdr current - (gnus-set-difference (cdr current) numbers))))))))) + (seq-difference (cdr current) numbers #'eq))))))))) (defun gnus-cite-parse-attributions () (let (al-alist) @@ -999,7 +999,7 @@ See also the documentation for `gnus-article-highlight-citation'." loop (cdr loop)) (if (eq current best) () - (setcdr current (gnus-set-difference (cdr current) numbers)) + (setcdr current (seq-difference (cdr current) numbers #'eq)) (when (null (cdr current)) (setq gnus-cite-loose-prefix-alist (delq current gnus-cite-loose-prefix-alist) diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 456209f3d9..7d12ae9fdc 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -42,13 +42,8 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE." (defun gnus-set-difference (list1 list2) "Return a list of elements of LIST1 that do not appear in LIST2." - (let ((hash2 (make-hash-table :test 'eq)) - (result nil)) - (dolist (elt list2) (puthash elt t hash2)) - (dolist (elt list1) - (unless (gethash elt hash2) - (setq result (cons elt result)))) - (nreverse result))) + (declare (obsolete seq-difference "28.1")) + (seq-difference list1 list2 #'eq)) (defun gnus-range-nconcat (&rest ranges) "Return a range comprising all the RANGES, which are pre-sorted. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index ac9317ef4e..eeb5ac851a 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -8569,8 +8569,9 @@ If UNREPLIED (the prefix), limit to unreplied articles." (interactive "P" gnus-summary-mode) (if unreplied (gnus-summary-limit - (gnus-set-difference gnus-newsgroup-articles - gnus-newsgroup-replied)) + (seq-difference gnus-newsgroup-articles + gnus-newsgroup-replied + #'eq)) (gnus-summary-limit gnus-newsgroup-replied)) (gnus-summary-position-point)) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 5cbe8495d3..ceb2ebcdcb 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -579,7 +579,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (defun gnus-new-processable (unmarkp articles) (if unmarkp (nreverse (seq-intersection gnus-newsgroup-processable articles #'eq)) - (gnus-set-difference articles gnus-newsgroup-processable))) + (seq-difference articles gnus-newsgroup-processable #'eq))) (defun gnus-uu-mark-by-regexp (regexp &optional unmark) "Set the process mark on articles whose subjects match REGEXP. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index f06959f65d..8990b2bebe 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1614,13 +1614,15 @@ If LIMIT, first try to limit the search to the N last articles." (setq start-article 1)) (let* ((unread (gnus-compress-sequence - (gnus-set-difference - (gnus-set-difference + (seq-difference + (seq-difference existing (gnus-sorted-union (cdr (assoc '%Seen flags)) - (cdr (assoc '%Deleted flags)))) - (cdr (assoc '%Flagged flags))))) + (cdr (assoc '%Deleted flags))) + #'eq) + (cdr (assoc '%Flagged flags)) + #'eq))) (read (gnus-range-difference (cons start-article high) unread))) (when (> start-article 1) diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index d00f0a60b6..3f978918b9 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -710,16 +710,8 @@ finds ham or spam.") (defun spam-set-difference (list1 list2) "Return a set difference of LIST1 and LIST2. When either list is nil, the other is returned." - (if (and list1 list2) - ;; we have two non-nil lists - (progn - (dolist (item (append list1 list2)) - (when (and (memq item list1) (memq item list2)) - (setq list1 (delq item list1)) - (setq list2 (delq item list2)))) - (append list1 list2)) - ;; if either of the lists was nil, return the other one - (if list1 list1 list2))) + (declare (obsolete seq-difference "28.1")) + (seq-difference list1 list2 #'eq)) (defun spam-group-ham-mark-p (group mark &optional spam) "Checks if MARK is considered a ham mark in GROUP." @@ -1327,7 +1319,7 @@ In the case of mover backends, checks the setting of (new-articles (spam-list-articles gnus-newsgroup-articles classification)) - (changed-articles (spam-set-difference new-articles old-articles))) + (changed-articles (seq-difference new-articles old-articles #'eq))) ;; now that we have the changed articles, we go through the processors (dolist (backend (spam-backend-list)) (let (unregister-list) commit 257caab1d0bea17fb9bfb5a9e2c782cf96a7d052 Author: Stefan Kangas Date: Mon Apr 5 14:17:02 2021 +0200 Obsolete local list functions in shadowfile.el * lisp/shadowfile.el (shadow-union): Make obsolete in favour of cl-union. Update callers. (shadow-find): Make into obsolete function alias for seq-find. Update callers. (cl-lib): Remove unnecessary require. diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index a4f0eba444..7fe3ed2f9b 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -73,7 +73,6 @@ ;;; Code: -(require 'cl-lib) (require 'tramp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -172,20 +171,6 @@ created by `shadow-define-regexp-group'.") ;;; Syntactic sugar; General list and string manipulation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun shadow-union (a b) - "Add members of list A to list B if not equal to items already in B." - (if (null a) - b - (if (member (car a) b) - (shadow-union (cdr a) b) - (shadow-union (cdr a) (cons (car a) b))))) - -(defun shadow-find (func list) - "If FUNC applied to some element of LIST is non-nil, return first such element." - (while (and list (not (funcall func (car list)))) - (setq list (cdr list))) - (car list)) - (defun shadow-regexp-superquote (string) "Like `regexp-quote', but includes the \\` and \\'. This makes sure regexp matches nothing but STRING." @@ -226,7 +211,7 @@ information defining the cluster. For interactive use, call (defun shadow-get-cluster (name) "Return cluster named NAME, or nil." - (shadow-find + (seq-find (lambda (x) (string-equal (shadow-cluster-name x) name)) shadow-clusters)) @@ -252,7 +237,7 @@ information defining the cluster. For interactive use, call (defun shadow-site-cluster (site) "Given a SITE, return cluster it is in, or nil." (or (shadow-get-cluster (shadow-site-name site)) - (shadow-find + (seq-find (lambda (x) (string-match (shadow-cluster-regexp x) (shadow-name-site site))) shadow-clusters))) @@ -653,7 +638,7 @@ Consider them as regular expressions if third arg REGEXP is true." shadows shadow-files-to-copy (with-output-to-string (backtrace)))) (when shadows (setq shadow-files-to-copy - (shadow-union shadows shadow-files-to-copy)) + (cl-union shadows shadow-files-to-copy :test #'equal)) (when (not shadow-inhibit-message) (message "%s" (substitute-command-keys "Use \\[shadow-copy-files] to update shadows.")) @@ -839,6 +824,17 @@ look for files that have been changed and need to be copied to other systems." ;; continue standard unloading nil) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Obsolete +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun shadow-union (a b) + "Add members of list A to list B if not equal to items already in B." + (declare (obsolete cl-union "28.1")) + (cl-union a b :test #'equal)) + +(define-obsolete-function-alias 'shadow-find #'seq-find "28.1") + (provide 'shadowfile) ;;; shadowfile.el ends here commit 6060d53b3e8aa1cdc642b477a42a7b769c676598 Author: Michael Albinus Date: Mon Apr 5 12:45:10 2021 +0200 * test/infra/Dockerfile.emba (emacs-gnustep): Do not run parallel make. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 30a5897134..19c83a8016 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -68,5 +68,5 @@ COPY . /checkout WORKDIR /checkout RUN ./autogen.sh autoconf RUN ./configure --with-ns -RUN make -j4 bootstrap +RUN make bootstrap RUN make -j4 commit ac81c5c8fd1d38b845a203c83685a5e849489ee0 Author: Stefan Kangas Date: Mon Apr 5 01:58:50 2021 +0200 Remove code commented out since 1995 from ediff-util.el * lisp/vc/ediff-util.el (ediff-load-hook): Remove code commented out since the file was added in 1995. diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index b538216f45..1c78490870 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -4190,10 +4190,6 @@ Mail anyway? (y or n) ") (define-obsolete-function-alias 'ediff-add-to-history #'add-to-history "27.1") (define-obsolete-function-alias 'ediff-copy-list #'copy-sequence "28.1") - -;; don't report error if version control package wasn't found -;;(ediff-load-version-control 'silent) - (run-hooks 'ediff-load-hook) ;;; ediff-util.el ends here commit 1760029b092724271f9527543dbd9830b377704f Author: Stefan Kangas Date: Mon Apr 5 01:13:54 2021 +0200 Replace local intersection functions with seq-intersection * lisp/doc-view.el (doc-view-intersection): * lisp/gnus/gnus-range.el (gnus-intersection): * lisp/htmlfontify.el (hfy-interq): * lisp/loadhist.el (file-set-intersect): * lisp/mail/smtpmail.el (smtpmail-intersection): Make obsolete in favor of seq-intersection. Update all callers. * lisp/url/url-dav.el (url-intersection): Redefine as obsolete function alias for seq-intersection. Update callers. * lisp/mpc.el (mpc-intersection, mpc-cmd-list, mpc-reorder): Use seq-intersection. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index cef09009d9..0ae22934b2 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1802,11 +1802,6 @@ If BACKWARD is non-nil, jump to the previous match." (remove-overlays (point-min) (point-max) 'doc-view t) (if (consp image-mode-winprops-alist) (setq image-mode-winprops-alist nil))) -(defun doc-view-intersection (l1 l2) - (let ((l ())) - (dolist (x l1) (if (memq x l2) (push x l))) - l)) - (defun doc-view-set-doc-type () "Figure out the current document type (`doc-view-doc-type')." (let ((name-types @@ -1841,7 +1836,7 @@ If BACKWARD is non-nil, jump to the previous match." ((looking-at "AT&TFORM") '(djvu)))))) (setq-local doc-view-doc-type - (car (or (doc-view-intersection name-types content-types) + (car (or (nreverse (seq-intersection name-types content-types #'eq)) (when (and name-types content-types) (error "Conflicting types: name says %s but content says %s" name-types content-types)) @@ -2146,6 +2141,12 @@ See the command `doc-view-mode' for more information on this mode." (add-hook 'bookmark-after-jump-hook show-fn-sym) (bookmark-default-handler bmk))) +;; Obsolete. + +(defun doc-view-intersection (l1 l2) + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection l1 l2 #'eq))) + (provide 'doc-view) ;; Local Variables: diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c1071c1c68..d989a4d5bb 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6648,9 +6648,10 @@ not have a face in `gnus-article-boring-faces'." (catch 'only-boring (while (re-search-forward "\\b\\w\\w" nil t) (forward-char -1) - (when (not (gnus-intersection + (when (not (seq-intersection (gnus-faces-at (point)) - (symbol-value 'gnus-article-boring-faces))) + (symbol-value 'gnus-article-boring-faces) + #'eq)) (throw 'only-boring nil))) (throw 'only-boring t)))))) diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 6cc60cb49b..456209f3d9 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -179,12 +179,8 @@ Both lists have to be sorted over <." ;;;###autoload (defun gnus-intersection (list1 list2) - (let ((result nil)) - (while list2 - (when (memq (car list2) list1) - (setq result (cons (car list2) result))) - (setq list2 (cdr list2))) - result)) + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection list1 list2 #'eq))) ;;;###autoload (defun gnus-sorted-intersection (list1 list2) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index bd9a1a33ec..5cbe8495d3 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -578,7 +578,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (defun gnus-new-processable (unmarkp articles) (if unmarkp - (gnus-intersection gnus-newsgroup-processable articles) + (nreverse (seq-intersection gnus-newsgroup-processable articles #'eq)) (gnus-set-difference articles gnus-newsgroup-processable))) (defun gnus-uu-mark-by-regexp (regexp &optional unmark) diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index 15003fabcd..adf4427523 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -558,7 +558,7 @@ all. This may very well take some time.") (nnmail-activate 'nndiary) ;; Articles not listed in active-articles are already gone, ;; so don't try to expire them. - (setq articles (gnus-intersection articles active-articles)) + (setq articles (nreverse (seq-intersection articles active-articles #'eq))) (while articles (setq article (nndiary-article-to-file (setq number (pop articles)))) (if (and (nndiary-deletable-article-p group number) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 550083d0e2..b453061388 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -528,15 +528,6 @@ therefore no longer care about) will be invalid at any time.\n (group xdigit xdigit) (group xdigit xdigit))) -(defun hfy-interq (set-a set-b) - "Return the intersection (using `eq') of two lists SET-A and SET-B." - (let ((sa set-a) (interq nil) (elt nil)) - (while sa - (setq elt (car sa) - sa (cdr sa)) - (if (memq elt set-b) (setq interq (cons elt interq)))) - interq)) - (defun hfy-color-vals (color) "Where COLOR is a color name or #XXXXXX style triplet, return a list of three (16 bit) rgb values for said color.\n @@ -884,7 +875,9 @@ See also `hfy-display-class' for details of valid values for CLASS." (setq score 0) (ignore "t match")) ((not (cdr (assq key face-class))) ;Neither good nor bad. nil (ignore "non match, non collision")) - ((setq x (hfy-interq val (cdr (assq key face-class)))) + ((setq x (nreverse + (seq-intersection val (cdr (assq key face-class)) + #'eq))) (setq score (+ score (length x))) (ignore "intersection")) (t ;; nope. @@ -2352,6 +2345,13 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'." (let ((file (hfy-initfile))) (load file 'NOERROR nil nil) )) +;; Obsolete. + +(defun hfy-interq (set-a set-b) + "Return the intersection (using `eq') of two lists SET-A and SET-B." + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection set-a set-b #'eq))) + (provide 'htmlfontify) ;;; htmlfontify.el ends here diff --git a/lisp/loadhist.el b/lisp/loadhist.el index a60d6b2909..59c002d307 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -82,12 +82,6 @@ A library name is equivalent to the file name that `load-library' would load." (when (eq (car-safe x) 'require) (push (cdr x) requires))))) -(defsubst file-set-intersect (p q) - "Return the set intersection of two lists." - (let (ret) - (dolist (x p ret) - (when (memq x q) (push x ret))))) - (defun file-dependents (file) "Return the list of loaded libraries that depend on FILE. This can include FILE itself. @@ -97,7 +91,7 @@ A library name is equivalent to the file name that `load-library' would load." (dependents nil)) (dolist (x load-history dependents) (when (and (stringp (car x)) - (file-set-intersect provides (file-requires (car x)))) + (seq-intersection provides (file-requires (car x)) #'eq)) (push (car x) dependents))))) (defun read-feature (prompt &optional loaded-p) @@ -322,6 +316,13 @@ something strange, such as redefining an Emacs function." ;; Don't return load-history, it is not useful. nil) +;; Obsolete. + +(defsubst file-set-intersect (p q) + "Return the set intersection of two lists." + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection p q #'eq))) + (provide 'loadhist) ;;; loadhist.el ends here diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index ac5e8c3b6f..ab58aa455e 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -489,13 +489,6 @@ for `smtpmail-try-auth-method'.") recipient (concat recipient "@" smtpmail-sendto-domain))) -(defun smtpmail-intersection (list1 list2) - (let ((result nil)) - (dolist (el2 list2) - (when (memq el2 list1) - (push el2 result))) - (nreverse result))) - (defun smtpmail-command-or-throw (process string &optional code) (let (ret) (smtpmail-send-command process string) @@ -512,9 +505,10 @@ for `smtpmail-try-auth-method'.") (if port (format "%s" port) "smtp")) - (let* ((mechs (smtpmail-intersection + (let* ((mechs (seq-intersection + smtpmail-auth-supported (cdr-safe (assoc 'auth supported-extensions)) - smtpmail-auth-supported)) + #'eq)) (auth-source-creation-prompts '((user . "SMTP user name for %h: ") (secret . "SMTP password for %u@%h: "))) @@ -1087,6 +1081,12 @@ many continuation lines." (while (and (looking-at "^[ \t].*\n") (< (point) header-end)) (replace-match "")))))) +;; Obsolete. + +(defun smtpmail-intersection (list1 list2) + (declare (obsolete seq-intersection "28.1")) + (seq-intersection list2 list1 #'eq)) + (provide 'smtpmail) ;;; smtpmail.el ends here diff --git a/lisp/mpc.el b/lisp/mpc.el index 827f8aacdd..315d8c0626 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -129,12 +129,10 @@ "Return L1 after removing all elements not found in L2. If SELECTFUN is non-nil, elements aren't compared directly, but instead they are passed through SELECTFUN before comparison." - (let ((res ())) - (if selectfun (setq l2 (mapcar selectfun l2))) - (dolist (elem l1) - (when (member (if selectfun (funcall selectfun elem) elem) l2) - (push elem res))) - (nreverse res))) + (when selectfun + (setq l1 (mapcar selectfun l1)) + (setq l2 (mapcar selectfun l2))) + (seq-intersection l1 l2)) (defun mpc-event-set-point (event) (condition-case nil (posn-set-point (event-end event)) @@ -698,7 +696,7 @@ The songs are returned as alists." (let* ((osongs (mpc-cmd-find other-tag value)) (ofiles (mpc-assq-all 'file (apply 'append osongs))) (plfiles (mpc-assq-all 'file (apply 'append plsongs)))) - (when (mpc-intersection plfiles ofiles) + (when (seq-intersection plfiles ofiles) (push pl pls))))))) pls)) @@ -1669,7 +1667,7 @@ Return non-nil if a selection was deactivated." (mpc-cmd-list mpc-tag (car cst) val)) (cdr cst))))) (setq active - (if (listp active) (mpc-intersection active vals) vals)))) + (if (listp active) (seq-intersection active vals) vals)))) (when (listp active) ;; Remove the selections if they are all in conflict with diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 1d3a5e0f7d..e623dab26d 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -1680,6 +1680,7 @@ Sat, 07 Sep 2002 00:00:01 GMT nil)))) nil)) +;; FIXME: Can this be replaced by seq-intersection? (defun newsticker--lists-intersect-p (list1 list2) "Return t if LIST1 and LIST2 share elements." (let ((result nil)) diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el index edb1c1de9f..192b1ac4f4 100644 --- a/lisp/url/url-dav.el +++ b/lisp/url/url-dav.el @@ -43,22 +43,11 @@ (defvar url-http-response-status) (defvar url-http-end-of-headers) -(defun url-intersection (l1 l2) - "Return a list of the elements occurring in both of the lists L1 and L2." - (if (null l2) - l2 - (let (result) - (while l1 - (if (member (car l1) l2) - (setq result (cons (pop l1) result)) - (pop l1))) - (nreverse result)))) - ;;;###autoload (defun url-dav-supported-p (url) "Return WebDAV protocol version supported by URL. Returns nil if WebDAV is not supported." - (url-intersection url-dav-supported-protocols + (seq-intersection url-dav-supported-protocols (plist-get (url-http-options url) 'dav))) (defun url-dav-node-text (node) @@ -910,7 +899,9 @@ Returns nil if URL contains no name starting with FILE." t))) -;;; Miscellaneous stuff. +;;; Obsolete. + +(define-obsolete-function-alias 'url-intersection #'seq-intersection "28.1") (provide 'url-dav) commit 46b8d7087c8270c92d6a3b94e811de5e3cc99701 Author: Stefan Kangas Date: Mon Apr 5 01:38:48 2021 +0200 Make ediff-copy-list alias obsolete * lisp/vc/ediff-mult.el (ediff-intersect-directories) (ediff-get-directory-files-under-revision): Don't use above obsolete alias. * lisp/vc/ediff-util.el (ediff-copy-list): Make alias obsolete. diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 49b2890a16..8e88b60a0b 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -620,7 +620,7 @@ behavior." (setq common (ediff-intersection common lis3 #'string=))) ;; copying is needed because sort sorts via side effects - (setq common (sort (ediff-copy-list common) 'string-lessp)) + (setq common (sort (copy-sequence common) #'string-lessp)) ;; compute difference list (setq difflist (ediff-set-difference @@ -631,7 +631,7 @@ behavior." #'string=) difflist (delete "." difflist) ;; copying is needed because sort sorts via side effects - difflist (sort (ediff-copy-list (delete ".." difflist)) + difflist (sort (copy-sequence (delete ".." difflist)) #'string-lessp)) (setq difflist (mapcar (lambda (elt) (cons elt 1)) difflist)) @@ -729,7 +729,7 @@ behavior." ) ;; copying is needed because sort sorts via side effects - (setq common (sort (ediff-copy-list common) 'string-lessp)) + (setq common (sort (copy-sequence common) #'string-lessp)) ;; return result (cons diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index fc6dcf68a4..b538216f45 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -4188,8 +4188,7 @@ Mail anyway? (y or n) ") (cdr result))) (define-obsolete-function-alias 'ediff-add-to-history #'add-to-history "27.1") - -(defalias 'ediff-copy-list 'copy-sequence) +(define-obsolete-function-alias 'ediff-copy-list #'copy-sequence "28.1") ;; don't report error if version control package wasn't found commit e9c3d040bcfab5908e6deb7330038f36ce95bc93 Author: Stefan Kangas Date: Mon Apr 5 01:35:18 2021 +0200 * lisp/htmlfontify.el (hfy-triplet-regex): Use rx. diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 0c8d534824..550083d0e2 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -523,13 +523,10 @@ therefore no longer care about) will be invalid at any time.\n (defvar hfy-tmpfont-stack nil "An alist of derived fonts resulting from overlays.") -(defconst hfy-hex-regex "[[:xdigit:]]") - (defconst hfy-triplet-regex - (concat - "\\(" hfy-hex-regex hfy-hex-regex "\\)" - "\\(" hfy-hex-regex hfy-hex-regex "\\)" - "\\(" hfy-hex-regex hfy-hex-regex "\\)")) + (rx (group xdigit xdigit) + (group xdigit xdigit) + (group xdigit xdigit))) (defun hfy-interq (set-a set-b) "Return the intersection (using `eq') of two lists SET-A and SET-B." commit 1733fa0cab766bd3d2c725b31bc1e51d9b41ead7 Author: Stefan Kangas Date: Mon Apr 5 00:10:57 2021 +0200 * etc/NEWS: Add entry for new SVG icons in customize. diff --git a/etc/NEWS b/etc/NEWS index c93e2e7044..1421efcaa0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1056,6 +1056,10 @@ the commands 'customize', 'customize-group', 'customize-apropos' and To customize obsolete user options, use 'customize-option' or 'customize-saved'. +*** New SVG icons for checkboxes and arrows. +They will be used automatically instead of the old icons. If Emacs is +built without SVG support, the old icons will be used instead. + ** Edebug *** Obsoletions