diff options
author | Glenn Morris <rgm@gnu.org> | 2013-07-11 20:54:57 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-07-11 20:54:57 -0700 |
commit | 539a920cda27cad65e298535ec082aa52e86daa2 (patch) | |
tree | 5f86925daa5b06b3f8b7ece87cfec3d20ff30afa /lisp/shadowfile.el | |
parent | bacba3c26522ef297662bace31947d3e4f47c87a (diff) | |
download | emacs-539a920cda27cad65e298535ec082aa52e86daa2.tar.gz |
Remove some more reimplementations of cl-lib functions
* lisp/doc-view.el: Require cl-lib at runtime too.
(doc-view-remove-if): Remove.
(doc-view-search-next-match, doc-view-search-previous-match):
Use cl-remove-if.
* lisp/edmacro.el: Require cl-lib at runtime too.
(edmacro-format-keys, edmacro-parse-keys): Use cl-mismatch, cl-subseq.
(edmacro-mismatch, edmacro-subseq): Remove.
* lisp/filesets.el: Comments.
* lisp/shadowfile.el: Require cl-lib.
(shadow-remove-if): Remove.
(shadow-set-cluster, shadow-shadows-of-1, shadow-remove-from-todo):
Use cl-remove-if.
* lisp/wid-edit.el: Require cl-lib.
(widget-choose): Use cl-remove-if.
(widget-remove-if): Remove.
* lisp/progmodes/ebrowse.el: Require cl-lib at runtime too.
(ebrowse-delete-if-not): Remove.
(ebrowse-browser-buffer-list, ebrowse-member-buffer-list)
(ebrowse-tree-buffer-list, ebrowse-same-tree-member-buffer-list):
Use cl-delete-if-not.
Diffstat (limited to 'lisp/shadowfile.el')
-rw-r--r-- | lisp/shadowfile.el | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index ec6e6e7ff10..3e7789069f9 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -74,6 +74,7 @@ ;;; Code: +(require 'cl-lib) (require 'ange-ftp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -180,15 +181,6 @@ created by `shadow-define-regexp-group'.") (setq list (cdr list))) (car list)) -(defun shadow-remove-if (func list) - "Remove elements satisfying FUNC from LIST. -Nondestructive; actually returns a copy of the list with the elements removed." - (if list - (if (funcall func (car list)) - (shadow-remove-if func (cdr list)) - (cons (car list) (shadow-remove-if func (cdr list)))) - nil)) - (defun shadow-regexp-superquote (string) "Like `regexp-quote', but includes the ^ and $. This makes sure regexp matches nothing but STRING." @@ -238,9 +230,8 @@ instead." Replace old definition, if any. PRIMARY and REGEXP are the information defining the cluster. For interactive use, call `shadow-define-cluster' instead." - (let ((rest (shadow-remove-if - (function (lambda (x) (equal name (car x)))) - shadow-clusters))) + (let ((rest (cl-remove-if (lambda (x) (equal name (car x))) + shadow-clusters))) (setq shadow-clusters (cons (shadow-make-cluster name primary regexp) rest)))) @@ -602,9 +593,8 @@ and to are absolute file names." Consider them as regular expressions if third arg REGEXP is true." (if groups (let ((nonmatching - (shadow-remove-if - (function (lambda (x) (shadow-file-match x file regexp))) - (car groups)))) + (cl-remove-if (lambda (x) (shadow-file-match x file regexp)) + (car groups)))) (append (cond ((equal nonmatching (car groups)) nil) (regexp (let ((realname (nth 2 (shadow-parse-fullname file)))) @@ -635,8 +625,7 @@ Consider them as regular expressions if third arg REGEXP is true." "Remove PAIR from `shadow-files-to-copy'. PAIR must be `eq' to one of the elements of that list." (setq shadow-files-to-copy - (shadow-remove-if (function (lambda (s) (eq s pair))) - shadow-files-to-copy))) + (cl-remove-if (lambda (s) (eq s pair)) shadow-files-to-copy))) (defun shadow-read-files () "Visit and load `shadow-info-file' and `shadow-todo-file'. |