diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-04-05 14:17:02 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-04-05 14:18:24 +0200 |
commit | 257caab1d0bea17fb9bfb5a9e2c782cf96a7d052 (patch) | |
tree | a53c4f885800ee2d7432a3685fec50c601e4f302 /lisp/shadowfile.el | |
parent | 6060d53b3e8aa1cdc642b477a42a7b769c676598 (diff) | |
download | emacs-257caab1d0bea17fb9bfb5a9e2c782cf96a7d052.tar.gz emacs-257caab1d0bea17fb9bfb5a9e2c782cf96a7d052.tar.bz2 emacs-257caab1d0bea17fb9bfb5a9e2c782cf96a7d052.zip |
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.
Diffstat (limited to 'lisp/shadowfile.el')
-rw-r--r-- | lisp/shadowfile.el | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index a4f0eba4449..7fe3ed2f9bd 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 |