FTD - The Flexi-Trivial Dired

Abstract

FTD is a Dired-style file manager in [Mc]Clim. It was conceived as a basis for experimenting with various Clim concepts, including integration with other Clim applications like Climacs. One day it will fulfill this function. At the moment it just does some of what the Emacs Dired does, using methods very similar to those of Emacs Dired.

WARNING! WARNING! DANGER WILL ROBINSON! This program deliberately alters your filesystem and runs shell programs. It has been developed on a single computer (iBook G4) under a single OS (OSX 10.4) using a single style of operation (mine). Who knows what it might do on your computer, OS and style. YOU HAVE BEEN WARNED.

FTD comes with an MIT-style license so you can basically do with it whatever you want.

Download shortcut: http://common-lisp.net/project/ftd/releases/ftd-0.0.3.tar.gz

Contents

  1. Download, installation and mailing lists
  2. Supported Lisp implementations
  3. Introduction
  4. The FTD dictionary
    1. Tabs
    2. Movement
    3. Deletion
    4. Marking
    5. Actions
    6. Variables
  5. TODO
  6. Contact

Download, installation and mailing lists

FTD is available via Darcs from here.

FTD relies on mcclim, cl-fad, cl-ppcre, cffi-net, flexichain and ESA.

FTD comes with a simple system definition for asdf so you can either adapt it to your needs or just unpack the archive and from within the FTD directory start your Lisp image and evaluate the form (asdf:oos 'asdf:load-op :ftd) which should compile and load the whole system. Installation via asdf-install may one day be possible.

Implementation status

FTD is reported to work as follows:

I'll gladly accept patches to make FTD work on other platforms.

Introduction

FTD allows you to perform operations on files. Files are grouped into tabs. A tab might represent a directory, or all the files matching some shell wildcard, or all the files found with some incantation of find, or all the source files in an ASDF system.

Within a tab the files are displayed one per line, with the output as from ls -la. A cursor is displayed next to the current entry in the tab.

You can 'flag' files (a D shows up at the beginning of the line) and then later 'Expunge', or delete them. Or you can 'mark' files (a * is used), and then act on those marked files in various ways. You can also use other marks than D and *.

Visiting an entry (with f) will try to run ed on it, unless it is a directory, in which case you'll be taken to a tab containing the files in that directory.

Sometimes (often?) the information in a tab will get out of sync with what is on disk. You can use l to resync only a few files, or g to recreate the whole tab.

Oh, yeah. You start FTD with (ftd:ftd).

The FTD dictionary

Tabs


[Command]
Dired path
C-x d

Creates a new tab for the directory named by path (which may be wild).


[Command]
System system-name
C-x s

Creates a new tab for the asdf system named by system-name. The system must be loaded to be found.


[Command]
Find Name directory name
C-x n

Creates a new tab for the files found by running find in directory with the -name argument name.


[Command]
Find Grep directory grep-regex
C-x g

Creates a new tab for the files found by running grep with the regex grep-regex on files found by find from directory.


[Command]
Find Dired directory find-arguments
C-x f

Creates a new tab for the files found by running find with the arguments find-arguments from directory.


[Command]
Close Tab
q

Close the current tab. To close the last tab, you must Quit.


[Command]
Quit
C-x C-c

Quit FTD.

Movement


[Command]
Next Line count
n, C-n, SPACE, DOWN

Moves the cursor down count (default 1) lines.


[Command]
Previous Line count
p, C-p, UP

Moves the cursor up count (default 1) lines.


[Command]
Page Down
C-v

Moves the cursor to the next 'page'.


[Command]
Page Up
M-v

Moves the cursor to the previous 'page'.


[Command]
First Line
M-<

Moves the cursor to the first line.


[Command]
Last Line
M->

Moves the cursor to the last line.

Deletion


[Command]
Delete File entries

Mark entries (typed in or selected with the mouse - use a comma to separate entries) for deletion.


[Command]
keyboard-delete-file count
d

Mark the next count (default 1) files for deletion.


[Command]
Undelete File entries

Remove marks from entries (typed in or selected with the mouse - use a comma to separate entries).


[Command]
keyboard-undelete-file count
u, * u

Remove marks from the next count (default 1) files.


[Command]
Backward Undelete File count
BACKSPACE, * BACKSPACE

Remove marks from the previous count (default 1) files.


[Command]
Flag Backup Files
~

Mark backup files (those with names ending in ~) for deletion.


[Command]
Flag Auto Save Files
#

Mark auto save files (those whose names begin and end with #) for deletion.


[Command]
Regexp Flag Files regexp
% d

Mark files whose names match regexp for deletion.


[Command]
Flag Excess Backups
.

Mark numbered backups other than the *kept-old-versions* oldest and *kept-new-versions* most recent for deletion.


[Command]
Expunge
x

Delete from disk the files marked for deletion.

Marking


[Command]
Mark File entries

Mark the entries (typed in or selected with the mouse - use a comma to separate entries).


[Command]
keyboard-mark-file count
m, * m

Mark the next count (default 1) files.


[Command]
Mark All Files
* s

Mark all files in the tab.


[Command]
Regexp Mark Files regexp
% m, * %

Mark files whose names match regexp.


[Command]
Eval Mark Files expression
* (

Mark files for which (the lisp) expression returns true. expression will be evaluated for each file, with the special variable *entry* bound to the ftd-entry instance for that file.


[Command]
Mark Regexp Containing Files regexp
% g

Mark files where grep can find regexp.


[Command]
Mark Extension extension
* .

Mark files whose name has the extension (the part of the name following the final .) extension.


[Command]
Mark Executables
* *

Mark executable files.


[Command]
Mark Symlinks
* @

Mark files that are symbolic links.


[Command]
Mark Directories
* /

Mark directories.


[Command]
Next Marked File
* C-n, M-}

Move the cursor to the next marked file.


[Command]
Previous Marked File
* C-p, M-{

Move the cursor to the previous marked file.


[Command]
Toggle Marks
* t

Mark all unmarked files, and remove * marks from files that have them.


[Command]
Unmark All Marks
* !, U

Remove all marks from all files.


[Command]
Unmark All Files query mark
* ?

Remove all mark marks from files, asking for confirmation if query is true (ie. a prefix argument is supplied).


[Command]
Change Marks old-mark new-mark
* c

Replaces all old-marks with new-marks.

Actions


[Command]
Create Directory name
+

Create the directory name.


[Command]
Visit File
f

If the entry at the cursor is a directory, switches to the corresponding tab or creates a new tab for that directory. If it is a file, calls ed on it.


[Command]
Revert Tab
g

Reread information about all entries in the tab from disk.

The following commands all work on the relevant entries, being:


[Command]
New Tab count name
C-x t

Create a new file list tab named name with the relevant entries.


[Command]
Add Files count tab
C-x a

Add the relevant entries to the file list tab tab.


[Command]
Chmod count mode
M

Change the mode of the relevant entries to mode (anything that chmod accepts).


[Command]
Chgrp count group
G

Change the group of the relevant entries to group (anything that chgrp accepts).


[Command]
Chown count owner
O

Change the owner of the relevant entries to owner (anything that chown accepts).


[Command]
Touch count time
T

Change the modifcation and access times of the relevant entries to time (anything time format that touch accepts).


[Command]
Delete count
D

Delete the relevant entries.


[Command]
Copy count destination
C

Copy the relevant entries to destination.


[Command]
Rename count destination
R

Rename/move the relevant entries to destination.


[Command]
Hardlink count destination
H

Create hard links to the relevant entries in destination.


[Command]
Symlink count destination
S

Create symbolic links to the relevant entries in destination.


[Command]
Upcase count
% u

Change the name of each relevant file to its uppercase counterpart.


[Command]
Downcase count
% l

Change the name of each relevant file to its lowercase counterpart.


[Command]
Capitalize count
% k

Change the name of each relevant file to its capitalized counterpart.


[Command]
Regexp Rename count from to
% R

Change the name of each relevant file matched by the regexp from to regexp substitution to.


[Command]
Regexp Hardlink count from to
% H

Create a hard link to each relevant file matched by the regexp from with the name given by regexp substitution to.


[Command]
Regexp Symlink count from to
% S

Create a symbolic link to each relevant file matched by the regexp from with the name given by regexp substitution to.


[Command]
Regexp Copy count from to
% C

Copy each relevant file matched by the regexp from to the name given by regexp substitution to.


[Command]
Redisplay count
l

Reread the information about the relevant entries from disk.


[Command]
Shell Command count command-line
!, X

Have the shell execute command-line:

Variables


[Command]
Set Variable variable value

Sets variable to value. Variables are declared with define-variable, which is like defvar but takes an optional fourth argument p-type, being the presentation type to use when prompting for a new value. The name is user-fied, so that *foo-variable* becomes Foo Variable for variable.


[Special variable]
*flag-character* #\D

The character to be used for marking entries for deletion.


[Special variable]
*mark-character* #\*

The character to be used for marking entries.


[Special variable]
*kept-new-versions* 2

Number of most recent numbered backups to keep.


[Special variable]
*kept-old-versions* 2

Number of oldest numbered backups to keep.


[Special variable]
*chown-program* "chown"

The program to be used as 'chown'.


[Special variable]
*chgrp-program* "chgrp"

The program to be used as 'chgrp'.


[Special variable]
*chmod-program* "chmod"

The program to be used as 'chmod'.


[Special variable]
*touch-program* "touch"

The program to be used as 'touch'.


[Special variable]
*cursor-ink* +red+

The ink to be used for the cursor.


[Special variable]
*flag-ink* +dark-green+

The ink to be used for flags.


[Special variable]
*deleted-files-ink* +dark-red+

The ink to be used for the names of files flagged for deletion.


[Special variable]
*marked-files-ink* +dark-blue+

The ink to be used for the names of marked files.

TODO

Contact

Comments, queries and suggestions to: splittist at yahoo dot com