diff --git a/CHANGELOG.md b/CHANGELOG.md index a115537..ee867fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Added +* `sxiv-arguments` to hold argument list ### Fixed * Slow startup/freezing on large directories diff --git a/README.md b/README.md index 4843fe7..402cf00 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ With prefix argument, or when only provided directories, run recursively. Run it from a text file containing one file name per line to open the listed files. ## TODO -1. Create user-customizable variable to hold default arguments +1. [x] Create user-customizable variable to hold default arguments 2. Start sxiv on the file at point (using `-n ...`) 3. Let user specify paths to be excluded. 4. Mark files in subdirectories if run recursively (by inserting the subdirectory into the current buffer) diff --git a/sxiv.el b/sxiv.el index d116d5c..a9b64f6 100644 --- a/sxiv.el +++ b/sxiv.el @@ -12,6 +12,15 @@ ;;; Code: +(defgroup sxiv nil + "Run the Simple X Image Viewer." + :group 'external) + +(defcustom sxiv-arguments '("-a" "-f" "-o") + "Arguments to be passed to the sxiv process. +It must contain \"-o\" for marking in Dired buffers to function." + :type '(repeat string)) + (defvar sxiv--directory nil "Directory `sxiv' was called from. Used by `sxiv-filter' to know where to mark files.") @@ -82,7 +91,10 @@ the files listed." (proc (make-process :name "sxiv" :buffer "sxiv" :command - (apply #'list "sxiv" "-afo" recurse "--" paths) + (append '("sxiv") + sxiv-arguments + `(,recurse "--") + paths) :connection-type 'pipe :stderr "sxiv-errors"))) (setq sxiv--directory default-directory)