Re: Using Mail(1)

2007-12-26 Thread Hannah Schroeter
Hi!

On Wed, Dec 26, 2007 at 09:28:33AM +0200, Liviu Daia wrote:
On 25 December 2007, Girish Venkatachalam [EMAIL PROTECTED]
wrote:
[...]
 I just checked out the 'wl=72' stuff in vi. Works exactly like 'tw'
 in vim. I then did an fmt in the end. The result looks much better of
 course. But there is a problem. The quoting gets goofed up. One has to
 do it with little more care I guess.
[...]

Or use Par instead of fmt; textproc/par in ports.

$ cat bin/wrap_quote
#! /bin/sh
sed 's/^//' |
fmt |
sed 's/^//'

Kind regards,

Hannah.



Re: Using Mail(1)

2007-12-26 Thread Liviu Daia
On 26 December 2007, Hannah Schroeter [EMAIL PROTECTED] wrote:
 Hi!

 On Wed, Dec 26, 2007 at 09:28:33AM +0200, Liviu Daia wrote:
 On 25 December 2007, Girish Venkatachalam
 [EMAIL PROTECTED] wrote:
 [...]
  I just checked out the 'wl=72' stuff in vi. Works exactly like 'tw'
  in vim. I then did an fmt in the end. The result looks much better
  of course. But there is a problem. The quoting gets goofed up. One
  has to do it with little more care I guess.
 [...]
 
 Or use Par instead of fmt; textproc/par in ports.
 
 $ cat bin/wrap_quote
 #! /bin/sh
 sed 's/^//' |
 fmt |
 sed 's/^//'

... except Par can also handle multilevel quotes, like above. :)
Take a look at it, you'll be impressed.

Regards,

Liviu Daia

-- 
Dr. Liviu Daia  http://www.imar.ro/~daia



Re: Using Mail(1)

2007-12-26 Thread Ingo Schwarze
Hi Pieter,

Pieter Verberne wrote on Mon, Dec 24, 2007 at 05:09:20PM +0100:
 After some years of experience with Mutt I want to try Mail
 (/usr/bin/mail):-) I'm very curious about how many people are
 using Mail nowadays (on this list).

I'm using it mainly for two purposes:
 1) Sending test messages i don't want to keep copies of,
it those cases where mail(1) is more convenient than telnet(1).
 2) Sending administrative messages to users while logged into
server consoles.
 3) And rather rarely when i feel just too lazy to start
a full-blown mutt process.

 And what about Heirloom mailx?

Hm, i never cared about the features and differences of mail, Mail,
mailx and whatever.  They should just work for elementary purposes
and not change.  For the cases where i need advanced editing and
mailbox management features, emacs, elm, pine and mutt - in that
historical order - have always been around.

 In my eyes, Mail has a few notable things. When I want to send mail, I
 type mail [EMAIL PROTECTED] Enter the subject and than I get a kind of
 very minimalistic text editor with tilde-escape-functions.

Are you sure you should call that an editor?
Methinks mail is just reading standard input line by line.

See the collect() function in /usr/src/usr.bin/mail/collect.c.
It's using readline(3) - what a bloat ;) - perhaps that gave
you the impression of talking to an editor.

 This is a bit strange to me as 'UNIX's philosophy' is to make small
 applications that do just one thing, and do it well.

Yeah, use STDIN and STDOUT and let users establish pipes as required.
That's it, you are quite right.

 When I'm composing a mailmessage in Mutt, I use a editor for it.
 Why is Mail designed to not use a editor (vi/emacs) by default?
 There must be a reason.

Mail _is_ designed to use ex(1) by default:

 $ mail [EMAIL PROTECTED] 
Subject: test
~e
/tmp/mail.RevPyHb17828: unmodified: line 1
:a
test text
^CInterrupted
:wq
/tmp/mail.RevPyHb17828: 1 lines, 10 characters
(continue)
^DEOT
 $

If you just start mail(1), you get no editor whatsoever.
You type in the text of you mail as if you were using telnet(1),
except, of course, that you may profit from readline(3).
If you want an editor, use ~e.  You get ex(1), unless EDITOR is set.
See mail(1) for more details.

[...]
 in a well known threat on this list

Is that how rumours come into being?   =;c)



Re: Using Mail(1)

2007-12-25 Thread Pieter Verberne
On Tue, Dec 25, 2007 at 08:05:34AM +0530, Girish Venkatachalam wrote:
 On 22:15:03 Dec 24, Marc Espie wrote:
 nnoremap C-k :,$dCR
 Setting se textwidth=72 is the best way. No need to invoke 'fmt'.
In Vi I set set wl=72 (wl = wraplen). But when I remove text in the
middle of a sentence, the text won't shift. This makes the line less
than 72 characters. I think Vim does shift the sentence automaticly?

 Also check out the mapping for 'Ctrl-K' which is extremely critical for
 e-mail. Whenever you reply to a mail on the list, you keep running into
 the need for deleting everything from current line downwards.
Something like 'd-{'? 



Re: Using Mail(1)

2007-12-25 Thread Girish Venkatachalam
On 12:06:02 Dec 25, Pieter Verberne wrote:
 In Vi I set set wl=72 (wl = wraplen). But when I remove text in the
 middle of a sentence, the text won't shift. This makes the line less
 than 72 characters. I think Vim does shift the sentence automaticly?

No, vim does not shift either. I was under the impression that there is
no need to justify sentences that way. As long as lines are under 72
characters I am quite alright.

If you remove something in the middle, it is going to be less than 72
characters anyway.

If you want to justify/fill correctly, then you end up using fmt at the end.

I have a problem with using post processing tools. I want everything to
happen on the fly.

I just checked out the 'wl=72' stuff in vi. Works exactly like 'tw' in
vim. I then did an fmt in the end. The result looks much better 
of course. But there is a problem. The quoting gets goofed up. One has
to do it with little more care I guess.

Looks like I misunderstood then.

 Something like 'd-{'? 

I don't get you. You mean 'd' and '{'?

Doesn't work for me.

Perhaps I misunderstood? I want to delete everything from current line
till end of file. In vi, it corresponds to

:,$d

-Girish



Re: Using Mail(1)

2007-12-25 Thread William Boshuck
On Tue, Dec 25, 2007 at 07:12:50PM +0530, Girish Venkatachalam wrote:
 On 12:06:02 Dec 25, Pieter Verberne wrote:
 
 I just checked out the 'wl=72' stuff in vi. Works exactly like 'tw' in
 vim. I then did an fmt in the end. The result looks much better 
 of course. But there is a problem. The quoting gets goofed up. One has
 to do it with little more care I guess.

Vim's formatting commands (gq{motion}, gw{motion}) are able
to handle quoting in mail messages. (I think Marc Espie was
referring to these commands in his message.)

  Something like 'd-{'? 
 
 I don't get you. You mean 'd' and '{'?
 
 Doesn't work for me.
 
 Perhaps I misunderstood? I want to delete everything from current line
 till end of file. In vi, it corresponds to
 
 :,$d

He might have meant a vi command (yours is an ex command)
of the form 'd motion'; e.g., dG deletes all lines from
the current line through to the last line of the current
file.



Re: Using Mail(1)

2007-12-25 Thread Pieter Verberne
On Tue, Dec 25, 2007 at 09:40:40AM -0500, William Boshuck wrote:
 On Tue, Dec 25, 2007 at 07:12:50PM +0530, Girish Venkatachalam wrote:
  On 12:06:02 Dec 25, Pieter Verberne wrote:
  Perhaps I misunderstood? I want to delete everything from current line
  till end of file. In vi, it corresponds to
  :,$d
 
 He might have meant a vi command (yours is an ex command)
 of the form 'd motion'; e.g., dG deletes all lines from
 the current line through to the last line of the current
 file.
That is what I mean indeed. d{ removes the previous paragraph. I think
this is something like deleting everything from current line downwards
?



Re: Using Mail(1)

2007-12-25 Thread Owain Ainsworth
On Tue, Dec 25, 2007 at 07:12:50PM +0530, Girish Venkatachalam wrote:
 Perhaps I misunderstood? I want to delete everything from current line
 till end of file. In vi, it corresponds to
 
 :,$d

or:

 dG
 
 -Girish

-0-

-- 
Ah say, son, you're about as sharp as a bowlin' ball.



Re: Using Mail(1)

2007-12-25 Thread Liviu Daia
On 25 December 2007, Girish Venkatachalam [EMAIL PROTECTED]
wrote:
[...]
 I just checked out the 'wl=72' stuff in vi. Works exactly like 'tw'
 in vim. I then did an fmt in the end. The result looks much better of
 course. But there is a problem. The quoting gets goofed up. One has to
 do it with little more care I guess.
[...]

Or use Par instead of fmt; textproc/par in ports.

Regards,

Liviu Daia

-- 
Dr. Liviu Daia  http://www.imar.ro/~daia



Using Mail(1)

2007-12-24 Thread Pieter Verberne
After some years of experience with Mutt I want to try Mail
(/usr/bin/mail):-) I'm very curious about how many people are using Mail
nowadays (on this list). And what about Heirloom mailx?

In my eyes, Mail has a few notable things. When I want to send mail, I
type mail [EMAIL PROTECTED] Enter the subject and than I get a kind of
very minimalistic text editor with tilde-escape-functions. This is a bit
strange to me as 'UNIX's philosophy' is to make small applications that
do just one thing, and do it well. When I'm composing a mailmessage in
Mutt, I use a editor for it. Why is Mail designed to not use a editor
(vi/emacs) by default? There must be a reason.

When I reply a message with mail, I can put the original message in my
mail to quote it. Mail is 'quoting' the original message with a Tab
before all the lines. (Just how RMS seems to quote in a well known
threat on this list) I almost never see this kind of quoting. Most
people quote by putting '' before each line. Since the netiquette says
you should break each line after 70/72 characters, this tab before each
line looks prety strange to me. Especially because Mail was probably
used on low-resolution monitors in the past wich could 'blur' these
messages. (However, I think I can configure Mail to put a  before each
line)

Mail's default editor also doesn't break lines automaticly after 72
characters. So for replying I should type
~m [enter]  (to put the original message in the reply)
and
~| fmt [enter]  (to make my own lines break after 72 characters)
or
~v [enter]  (to compose my mail in vi)
Doing this for every mail I reply is very unpractical.

I want to use Mail on my ISP's shell account. (FreeBSD:-) ) But they use
maildir. They do have a kind of maildir to mbox converter. It is a perl
script: http://www.xs4all.nl/~pjhv/maildir2mbox .
I think it is necessary to use maildir2mbox, if I want to use Mail. But
I can't figure out how maildir2mbox works. Anyone experience with it?

Someting else:
When I use Vi, I almost always set wraplength to 72. When I typed a few
lines and want to correct something in a previous line, the lines do not
always wrap at 72 characters anymore.

For example: I remove the word almost. Now the line is just 64
characters long so the paragraph from the word lines could just shove
up. Does VI has a function for this or can do it automaticly? Or are the
VI fans using FMT(1) for this? (I prefer VI over VIM)

Pfff, I can't type English anymore right now. It is taking to much
brainpower:-)

So, please clear some things up for me:-)

Pieter Verberne



Re: Using Mail(1)

2007-12-24 Thread Christian Weisgerber
Pieter Verberne [EMAIL PROTECTED] wrote:

 For example: I remove the word almost. Now the line is just 64
 characters long so the paragraph from the word lines could just shove
 up. Does VI has a function for this or can do it automaticly? Or are the
 VI fans using FMT(1) for this?

I have 

map q !}fmt

in my ~/.nexrc.  ('q' because it is reminiscent of M-q fill-paragraph
in Emacs-style editors, and because it is unused.)

-- 
Christian naddy Weisgerber  [EMAIL PROTECTED]



Re: Using Mail(1)

2007-12-24 Thread Marc Espie
On Mon, Dec 24, 2007 at 08:36:09PM +, Christian Weisgerber wrote:
 Pieter Verberne [EMAIL PROTECTED] wrote:
 
  For example: I remove the word almost. Now the line is just 64
  characters long so the paragraph from the word lines could just shove
  up. Does VI has a function for this or can do it automaticly? Or are the
  VI fans using FMT(1) for this?
 
 I have 
 
 map q !}fmt
 
 in my ~/.nexrc.  ('q' because it is reminiscent of M-q fill-paragraph
 in Emacs-style editors, and because it is unused.)

vim actually has an internal fmt command.

I found about it fairly recently. All vi users use the filter command
all the time, and it usually takes us a while to adjust to vim improvements ;)



Re: Using Mail(1)

2007-12-24 Thread Girish Venkatachalam
On 22:15:03 Dec 24, Marc Espie wrote:
 vim actually has an internal fmt command.
 
 I found about it fairly recently. All vi users use the filter command
 all the time, and it usually takes us a while to adjust to vim improvements ;)

I have this on my vimrc.

sy on
se nu
se textwidth=72
nnoremap C-k :,$dCR
se spell spelllang=en_us
nnoremap C-F5 :highlight clear spellbadCR
nnoremap C-F3 ihttp://sirsasana.org/ports/ESCa

Setting se textwidth=72 is the best way. No need to invoke 'fmt'.

Check out my other useful stuff too. I have an on the fly spell checker
and a short hand for sending ports. ;)

vim helps me avoid errors in e-mail messages ( though I keep making
typos despite that ;). 

Also check out the mapping for 'Ctrl-K' which is extremely critical for
e-mail. Whenever you reply to a mail on the list, you keep running into
the need for deleting everything from current line downwards.

As to the preference between vim and vi, I would say that I have kind of
got spoilt by the luxury of vim.

I definitely agree that vim sometimes is a bit slow and that it has
bloat that can be avoided, but what the heck?

Vim's syntax highlighting never ever let me down. ;)

It cannot understand all sorts of #ifdef, so sometimes the bracket
matching fails but throw any config file or whatever you think of at it
and vim does a marvelous job.

Yes, I am typing this mail in vim.

I have written an article on vim too.

http://linuxjournal.com/8289

I know this discussion is about vi and not vim, but Marc spoilt me. ;)

-Girish