Remove unnecessary conversion from list of strings to string
This has made the code a lot more performant with large directories. After the above removal, the (mapcar #'shell-quote-argument) was removed because it was causing issues with recursive operation - many directories ended up being left out, and sxiv complained about not being able to find them.
This commit is contained in:
parent
d67f6721d7
commit
2591e0ba37
|
@ -4,4 +4,8 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
### Fixed
|
||||||
|
* Slow startup/freezing on large directories
|
||||||
|
|
||||||
## [0.1.0] - 2020-01-12
|
## [0.1.0] - 2020-01-12
|
||||||
|
|
|
@ -25,7 +25,6 @@ Run it from a text file containing one file name per line to open the listed fil
|
||||||
7. What should be the behavior when we open Dired-marked files, then mark files within sxiv?
|
7. What should be the behavior when we open Dired-marked files, then mark files within sxiv?
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
* Currently falls flat if run in directories with a huge number of images.
|
|
||||||
* `sxiv-dired-marked-files-p` doesn't work as intended with non '*' markers (e.g. C or D)
|
* `sxiv-dired-marked-files-p` doesn't work as intended with non '*' markers (e.g. C or D)
|
||||||
|
|
||||||
## Comparison with [picpocket](https://github.com/johanclaesson/picpocket)
|
## Comparison with [picpocket](https://github.com/johanclaesson/picpocket)
|
||||||
|
|
15
sxiv.el
15
sxiv.el
|
@ -75,21 +75,14 @@ the files listed."
|
||||||
(recurse (or prefix
|
(recurse (or prefix
|
||||||
(-every? #'file-directory-p paths)))
|
(-every? #'file-directory-p paths)))
|
||||||
;; remove directories if not running recursively
|
;; remove directories if not running recursively
|
||||||
(paths (->> (if recurse
|
(paths (if recurse
|
||||||
paths
|
paths
|
||||||
(seq-remove #'file-directory-p paths))
|
(seq-remove #'file-directory-p paths)))
|
||||||
(mapcar #'shell-quote-argument)
|
|
||||||
(--reduce (concat acc " " it))))
|
|
||||||
(recurse (if recurse "-r" ""))
|
(recurse (if recurse "-r" ""))
|
||||||
(proc (make-process :name "sxiv"
|
(proc (make-process :name "sxiv"
|
||||||
:buffer "sxiv"
|
:buffer "sxiv"
|
||||||
:command
|
:command
|
||||||
(list shell-file-name
|
(apply #'list "sxiv" "-afo" recurse "--" paths)
|
||||||
shell-command-switch
|
|
||||||
(concat "sxiv -afo "
|
|
||||||
recurse
|
|
||||||
" -- "
|
|
||||||
paths))
|
|
||||||
:connection-type 'pipe
|
:connection-type 'pipe
|
||||||
:stderr "sxiv-errors")))
|
:stderr "sxiv-errors")))
|
||||||
(setq sxiv--directory default-directory)
|
(setq sxiv--directory default-directory)
|
||||||
|
|
Reference in New Issue