File: muttprofile_perl580.html

package info (click to toggle)
muttprofile 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 184 kB
  • sloc: perl: 520; makefile: 13
file content (141 lines) | stat: -rw-r--r-- 4,325 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                             "http://www.w3.org/TR/html4/loose.dtd">

<html lang=en>

<head>
<title>Muttprofile and Perl 5.8.0</title>
<meta name="Keywords" content="mutt, muttrc, profiles, perl 5.8.0">
<meta name="Description" content="Muttprofile: problem with Perl 5.8.0 and fixing it">
<meta name=robots content="index,follow">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
</head>

<body bgcolor="#ffffff" text="#000000" link="#3333ff" vlink="#9999ff" alink="#ccccff">

<p>
<div align="center">
<font face="Arial,Helvetica,sans-serif">
<h1>Muttprofile and Perl 5.8.0</h1>
</div>

<p>
Muttprofile was developed using Perl version 5.005 and it also runs nicely with 
Perl 5.6.0 and Perl 5.6.1. However, I got some bug reports that muttprofile
does not work with Perl 5.8.0. So, I investigated the problem and here's what
I found and how to fix it. Please note that the problem is now history: muttprofile
works fine with Perl 5.8.1!
</p>

<h3>Symptons</h3>

<p>
The symptons are that muttprofile gives a nasty looking error message (similar to the one below) 
and messes up the terminal by loosing the line breaks.
</p>

<p>
<table bgcolor="#ccccff">
<tr>
<td><pre>
/bin/stty: invalid argument `2d00:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:ff:12:f:17:16:ff:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
                                                                         '
                                                                          Try `/bin/stty --help' for more information.

</pre>
</td>
</tr>
</table>
</p>

<p>
It turned out that the problem was related to Perl-module <b>Term::Complete</b>
which comes with all Perl5 distributions. Muttprofile uses this module for
taking care of the interactive selection of profiles. <b>However,
muttprofile actually works despite the error!</b>
</p>

<h3>Solution</h3>

<p>
I managed to find the bug in Term::Complete and, luckily, it was easy to fix.
I contacted the Perl maintainers with a fixed version and it
was included in the Perl development tree. Fixed version is now available with
perl 5.8.1 and later.
</p>

<h3>How can I get it to work?</h3>

<p>
You have at least three options for making muttprofile work with Perl 5.8.0:
</p>

<p>
<b>Option 1:</b><br>
Look for Perl 5.8.1 and install it. It includes a new version of the Term::Complete module
which does not have the stty-problem anymore.
</p>

<p>
<b>Option 2:</b><br>
If you're stuck with 5.8.0 for some reason, you may use the following quick-and-dirty
workaround:
</p>

<p>
In your macro for calling muttprofile, add the command 'stty -raw echo' 
after the muttprofile command. This will get the line breaks back. 
If you want to get rid of the stty error too, redirect stderr to
/dev/null when calling muttprofile.
In other words use macro defition such as this:
</p>

<p>
<table bgcolor="#ccccff">
<tr>
<td><pre>
macro   index   &lt;F9&gt;     "&lt;enter-command&gt;set wait_key\n!~/bin/muttprofile 2&gt; /dev/null;stty -raw echo\n:source ~/.mutt/profile.active\n&lt;enter-command&gt;unset wait_key\n" "Call muttprofile without stty error"
</pre>
</td>
</tr>
</table>
</p>

<p>
<b>Option 3:</b><br>
Upgrade the Term::Complete-module manually. The fixed version is available <a href="http://www.acoustics.hut.fi/~mara/mutt/Complete.pm">here</a>. Remember to make a backup of the original version, just in case.
</p>

<p>
I have tested these solutions with Debian but I see no reason why they wouldn't work
on RedHat 8 or other unix systems with perl 5.8.0.
</p>

<h2>Acknowledgments</h2>
<p>
Thanks to Marco Fioretti of the <a href="http://www.rule-project.org/en/">RULE Project</a>
for informing me about the problem and noticing the typo on my quick'n'dirty fix :-)
</p>

<p>
Jarkko Hietaniemi deserves credit for helping out with the fix as well as
his huge contributions to the Perl community.
</p>

<h2>Back to <a href="muttprofile.html">muttprofile</a></h2>
<p>

<hr>
URL: http://www.iki.fi/martti.rahkila/mutt/muttprofile_perl580.html<br>
Last update: 2003-11-20<br>
Author: Martti Rahkila <br>
</body>
</html>