Thread View: news.software.readers
2 messages
2 total messages
Started by Felix von Leitner
Sat, 13 Apr 1996 00:00
How to get slrn to accept mail aliases
Author: Felix von Leitner
Date: Sat, 13 Apr 1996 00:00
Date: Sat, 13 Apr 1996 00:00
52 lines
2010 bytes
2010 bytes
Hi folks,
I asked John some time ago for e-mail aliases. But since the Mail
Reader I use (ELM) does not use the standard mail aliases from .mailrc,
adding ELM aliases to slrn would have been a kludge, and would not have
satisfied me either.
So I hacked my own solution. It works like this.
I have configured vim (vi improved, a very cool vi clone, can be
obtained from ftp://ftp.prz.tu-berlin.de/pub/unix/editors/vim/) to
automatically pipe the header of the mail through expandmail� a small
perl script:
autocmd BufRead .letter 1,/^$/!expandmail
... and this is expandmail:
---
#!/usr/bin/perl
open(ALIASES,$ENV{"HOME"} . "/.elm/aliases.text")
or die "cannot open ~/.elm/aliases.text\n";
while (<ALIASES>) {
($alias,$tmp,$email) = (m/(.*) = (.*) = (.*)/);
$last="";
if (($last,$tmp2) = ($tmp =~ m/(.*); (.*)/)) {
$comment="";
($first,$comment) = ($tmp2=~m/(.*), (.*)/) or $first=$tmp2;
} else {
$last=$tmp; $comment=""; $first="";
}
$aliases{$alias} = "$first $last <$email>";
}
close(ALIASES);
while (<>) {
foreach $i (keys %aliases) {
s/([\s,])$i([\s,])/$1$aliases{$i}$2/;
}
print;
}
---
Tell you what? It works! ;) I figured some other folks might have had
the same problem. This is public domain. John, if you like, you can
add it to the slrn contrib section.
Felix
Re: How to get slrn to accept mail aliases
Author: Sven Guckes
Date: Sat, 04 May 1996 00:00
Date: Sat, 04 May 1996 00:00
31 lines
1920 bytes
1920 bytes
Felix von Leitner <leitner@xorn.prz.tu-berlin.de>:
> I have configured vim (vi improved, a very cool vi clone)
> to automatically pipe the header of the mail through expandmail�
> a small perl script: autocmd BufRead .letter 1,/^$/!expandmail
If you use ELM as your mailer then you will also have ELM's utility
"elmalias" installed. This program expands your aliases.
To read in the expansion for alias "felix" use the vi command
:r!elmalias -f "\%n <\%v>"
I have mapped this to ",C" (check alias) with
:map ,C :r!elmalias -f "\%n <\%v>"
So the sequence ",Cfelix^M" will insert its expansion:
Felix von Leitner <leitner@prz.tu-berlin.de>
Sven
And yet another plug for VIM. :-)
--
Sven Guckes guckes@math.fu-berlin.de using vim325 [released on 960501]
VIM ("VI IMproved") is a vi clone for UNIX, DOS, Windows, OS/2, MacOS, Atari,..
VIM Pages: http://www.math.fu-berlin.de/~guckes/vim/
VIM Mail Lists: http://www.math.fu-berlin.de/~guckes/vim/mail.lists.html
VIM Development: http://www.math.fu-berlin.de/~guckes/vim/development.html
VIM FAQ: http://www.grafnetix.com/~laurent/vim
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads