rename map to seq

The old terminology didn't make much sense to users.
pull/1/merge
Christian Neukirchen 8 years ago
parent 1fd83bf1a8
commit 2b81707c51

@ -82,7 +82,7 @@ EXAMPLES
CONCEPTS
Santoku deals with messages (which are files), folders (which are Maildir
folders), sequences (which are newline-separated lists of messages,
possibly persisted on disk in ~/.santoku/map), and the current message
possibly persisted on disk in ~/.santoku/seq), and the current message
(kept as a symlink in ~/.santoku/cur).
Messages in the persisted sequence can be referred to using special

@ -134,7 +134,7 @@ As usual with pipes, the sky is the limit.
deals with messages (which are files),
folders (which are Maildir folders),
sequences (which are newline-separated lists of messages, possibly persisted on disk in
.Pa ~/.santoku/map ) ,
.Pa ~/.santoku/seq ) ,
and the current message (kept as a symlink in
.Pa ~/.santoku/cur ) .
.Pp

@ -58,10 +58,10 @@ but append to the mail sequence instead of replacing it.
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev MAILMAP
.It Ev MAILSEQ
File were the sequence is stored.
(Default:
.Pa ~/.santoku/map )
.Pa ~/.santoku/seq )
.El
.Sh EXIT STATUS
.Ex -std

@ -69,10 +69,10 @@ oneline(char *file)
{
static int init;
if (!init) {
// delay loading of the seqmap until we need to scan the first
// delay loading of the seq until we need to scan the first
// file, in case someone in the pipe updated the map before
char *seqmap = blaze822_seq_open(0);
blaze822_seq_load(seqmap);
char *seq = blaze822_seq_open(0);
blaze822_seq_load(seq);
cur = blaze822_seq_cur();
init = 1;
}

@ -1,4 +1,5 @@
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <search.h>
#include <string.h>
@ -181,9 +182,9 @@ stdinmode()
if (Sflag) {
// XXX locking?
seqfile = getenv("MAILMAP");
seqfile = getenv("MAILSEQ");
if (!seqfile)
seqfile = blaze822_home_file(".santoku/map");
seqfile = blaze822_home_file(".santoku/seq");
snprintf(tmpfile, sizeof tmpfile, "%s-", seqfile);
snprintf(oldfile, sizeof oldfile, "%s.old", seqfile);
outfile = fopen(tmpfile, "w+");
@ -223,7 +224,7 @@ stdinmode()
if (Sflag) {
fflush(outfile);
if (rename(seqfile, oldfile) < 0) {
if (rename(seqfile, oldfile) < 0 && errno != ENOENT) {
perror("rename");
exit(2);
}
@ -270,8 +271,8 @@ main(int argc, char *argv[])
if (optind == argc && !isatty(0))
return stdinmode();
char *map = blaze822_seq_open(0);
if (!map)
char *seq = blaze822_seq_open(0);
if (!seq)
return 1;
int i;
@ -291,7 +292,7 @@ hack:
printf("%s\n", a);
continue;
}
while ((f = blaze822_seq_next(map, a, &iter))) {
while ((f = blaze822_seq_next(seq, a, &iter))) {
if (nflag) {
printf("%ld\n", iter.line-1);
} else {

@ -40,9 +40,9 @@ blaze822_seq_open(char *file)
// env $SEQ or something
if (!file)
file = getenv("MAILMAP");
file = getenv("MAILSEQ");
if (!file)
file = blaze822_home_file(".santoku/map");
file = blaze822_home_file(".santoku/seq");
fd = open(file, O_RDONLY);
if (!fd)
return 0;

Loading…
Cancel
Save