;;; filesets.el --- handle group of files -*- coding: utf-8 -*-
-;; Copyright (C) 2002-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2014 Free Software Foundation, Inc.
;; Author: Thomas Link <sanobast-emacs@yahoo.de>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Keywords: filesets convenience
;; This file is part of GNU Emacs.
(defun filesets-which-command-p (cmd)
"Call \"which CMD\" and return non-nil if the command was found."
- (when (string-match (format "\\(/[^/]+\\)?/%s" cmd)
- (filesets-which-command cmd))
+ (when (string-match-p (format "\\(/[^/]+\\)?/%s" cmd)
+ (filesets-which-command cmd))
cmd))
(defun filesets-message (level &rest args)
(require 'easymenu)
- (defun filesets-error (class &rest args)
+ (defun filesets-error (_class &rest args)
"`error' wrapper."
(error "%s" (mapconcat 'identity args " ")))
If NEGATIVE is non-nil, remove all directory names."
(filesets-filter-list lst
(lambda (x)
- (and (not (string-match "^\\.+/$" x))
+ (and (not (string-match-p "^\\.+/$" x))
(if negative
- (not (string-match "[:/\\]$" x))
- (string-match "[:/\\]$" x))))))
+ (not (string-match-p "[:/\\]$" x))
+ (string-match-p "[:/\\]$" x))))))
(defun filesets-conditional-sort (lst &optional access-fn)
"Return a sorted copy of LST, LST being a list of strings.
(dirs nil))
(dolist (this (file-name-all-completions "" dir))
(cond
- ((string-match "^\\.+/$" this)
+ ((string-match-p "^\\.+/$" this)
nil)
- ((string-match "[:/\\]$" this)
+ ((string-match-p "[:/\\]$" this)
(when (or (not match-dirs-flag)
(not pattern)
- (string-match pattern this))
+ (string-match-p pattern this))
(filesets-message 5 "Filesets: matched dir %S with pattern %S"
this pattern)
(setq dirs (cons this dirs))))
(t
(when (or (not pattern)
- (string-match pattern this))
+ (string-match-p pattern this))
(filesets-message 5 "Filesets: matched file %S with pattern %S"
this pattern)
(setq files (cons (if full-flag
(let ((filename (file-name-nondirectory file)))
(filesets-some
(lambda (entry)
- (when (and (string-match (nth 0 entry) filename)
+ (when (and (string-match-p (nth 0 entry) filename)
(filesets-eviewer-constraint-p entry))
entry))
filesets-external-viewers)))
n name)))
(dolist (this files nil)
(filesets-file-open open-function this))
- (message "Filesets: cancelled")))
+ (message "Filesets: canceled")))
(filesets-error 'error "Filesets: Unknown fileset: " name))))
(defun filesets-close (&optional mode name lookup-name)
(fn (or fun (lambda (a b)
(and (stringp a)
(stringp b)
- (string-match a b))))))
+ (string-match-p a b))))))
(filesets-some (lambda (x)
(if (funcall fn (car x) masterfile)
(nth pos x)