From 76f63afd549927cb23a5b6df7cf5157f10025d9f Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Mon, 13 Jan 2020 18:56:29 +0530 Subject: [PATCH 1/2] Add support for excluding files --- sxiv.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sxiv.el b/sxiv.el index a9b64f6..dd640f7 100644 --- a/sxiv.el +++ b/sxiv.el @@ -21,6 +21,10 @@ It must contain \"-o\" for marking in Dired buffers to function." :type '(repeat string)) +(defcustom sxiv-exclude-strings '() + "Exclude files whose paths match these strings." + :type '(repeat string)) + (defvar sxiv--directory nil "Directory `sxiv' was called from. Used by `sxiv-filter' to know where to mark files.") @@ -78,7 +82,10 @@ the files listed." (split-string it "\n"))) (t (directory-files default-directory)))) (paths (--remove (or (equal it ".") - (equal it "..")) + (equal it "..") + (-find (lambda (exclude) + (string-match-p exclude it)) + sxiv-exclude-strings)) paths)) ;; recurse with prefix arg, or if every path is a directory (recurse (or prefix From ad752ca78cd5ce5028128af99292eba3ef6baad4 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Mon, 13 Jan 2020 20:46:14 +0530 Subject: [PATCH 2/2] package-lint fixes --- sxiv.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sxiv.el b/sxiv.el index dd640f7..fd1fc9e 100644 --- a/sxiv.el +++ b/sxiv.el @@ -2,7 +2,9 @@ ;; Author: contrapunctus ;; Maintainer: contrapunctus -;; Package-Requires: (dash (emacs "25.1")) +;; Keywords: multimedia +;; Homepage: https://notabug.org/contrapunctus/sxiv.el/src/master/sxiv.el +;; Package-Requires: ((dash "2.16.0") (emacs "25.1")) ;; Version: 0.1.0 ;;; Commentary: @@ -14,7 +16,7 @@ (defgroup sxiv nil "Run the Simple X Image Viewer." - :group 'external) + :group 'multimedia) (defcustom sxiv-arguments '("-a" "-f" "-o") "Arguments to be passed to the sxiv process.