Disclaimer: I know neither Ruby, Lisp, Scheme nor JSTL.
It is a flexible alternative to the standard (N)MH mhl and mhshow
applications. MIME messages are displayed in a single continuous
less session, with non-plaintext components converted to text
by the appropriate utility. PGP and S/MIME signatures are
automatically validated, headers and separators are coloured,
and the less prompt displays information about the current mail.
Command keys are then provided within less to perform common
operations, such as replying to, refiling or deleting mail,
moving to the next message, etc.
It is integrated with
pick so you can show unseen or show -from
bob to easily view sequences.
See rbmhshow for
installation/configuration instructions, and
rbmhl,
rbmh/ansi.rb,
rbmh/command.rb,
rbmh/context.rb,
rbmh/handler.rb,
rbmh/header.rb,
rbmh/pager.rb,
rbmh/profile.rb,
rbmh/prompter.rb,
rbmh/rmail.rb,
rbmh/shower.rb and
rbmh/suffixes.rb for the rest.
See mh-profile.rbmh for
sample .mh_profile entries.
require 'merlin/let'
STDERR.let(STDOUT) { |stderr|
STDERR.puts("I'm going to STDOUT")
stderr.puts("I'm going to STDERR")
}
STDERR.puts("I'm going to STDERR")
Reassigns the specified entries in the hash to the specified values, or removes the entry if the pair has no second element, executes the block, and then restores the hash entries. The original values are passed to the block in the same format as they are passed to the let method.
require 'merlin/let'
a = { 'foo' => 'bar' }
a.let(['foo', 'baz']) { |orig|
# a['foo'] is 'baz'
# orig is ['foo', 'bar']
}
# a['foo'] is 'bar'
Same as hash.let.
require 'merlin/let'
ENV.let([ [ 'PATH' ], [ 'HOME', '/tmp' ] ]) { |originals|
# PATH is removed, and HOME is /tmp
}
# PATH and HOME are restored
require 'merlin/each'
a = [ 'foo', 'bar', 'baz' ]
a.each_with_status { |value, status|
if status.first?
print value
elsif !status.last?
print ", ", value
else
print " or ", value
end
}
produces: foo, bar or baz