precedes the `custom-set-variables' command or, for XEmacs, if init.el
is loaded before custom.el, set this variable to t.")
-
-;;; utils
(defun filesets-filter-list (lst cond-fn)
"Remove all elements not conforming to COND-FN from list LST.
COND-FN takes one argument: the current element."
-; (cl-remove 'dummy lst :test (lambda (dummy elt)
-; (not (funcall cond-fn elt)))))
- (let ((rv nil))
- (dolist (elt lst)
- (when (funcall cond-fn elt)
- (push elt rv)))
- (nreverse rv)))
+ (declare (obsolete seq-filter "29.1"))
+ (seq-filter cond-fn lst))
(defun filesets-ormap (fsom-pred lst)
"Return the tail of LST for the head of which FSOM-PRED is non-nil."
(setq filesets-menu-use-cached-flag nil)
(when (default-boundp 'filesets-data)
(let ((modified-filesets
- (filesets-filter-list val
- (lambda (x)
- (let ((name (car x))
- (data (cdr x)))
- (let ((elt (assoc name filesets-data)))
- (or (not elt)
- (not (equal data (cdr elt))))))))))
+ (seq-filter (lambda (x)
+ (let ((name (car x))
+ (data (cdr x)))
+ (let ((elt (assoc name filesets-data)))
+ (or (not elt)
+ (not (equal data (cdr elt)))))))
+ val)))
(dolist (x modified-filesets)
(filesets-reset-fileset (car x))))))
(filesets-set-default sym val))
(defun filesets-filter-dir-names (lst &optional negative)
"Remove non-directory names from a list of strings.
If NEGATIVE is non-nil, remove all directory names."
- (filesets-filter-list lst
- (lambda (x)
- (and (not (string-match-p "^\\.+/$" x))
- (if negative
- (not (string-match-p "[:/\\]$" x))
- (string-match-p "[:/\\]$" x))))))
+ (seq-filter (lambda (x)
+ (and (not (string-match-p "^\\.+/$" x))
+ (if negative
+ (not (string-match-p "[:/\\]$" x))
+ (string-match-p "[:/\\]$" x))))
+ lst))
(defun filesets-conditional-sort (lst &optional access-fn)
"Return a sorted copy of LST, LST being a list of strings.
(filesets-directory-files dir patt ':files t))
;; (message "Filesets: malformed entry: %s" entry)))))))
(error "Filesets: malformed entry: %s" entry)))))))
- (filesets-filter-list fl
- (lambda (file)
- (not (filesets-filetype-property file event))))))
+ (seq-filter (lambda (file)
+ (not (filesets-filetype-property file event)))
+ fl)))
(defun filesets-files-under (level depth entry dir patt &optional relativep)
"Files under DIR that match PATT.