]> diplodocus.org Git - nmh/blob - docs/contrib/replaliases
new.c: Order two return statements to match comment.
[nmh] / docs / contrib / replaliases
1 #### replaliases
2 ####
3 #### convenience functions for various repl(1) commands
4 ####
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.
9 ####
10 #### Author: David Levine <levinedl@acm.org>
11
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>|'
19 export PARINIT
20 fi
21
22 #### Reply, including text/html (converted to text/plain) and
23 #### text/plain parts.
24 ####
25 #### Optional arguments:
26 #### -h to disable conversion of text/html parts
27 #### -p to disable conversion of text/plain parts
28 #### All other arguments are passed to repl.
29 #### The -p argument can be useful with improperly structured
30 #### messages, such as those that use multipart/related when they
31 #### should have used multipart/alternative.
32 rt() {
33 if [ "$1" = -h ]; then
34 shift
35 \repl -filter mhl.replywithoutbody -convertargs text/plain '' "$@"
36 elif [ "$1" = -p ]; then
37 shift
38 \repl -filter mhl.replywithoutbody -convertargs text/html '' "$@"
39 else
40 \repl -filter mhl.replywithoutbody \
41 -convertargs text/html '' -convertargs text/plain '' "$@"
42 fi
43 }
44
45
46 #### Add -editor mhbuild to above. Useful only when attachments
47 #### won't be added to the message.
48 ####
49 #### To ease editing at the What now? prompt, add a line like this to
50 #### your .mh_profile:
51 #### mhbuild-next: $EDITOR
52 #### assuming that your EDTIOR environment variable is set; if not,
53 #### replace $EDITOR above with the name of your editor. Without that
54 #### profile entry, enter "e[dit] $EDITOR" at the What now? prompt.
55 rtm() {
56 rt -editor mhbuild "$@"
57 }
58
59
60 #### accept a calendar request
61 calaccept() {
62 \repl -noformat -editor mhbuild \
63 -convertargs text/calendar '-reply accept -contenttype' "$@"
64 }
65
66 #### decline a calendar request
67 caldecline() {
68 \repl -noformat -editor mhbuild \
69 -convertargs text/calendar '-reply decline -contenttype' "$@"
70 }
71
72 #### reply as tentative to a calendar request
73 caltentative() {
74 \repl -noformat -editor mhbuild \
75 -convertargs text/calendar '-reply tentative -contenttype' "$@"
76 }
77
78 #### cancel a calendar request
79 calcancel() {
80 \repl -noformat -editor mhbuild \
81 -convertargs text/calendar '-cancel -contenttype' "$@"
82 }
83
84
85 # Local Variables:
86 # mode: sh
87 # End: