]> diplodocus.org Git - nmh/blob - docs/contrib/replaliases
Added context_find_prefix().
[nmh] / docs / contrib / replaliases
1 #### replaliases
2 ####
3 #### convenience functions for various repl(1) commands
4 #### They're functions instead of aliases for portability.
5
6 #### If using par (see mhn.defaults), it helps to have its PARINIT
7 #### environment variable set. If you really want it to be null,
8 #### either comment this out or set it to, e.g., ' '.
9 #### Removed "R" from PARINIT recommendation in par(1) man page so
10 #### that it doesn't consider words that are too long to be an error.
11 if [ -z "$PARINIT" ]; then
12 PARINIT='rTbgq B=.,?_A_a Q=_s>|'
13 export PARINIT
14 fi
15
16 #### Reply, including text/html (converted to text/plain) and
17 #### text/plain parts.
18 ####
19 #### Optional arguments:
20 #### -h to disable conversion of text/html parts
21 #### -p to disable conversion of text/plain parts
22 #### All other arguments are passed to repl.
23 #### The -p argument can be useful with improperly structured
24 #### messages, such as those that use multipart/related when they
25 #### should have used multipart/alternative.
26 rt() {
27 if [ "$1" = -h ]; then
28 shift
29 repl -filter mhl.replywithoutbody -convertargs text/plain '' "$@"
30 elif [ "$1" = -p ]; then
31 shift
32 repl -filter mhl.replywithoutbody -convertargs text/html '' "$@"
33 else
34 repl -filter mhl.replywithoutbody \
35 -convertargs text/html '' -convertargs text/plain '' "$@"
36 fi
37 }
38
39
40 #### Add -editor mhbuild to above. Useful only when attachments
41 #### won't be added to the message.
42 ####
43 #### To ease editing at the What now? prompt, add a line like this to
44 #### your .mh_profile:
45 #### mhbuild-next: $EDITOR
46 #### assuming that your EDTIOR environment variable is set; if not,
47 #### replace $EDITOR above with the name of your editor. Without that
48 #### profile entry, enter "e[dit] $EDITOR" at the What now? prompt.
49 rtm() {
50 rt -editor mhbuild "$@"
51 }
52
53
54 #### accept a calendar request
55 calaccept() {
56 repl -noformat -editor mhbuild \
57 -convertargs text/calendar '-reply accept -contenttype' "$@"
58 }
59
60 #### decline a calendar request
61 caldecline() {
62 repl -noformat -editor mhbuild \
63 -convertargs text/calendar '-reply decline -contenttype' "$@"
64 }
65
66 #### reply as tentative to a calendar request
67 caltentative() {
68 repl -noformat -editor mhbuild \
69 -convertargs text/calendar '-reply tentative -contenttype' "$@"
70 }
71
72 #### cancel a calendar request
73 calcancel() {
74 repl -noformat -editor mhbuild \
75 -convertargs text/calendar '-cancel -contenttype' "$@"
76 }
77
78
79 # Local Variables:
80 # mode: sh
81 # End: