[comp.mail.mush] Mush 6.5 man page suggestions

levin@srhqla.UUCP (05/17/89)

Larry Virden sent Dan and I this huge list of questions and comments.
Rather than have others asking the same questions again, I thought I'd
throw the responses out to the world at large.

Any of Larry's comments that have been omitted were trivial proofreading
remarks and may or may not have been acted on.  Usually they were, just
for Larry's info. :-)

On May 16,  3:11pm, Larry W. Virden wrote:
} Subject: Mush 6.5 man page suggestions
} 
} 2.	Under Initialization, how about an 'elif' which would be similar to 
} 	else if except that an endif would not be required?

Perhaps in a future release.  At the moment it requires too massive a
change to the init file parser.

} 3.	Under General Usage, I think that I have noticed cases where I think
} 	that either the user's erase character or interrupt character,
} 	as set in the stty structures, was reset to a default (or overridden);
} 	perhaps this could be looked into?

Mush always recognizes delete and backspace IN ADDITION to the user's
erase character.  If you can give more details, however, we'll look into
a changing interrupt character.  Note that if you use the Gnurc file from
the mush distribution, the interrupt character gets changed to ^G and
then "restored" as ^C (there is a note in Gnurc about needing to
customize this).

} 4.	Is there a way to get the output from a ~:command to become a part
} 	of the message body?  If not, have you considered any type of
} 	additional tilde command so that this could happen?

No on both counts.  You can get variables with ~$ if you want.

} 5.	Under Curses Interface, second paragraph, there is a sentence which
} 	begins "Mush will to attempt to know..." ; sounds like a word missing.

No, it is an extra "to", should say "will attempt ...".

} 6.	Same paragraph, a sentence begins "However, if you just said, "mail"
} 	with no..."  I think that the , after said should go after mail 
} 	shouldnt it?

There shouldn't be any comma at all.  Dan got carried away with them
sometimes in the original man page, and I didn't catch them all when
proofing. :-)

} 7.	Personal preference - the list of curses commands currently is
} 	printed across the columns ; would you consider listing them 
} 	down columns?  I find it easier to read that way myself - maybe
} 	others do not.  Also, help is out of sorted order...

Do you know of any unix utility that will automatically sort them down
the columns?  I don't want to do it by hand and I can't find anything
that will do it for me.  Ls, pr, and friends all columnate across.  Help
is out of order on purpose (that sounds sort of sinister ...).

} 8.	Has anyone considered adding functions along with cmd support?

Yes, I have thought of it, and it is in my future-enhancements list.

} 9.	What is the range of numbers that debug takes?  Would it make
} 	sense to mention that in the doc?

Anything from 0 up to about 5 is sensible.  It is intentionally not
mentioned in the doc because debug above 1 is supposed to be for code
modifications only, not joe user's .mushrc problems.

} 10.	Is "help command" exactly the same as "command -?" ?

No, but "? command" is the same as "command -?".  The "help" command is
restricted to a few topics that do not have associated commands, such as
what a message list is.

} 11.	Are the entries within the header-list for ignore treated as if they
} 	were the entire name of the header?  That is, if I put resent, would
} 	all resent headers be ignored, or do I have to list them all out?
} 	Can I have more than one ignore line which works cumulative, or does
} 	a second occurance override the first?

You have to list them all out.  Yes, they are cumulative.

} 12.	When file names are needed, such as in folder, mailing to a file, etc.
} 	are variables permitted as the initial part of the file name - such
} 	as $folder/name?

Variables are permitted *almost* everywhere.  They are not permitted in
places that do not go through one of the usual mush command interfaces,
such as in Fcc: headers in messages.

} 14.	Is it tradition that mail -e means to use the $visual editor?  Since
} 	~e means use $editor, this was a point of confusion that -e meant
} 	use $visual.

Mush has long assumed that no one is dippy enough not to use a visual
editor in preference to a non-visual one.  -e has always meant "the
default editor" which in mush is $visual.  I realize that some people set
$visual to emacs and $editor to vi and stuff like that, but -v is
already taken as "verbose".

} 15.	Is there any way to tell pick to not search deleted messages for
} 	a particular search?

Something like this has been answered on mush-users at least once:

     * {`:d`} | pick ....

If you do NOT have show_deleted set, it also works to use

    headers | pick ....

becuase headers will not "show" the deleted messages.

} 16.	Perhaps Pipe should be added as a entry on the pipe usage line.
} 	It is about the only command not so specified.

It is a special case, like Print and Type.  It doesn't show up in a ?
listing either.

} 19.	In the same section, it might be useful to have a sentence in the next
} 	to the last paragraph which indicates that one needs to explicitly
} 	delete messages that are saved from non-system mailboxes.

It already says:

    If the variable keepsave is set or the current folder is not the
    system mailbox, then messages are not marked for deletion.

How much more explicit can you get?

} 20.	In saveopts, there is an extra comma after "saveopts" in the first
} 	sentence.

No, that comma is supposed to be there.  This is one case where Dan got
it right. :-)

} 23.	Just an off the wall thought; it would be nice if the individual
} 	user could somehow add to the list of variables that are displayed
} 	via set ?all or set ?variable ...

Uhh ... why?  The definition of "set ?variable" is to describe a variable
that has a special meaning to mush.  No arbitrary user-defined variables
can have such special meaning ....

} 24.	When does a value need to be in quotes for a set?  Does it ever need
} 	to be?  Actually, this question applys to more than just set - it
} 	applies to all the mush commands.  For instance, if I have a list
} 	of known_hosts, do they need to be enclosed in ""?  Will that cause
} 	any problems if I DO enclose them?

Any value-of-a-variable or other argument that will include whitespace,
semicolons, vertbars (pipes), or quotes of the other kind, must be in
quotes.  If you say e.g.

    set known_hosts = atelabs bellcore bit cadic cvedc gssc

you will get

    $known_hosts = atelabs
    $bellcore
    $bit
    $cadic
    $cvedc
    $gssc

One level of quotes is stripped by the command parser in the final stage
of constructing an argument list.  There is a bug in the "set" command
that can sometimes cause it to strip an additional level of quotes; this
will be fixed in the next patch.  To avoid the bug, ALWAYS surround the
equal sign (=) in "set" commands with whitespace.  The bug happens only
when whitespace is omitted.

} 28.	Under the Variables sections, the second sentence begins with
} 	Options and I THINK Values may be the word sought.

Actually, "Variables which represent options" is the intended meaning;
stuff like autoedit, autoinclude, etc.  I'll leave it alone.

} 29.	A request for consideration - if autoprint is set, could it be
} 	'ignored' if the delete is done within a pipeline?  Just a thought...

If the delete command is in the middle of a pipe, that should probably be
the behavior.  It isn't clear what the behavior should be if the delete
is at the END of the pipe.

} 30.	I have read autosign2 section several times and still cannot figure
} 	out if I can use it to do what I am wanting to do.
} 
} 	What I want to do is to have an autosig which works for any mail	
} 	leaving this site.  But for any mail remaining in-house, I want
} 	to skip the signature - I would like to skip the fortunes as well.
} 
} 	What I put in my autosign2 was:
} 
} set autosign # add signature
} set autosign2 = "!chemabs : ~/.local.sig"

That should work.  You might also try @ followed by the uname value.

} 	But local users still get my regular .signature.  See, I dont
} 	send local users mail via chemabs!local - I just say mush hall
} 	for instance.
} 
} 	The other thing is that while the uucp name for this machine is
} 	chemabs, it has a DIFFERENT uname value - what does mush use to
} 	determine the local host name?  I will try putting the `hostname` 
} 	in and see if that makes a difference.

Mush uses gethostname(3) to get the host name.  I believe that is the
same name as returned by the "hostname" unix command.

} 31.	Will empty headers appear in the message during message composition
} 	if I set edit_hdrs?  For instance, rn has a whole slew of 
} 	headers that it leaves empty, but as guidelines.  I dont mind if
} 	they get deleted as the message is posted, but it would be nice
} 	if they remain till that time.

An empty Cc: header will appear if you have $askcc set.  Other empty
headers can be generated with the my_hdr command by setting them to a
single space initially:

    my_hdr X-Fill-In-The-Blank: " "

These headers will be removed when the message is sent.

} 32.	Does the hostname variable need to have the domain attached as well?

Define "need".  See Dan's recent posting on this subject.  The
recommendation is to use

    set hostname = "machine.domain $hostname"

} 33.	Any way that the option variables could indicate what the default
} 	action is - for booleans in particular, but for the others if
} 	applicable?

What precisely do you mean?  The defaults for most of the "boolean
string" variables are explained in the appropriate "set ?var".

} 34.	It might be nice to mention that users should prefix personal
} 	headers with an X- (I THINK that is what the appropriate standard
} 	indicates).

Headers that begin with X- are guaranteed not be "usurped" in the future
by official fields that mean something to the mail system.  If you don't
care about your field being clobbered or becoming "illegal" in the future,
there is no requirement for the X- prefix.

} 35.	When print_cmd is set to a command, is there any delimiter sent
} 	between messages?  Sometimes it would be nice if each message
} 	was on its own page for instance.  Perhaps a variable could be
} 	specificed for a message delimiter?

No delimiter is sent between messages.  A future version may provide user
control over such things as whether displayed messages are sent
individually to the pager or all as one stream, and whether streamed
messages are delimited in any special way.

} 36.	If screen is set to 0, does the current window size get used?
} 	If it is unset?  The doc doesnt mention.

If screen is set to less than 2 it is forced to be 2.

} 37.	The sort variable doesnt take effect if I do a mush -f mush.box
} 	invocation?

That is correct.  Sorting with $sort applies only to the system mailbox.
If you want to sort other mailboxes, use the -F (-source) option to read
a script containing the appropriate "sort" command.  If you do this in
conjunction with -C, the script should end with a "headers" command.  You
may want to use

    if iscurses
	headers
    endif

} 38.	

What, that's it? :-)

-- 
Bart Schaefer       "And if you believe that, you'll believe anything."
							-- DangerMouse
CSNET / Internet                schaefer@cse.ogc.edu
UUCP                            ...{sequent,tektronix,verdix}!ogccse!schaefer

logan@vsedev.VSE.COM (James Logan III) (05/18/89)

In article <632@srhqla.UUCP>  writes:
# } 30.	I have read autosign2 section several times and still cannot figure
# } 	out if I can use it to do what I am wanting to do.
# } 
# } 	What I want to do is to have an autosig which works for any mail	
# } 	leaving this site.  But for any mail remaining in-house, I want
# } 	to skip the signature - I would like to skip the fortunes as well.
# } 
# } 	What I put in my autosign2 was:
# } 
# } set autosign # add signature
# } set autosign2 = "!chemabs : ~/.local.sig"
# 
# That should work.  You might also try @ followed by the uname value.
# 
# } 	But local users still get my regular .signature.  See, I dont
# } 	send local users mail via chemabs!local - I just say mush hall
# } 	for instance.

I am having trouble getting the autosign2 to work.  I use the following:

	set autosign
	set autosign2 = "!vsedev : ~/no_such_file"

Local mail works fine, but if I try to mail to a user at another site,
MUSH hangs after prompting me for the carbon copy.  When I comment-out
the autosign settings, it returns immediately.  What am I doing wrong?

			-Jim
-- 
Jim Logan                           logan@vsedev.vse.com
VSE Software Development Lab        uucp:  ..!uunet!vsedev!logan
(703) 329-4654                      inet:  logan%vsedev.vse.com@uunet.uu.net

comp-mail-mush@srhqla.uucp (05/18/89)

From: Marc Rouleau <island!ucbcad!virginia.acc.virginia.edu!mer6g>

On May 16, 16:02, "Barton E. Schaefer" wrote:
> 
> } 7.	Personal preference - the list of curses commands currently is
> } 	printed across the columns; would you consider listing them 
> } 	down columns?
> 
> Do you know of any unix utility that will automatically sort them down
> the columns?  I don't want to do it by hand and I can't find anything
> that will do it for me.  Ls, pr, and friends all columnate across.

Hmm, ls -C on every Unix system I've used sorts down columns, not across.
But I don't see how you could use it to sort your list of curses commands
anyway.  I do agree with Larry Virden that it's easier to read a columnated
list when it's sorted down the columns ...

For what it's worth, here's a little script I've been using privately (in
somewhat less spiffy form :-) ) for a while to do that very thing.

	-- Marc Rouleau

----------------------------- cut here ------------------------------
#!/usr/bin/perl
eval "exec /usr/bin/perl -S $0 $*"
	if $running_under_some_shell;

# colsort [-i] [-n numcols | -w width] [files]
#
# This script sorts and columnates its input.  Output is ordered _down_
# the columns.
#
# Like sed(1), it takes its input from specified files if they exist and
# from stdin if they do not.
#
# The -i option causes it to ignore case during the sort.
#
# The -n option takes a single argument which is the number of output
# columns.  In this case the columns will be tab-separated presumably
# for tbl(1) fodder.
#
# The -w option takes a single argument which is the width of the output
# "page".  In this case the columns will be visually aligned in the
# manner of ls(1).
#
# The -n and -w options are mutually exclusive.  The default behavior
# is equivalent to "-w 64".
#
# BUGS: Since the sorting is done in core, I doubt this will work on very
#       large input sets.
#
# 	-- Marc Rouleau		(marc@virginia.edu)

$USAGE = "colsort [-i] [-n numcols | -w width] [files]\n";

sub IgnoreCase {
	$x = $a;
	$y = $b;
	$x =~ tr/A-Z/a-z/;
	$y =~ tr/A-Z/a-z/;
	$x lt $y ? -1 : $x gt $y ? 1 : 0;
}

sub NumericArg {
	if (!/([0-9]+)/) {
		shift;
	} else {
		$1;
	}
}

while ($_ = $ARGV[0],/^-/) {
	shift;
	if (/^-i/) {
		$IGNORECASE = 1;
	} elsif (/^-n/) {
		$NUMPERLINE = do NumericArg();
	} elsif (/^-w/) {
		$WIDTH = do NumericArg();
	}
}
if ($NUMPERLINE && $WIDTH) {
	print $USAGE;
	exit 1;
}
if (!$NUMPERLINE && !$WIDTH) {
	$WIDTH = 64;
}

for ($i = 0, $Longest = 0; <>; $i++) {
	$words[$i] = $_;
	$Longest = length($_) - 1 > $Longest ? length($_) - 1 : $Longest;
}
if ($IGNORECASE) {
	@sortedwords = sort IgnoreCase @words;
} else {
	@sortedwords = sort @words;
}

if ($WIDTH) {
	if ($NUMPERLINE = $WIDTH / $Longest) {
		$NUMPERLINE -= $WIDTH % $Longest < $NUMPERLINE - 1 ? 1 : 0;
	} else {
		$NUMPERLINE = 1;
	}
}

$NumWords = $#sortedwords + 1;
$Extra = $NumWords % $NUMPERLINE;
$Extra = $Extra ? $Extra : $NUMPERLINE;
$NumLines = int(($NumWords / $NUMPERLINE) + ($Extra ? 1 : 0));

for ($i = 0; $i < $NumLines; $i++) {
	$column = 1;
	for ($j = $i; $j < $NumWords; $j += $j_inc) {
		$word = $sortedwords[$j];
		chop($word);
		print "$word";
		if ($NUMPERLINE == 1) {
			print "\n";
		} elsif ($WIDTH) {
			print ' ' x ($Longest - length($word) + 1);
		} else {
			print "\t";
		}
		last if ($column == $Extra && $i == ($NumLines-1));
		$j_inc = ($NumLines - ($column++ <= $Extra ? 0 : 1));
	}
	print "\n";
}