3 #### convenience functions for various repl(1) commands
5 #### They're functions instead of aliases for portability. This file
6 #### is intended to be sourced from a Bourne-compatible shell, e.g.,
7 #### source `mhparam docdir`/contrib/replaliases
8 #### to declare the functions.
10 #### Author: David Levine <levinedl@acm.org>
12 #### If using par (see mhn.defaults), it helps to have its PARINIT
13 #### environment variable set. If you really want it to be null,
14 #### either comment this out or set it to, e.g., ' '.
15 #### Removed "R" from PARINIT recommendation in par(1) man page so
16 #### that it doesn't consider words that are too long to be an error.
17 if [ -z "$PARINIT" ]; then
18 PARINIT='rTbgq B=.,?_A_a Q=_s>|'
23 #### Reply, including text/html (converted to text/plain) and
24 #### text/plain parts.
26 #### Optional arguments:
27 #### -h to disable conversion of text/html parts
28 #### -p to disable conversion of text/plain parts
29 #### All other arguments are passed to repl.
30 #### The -p argument can be useful with improperly structured
31 #### messages, such as those that use multipart/related when they
32 #### should have used multipart/alternative.
34 if [ "$1" = -h ]; then
36 \repl -filter mhl.replywithoutbody -convertargs text/plain '' "$@"
37 elif [ "$1" = -p ]; then
39 \repl -filter mhl.replywithoutbody -convertargs text/html '' "$@"
41 \repl -filter mhl.replywithoutbody \
42 -convertargs text/html '' -convertargs text/plain '' "$@"
47 #### Add -editor mhbuild to above. Useful only when attachments
48 #### won't be added to the message.
50 #### To ease editing at the What now? prompt, add a line like this to
51 #### your .mh_profile:
52 #### mhbuild-next: $EDITOR
53 #### assuming that your EDTIOR environment variable is set; if not,
54 #### replace $EDITOR above with the name of your editor. Without that
55 #### profile entry, enter "e[dit] $EDITOR" at the What now? prompt.
57 rt -editor mhbuild "$@"
61 #### Internal function for use by calendar response functions below.
62 #### Pulls "-a address" out of command line arguments.
67 test "$mhical_prev" = -a && mhical_attendee="$arg"
72 echo "$mhical_attendee"
76 #### accept a calendar request
77 #### usage: calaccept [-a address] [repl switches]
78 #### -a specifies attendee, see mhical(1)
79 #### Other arguments passed to repl(1).
81 if [ "$1" = -a ]; then
82 attendee=' -attendee '`mhical_attendee "$@"`
87 \repl -noformat -editor mhbuild \
88 -convertargs text/calendar "-reply accept -contenttype${attendee}" \
94 #### decline a calendar request
95 #### usage: caldecline [-a address] [repl switches]
96 #### -a specifies attendee, see mhical(1)
97 #### Other arguments passed to repl(1).
99 if [ "$1" = -a ]; then
100 attendee=' -attendee '`mhical_attendee "$@"`
105 \repl -noformat -editor mhbuild \
106 -convertargs text/calendar "-reply decline -contenttype${attendee}" \
112 #### reply as tentative to a calendar request
113 #### usage: caltentative [-a address] [repl switches]
114 #### -a specifies attendee, see mhical(1)
115 #### Other arguments passed to repl(1).
117 if [ "$1" = -a ]; then
118 attendee=' -attendee '`mhical_attendee "$@"`
123 \repl -noformat -editor mhbuild \
124 -convertargs text/calendar "-reply tentative -contenttype${attendee}" \
130 #### cancel a calendar request
132 \repl -noformat -editor mhbuild \
133 -convertargs text/calendar '-cancel -contenttype' "$@"