Asynchoronous execution library for Emacs Dired
A library for Emacs Dired mode to copy, compress, decompress files asynchronously. It also provides the ability to mark files in multiple directories and then copy all of them into a destination library. This library is designed for Unix-based system like MacOS, Ubuntu,… The reason why I developed this library is to overcome Emacs Dired’s drawbacks. Everytime I need to copy, move, compress, uncompress,… big files, Emacs is blocked until those processes finish execution. That’s really annoying. This extension helps solve that problem by providing Emacs with the ability to asynchronously execute those tasks as well as display the output to the user.
Installation
tmtxt-dired-async replies on tmtxt-async-tasks so before using it, please install tmtxt-async-tasks first.
After that, clone this repo and put it somewhere in your load-path
Add this to your .emacs
Features
You don’t have to follow the key bindings below, you can change them to whatever you want. They are just examples.
Asynchronously Copy/Sync files
This feature uses rsync
for file copying. To use it, simply mark the files
that you want and then activate this function.
To rsync
with --delete
option to create an exact copy of the source files
(synchronize files), use this function
Sometimes rsync need sudo permission for preserving file attributes. In that case, there are 2 alternative commands for the above ones. They are tda/rsync-sudo and tda/rsync-delete-sudo.
If your rsync program is outside of the PATH, set the path to the rsync executable for this variable
To change the arguments passed into rsync command, set it for this variable. The
default is -avz --progress
.
Asynchronously Compress files
Compress all marked files.
If you want to use another zip
command, not the system’s default one, set the
path to executable file and it arguments for these 2 variables
Asynchronously Decompress files
Decompress the zip file at point.
If you want to use another unzip
command, not the system’s default one, set the
path to executable file and it arguments for these 2 variables
Copy from multiple directories
This feature allows you to select many files from multi directories and then copy all of them to a destination folder.
C-c C-a to add the file at point to the list for later copy. C-c C-d to remove the current file at point from the waiting list. C-c C-e to empty the waiting list. Finally, C-c C-v to copy all files in the list to the current directory.
Get size of multiple files
This feature uses the command du
to calculate the total size of all marked
files.
If you want to use another unzip
command, not the system’s default one, set the
path to executable file and it arguments for these 2 variables
Download file to current dir
This command read input link from minibuffer and then download it to the current directory.
Another handy command is tda/download-clipboard-to-current-dir
, which is
similar to the above command. Instead of prompting user for the link, it reads
from the clipboard.
You can also specify the download program you want to use by changing the
variable tda/download-command
. The default value is wget, you can change
it to curl, aria2c,…
Note: On Mac OS, if your wget encounter the problem with ssl certificate, read the instruction in this post.